You are here

public function SearchApiMultiQueryInterface::execute in Search API Multi-Index Searches 7

Executes this search query.

Return value

array An associative array containing the search results. The following keys are standardized:

  • 'result count': The overall number of results for this query, without range restrictions. Might be approximated, for large numbers.
  • results: An array of results, ordered as specified. The array keys are arbitrary unique keys, values are arrays containing the following keys:

    • id: The item's ID.
    • index_id: The machine name of the index this item was found on.
    • score: A float measuring how well the item fits the search.
    • fields: (optional) If set, an array containing some field values already ready-to-use, keyed by their field identifiers (without index prefix). This allows search engines (or postprocessors) to store extracted fields so other modules don't have to extract them again. This fields should always be checked by modules that want to use field contents of the result items.
    • entity (optional): If set, the fully loaded result item. This field should always be used by modules using search results, to avoid duplicate item loads.
    • excerpt (optional): If set, an HTML text containing highlighted portions of the fulltext that match the query.
  • warnings: A numeric array of translated warning messages that may be displayed to the user.
  • ignored: A numeric array of search keys that were ignored for this search (e.g., because of being too short or stop words).
  • performance: An associative array with the time taken (as floats, in seconds) for specific parts of the search execution:

    • complete: The complete runtime of the query.
    • hooks: Hook invocations and other client-side preprocessing.
    • preprocessing: Preprocessing of the service class.
    • execution: The actual query to the search server, in whatever form.
    • postprocessing: Preparing the results for returning.

Additional metadata may be returned in other keys. Only 'result count' and 'result' always have to be set, all other entries are optional.

1 method overrides SearchApiMultiQueryInterface::execute()
SearchApiMultiQuery::execute in ./search_api_multi.query.inc
Implements SearchApiMultiQueryInterface::execute().

File

./search_api_multi.query.inc, line 218

Class

SearchApiMultiQueryInterface
Interface representing a search query on multiple Search API indexes.

Code

public function execute();