FAST is a search engine used for enterprise search. In FAST, a View specifies how content is structured. It has collections. A collection has documents. Each document has a specific structure, specified by fields.

Apart from specifying the content, a View has certain parameters to fine-tune the search. For example, parameters like lemmatisation and spell-check control the results returned by a search.

In the below code, we loop through the views, get collections for the view and dump the number of documents stored in each collection.

To create a search engine, use the HttpSearchFactory class. The GetSearchEngine method accepts the server URL and returns the search engine. HttpSearchEngine class has the GetViewList method to get a list of view names. Each view has a IContentSpecification interface. The interface exposes the Collections property which is a list of collection names. To get the number of documents within a collection, we perform a search.

FAST uses FQL or Fast Query Language. It is a proprietary syntax understood by the search engine. We pass the collection name for the search query. The FQL to get all documents is meta.collection:collection-name. The DocCount property of the search result object has the count of all documents stored in a collection.

Getting all collections stored in FAST
Tagged on:

Leave a Reply

Your email address will not be published. Required fields are marked *