Enterprise Search

Introduction:
Enterprise Search is one of the most compelling features of SharePoint Server 2007. The out-of-the-box capabilities can drastically improve end users’ experience in retrieving relevant information. The same capabilities are available for custom SharePoint applications through dedicated APIs.
There are three ways to create and run search queries against the SharePoint API, each with specific advantages. A description of each approach follows.
  • Keyword Search Queries
  • Search Web Service
  • List Query API (SPQuery Class)

Keyword Search Queries:

This is the most straightforward approach. Once you specify in your code what keywords to look for, you can just run that query and start retrieving results. For its simplicity, the keywords-only approach comes with limitations. In particular you will not be able to define comparison constraints in the query.

Search Web Service:

SharePoint Server 2007 exposes most of its search functionalities as a web service. You can reference this web service from any other application to run queries against your SharePoint farm and use those results outside the context of SharePoint Server. Because all our code executes in the context of SharePoint Server, we passed on leveraging the search web service to favor full text SQL queries.

List query API (SPQuery class):

SPQuery is the class of choice to query and return items from a single SharePoint list. The query syntax uses CAML (Collaborative Application Markup Language). CAML queries were already available in SharePoint Server 2003. They provide a way to run XML-formatted queries against SharePoint content. The syntax is quite powerful, with the ability to filter data based on field comparisons. Note that by default only queried items in a single list folder will be returned. Items from subfolders will not be included in the search results.

Cheers…

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s