Search Sharepoint with keyword Query

http://www.sharepointmonitor.com/2010/08/sharepoint-search-using-keywordquery/

To build custom search applications on top of SharePoint you should use the new  Microsoft.Office.Server.Search.Query
object model.

You can use either FullTextSQLQuery or KeywordQuery

FulltextSQLQuerycomplex SQL queries
KeywordQuerysimple.

KeywordQuery

KeywordQuery class allows a (1) keyword or a (2) SharePoint property filter
to be passed directing to the search service without needing to construct a SQL query.

The ResultTypes
property should be set to ResultType.RelevantResults
to retrieve the results.

Call Execute to start searching.

Another one:
http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/02/19/how-to-use-the-moss-enterprise-search-keywordquery-class.aspx

FullTextSQLQuery

Can use CONTAINS, FREETEXT, FORMSOF (go went gone).

Enterprise Search queries however always query from SCOPE().

Very similar to KeywordQuery

Advertisements
Post a comment or leave a trackback: Trackback URL.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: