SearchQuery Class

This section provides an overview of the SearchQuery class and discusses:

  • SearchQuery class methods.

  • SearchQuery class properties.

The SearchQuery object is used to define the attributes of a search query—such as its category or categories (index or indexes), facet filters, query text, and so on—and then execute that query on a search engine instance. The required properties of a SearchQuery must be initialized before invoking the Execute method. However, which properties are required depend on the specific search engine. Moreover, all properties are not necessarily used for every execution of a search query. For example, if no filters are to be applied to the search then it is not necessary to initialize the Filter property.

A SearchQuery object is returned by the CreateQuery method of the SearchQueryService class.