Microsoft FAST Search for SharePoint provides enterprise search and information retrieval capabilities. FAST provides a API to query documents indexed in the server. The API is available in a proprietary assembly, Esp-SearchApi.

We will write a simple program to perform a search. We use the following namespaces.

Search method

We write our Search method as follows.

There is quite a lot going on in the method. The method accepts an URL and a search query. URL refers to the FAST server URL. Search Query is what we are searching for in the indexed documents.

HttpSearchFactory is the factory class to instantiate the search engine. We pass the FAST server URL to the factory constructor. We use the GetSearchEngine factory method to get a search engine. The search engine has a Search method which performs the actual search. We pass the search query to the Search method.

The Search method returns a collection of documents. These documents are wrapped into a IQueryResult object.

Main method

Our Main method calls the Search method we defined earlier.

We send the query, meta.collection: collection-name to the search engine. This query is quite basic. It gets documents from a FAST collection. As you know, a collection stores the documents. So, this query gets few documents from the collection. We display the number of documents retrieved in the console. And wait for the user to exit the program.

Introduction to FAST Search API
Tagged on: