Welcome to MSDN Blogs Sign in | Join | Help

SQL Syntax Queries in MOSS Search

Hi all,

I have been asked few times for best practices on writing SQL Syntax Queries with respect to MOSS Search. There are great articles in the MOSS SDK and MSDN on best practices. In case folks are not aware of these, here are couple of quick links:

Best Practices: Writing SQL Syntax Queries for Relevant Results in Enterprise Search: http://msdn2.microsoft.com/en-us/library/bb219479.aspx

Enterprise Search SQL Syntax Reference: http://msdn2.microsoft.com/en-us/library/ms493660.aspx

Hope that helps
Mike

Published Friday, May 11, 2007 2:54 AM by miketag
Filed under: , ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: SQL Syntax Queries in MOSS Search

OMG I get asked for best practices on writing SQL Syntax Queries with respect to MOSS Search ALL THE TIME!!! Walking to the grocery store, in line at the movies, I'm talking night and day.

Saturday, May 26, 2007 7:35 PM by Behrnoosh

# re: SQL Syntax Queries in MOSS Search

Hi!

I was wondering... SQL syntax queries are very restrictive, no? I would like to build a query with comparisons on substrings.

Let me explain myself : my search must return documents that are in a SUBSITE of a site whose url is a parameter of the query.

So, I can't use something like "WHERE \"Path\" = %url%"... (where %url% is the parameter value)

I've tried with "WHERE POSITION (%url% IN \"Path\") > 0)", "WHERE INSTR (\"Path\", %url%) > 0", and even "WHERE %url% LIKE \"Path\"" and "WHERE \"Path\" LIKE %url%", but it doesn't work... I've obviously tried omitting replacing \"Path\" by Path, but same result...

Do you know how I could do that?

Thanks!

Wednesday, August 20, 2008 8:49 AM by Pierrot1977

# re: SQL Syntax Queries in MOSS Search

Hi!

I was wondering... SQL syntax queries are very restrictive, no? I would like to build a query with comparisons on substrings.

Let me explain myself : my search must return documents that are in a SUBSITE of a site whose url is a parameter of the query.

So, I can't use something like "WHERE \"Path\" = %url%"... (where %url% is the parameter value)

I've tried with "WHERE POSITION (%url% IN \"Path\") > 0)", "WHERE INSTR (\"Path\", %url%) > 0", and even "WHERE %url% LIKE \"Path\"" and "WHERE \"Path\" LIKE %url%", but it doesn't work... I've obviously tried replacing \"Path\" by Path, but same result...

Do you know how I could do that?

Thanks!

Wednesday, August 20, 2008 8:49 AM by Pierrot1977

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker