You are here

function search_api_multi_query in Search API Multi-Index Searches 7

Creates a multi-index search query.

For backwards-compatibility reasons, the options can be passed as either the first or the second parameter, the other one is ignored.

Parameters

$options: Associative array of options configuring this query. Recognized options are:

  • conjunction: The type of conjunction to use for this query - either 'AND' or 'OR'. 'AND' by default. This only influences the search keys, filters will always use AND by default.
  • 'parse mode': The mode with which to parse the $keys variable, if it is set and not already an array. See SearchApiMultiQuery::parseModes() for recognized parse modes.
  • languages: The languages to search for, as an array of language IDs. If not specified, all languages will be searched. Language-neutral content (LANGUAGE_NONE) is always searched.
  • offset: The position of the first returned search results relative to the whole result.
  • limit: The maximum number of search results to return. -1 means no limit.
  • 'filter class': Can be used to change the SearchApiQueryFilterInterface implementation to use.
  • 'search id': A string that will be used as the identifier when storing this search in the static cache.

All options are optional.

array $options2: Deprecated. Exactly the same as $options. Will be used if $options is no array.

Return value

SearchApiMultiQueryInterface A query object for searching multiple indexes.

1 call to search_api_multi_query()
SearchApiMultiViewsQuery::init in views/query.inc
Create the basic query object and fill with default values.
1 string reference to 'search_api_multi_query'
search_api_multi_views_data in views/search_api_multi.views.inc

File

./search_api_multi.module, line 49

Code

function search_api_multi_query($options = array(), array $options2 = array()) {
  $options = is_array($options) ? $options : $options2;
  return new SearchApiMultiQuery($options);
}