Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Basically I would like to get all results that would returned for a normal keyword query, but I want to filter those results with a WHERE clause. I tried using KeywordQuery or FullTextSqlQuery but didn't see anything in either that would appear to let me do that. Can someone point me in the right direction?

share|improve this question
1  
I'd suggest that you just use the KeywordQuery, if you ever want to upgrade to FAST then FullTextSqlQuery insn't suppoerted. what kind of WHERE can't you express using KeywordQuery? –  Per Jakobsen May 25 '12 at 22:46
add comment

1 Answer

Looks like you can pass in a keyword along with some parameters to filter the results. Example:

KeywordQuery kw = new KeywordQuery();
kw.QueryText = "some keyword (DocumentDate >= 1/1/2009 AND DocumentDate <= 12/31/2009)";

will return only results that would be returned for a search on "some keyword" that have a DocumentDate somewhere in 2009.

You can find the details here.

Hope this helps someone!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.