search
Use this method to debug the relevance of a specific record.
This method accepts a condition
and returns the first matching object along with its position information in the result set.
The findObject
method uses search internally so it can also retrieve the position for a given query.
For simply retrieving an object, use the more efficient getObjects
method instead.
Examples
Parameters
The callback used to find the object.
Scala only: the name of the index to query.
Whether to paginate the search results.
The query used to search.
A mapping of request options, when using this method.
Response
The hit matching your callback.A hit is made of the schemaless JSON object that you stored in the index.However, Algolia enriches them with additional fields like
_highlightResult
.Example:JSON
Number of the matching object’s position in the result set (zero-based).
Response as JSON
This section shows the JSON response returned by the API. Each API client wraps this response in language-specific objects, so the structure may vary. To view the response, use thegetLogs
method.
Don’t rely on the order of properties—JSON objects don’t preserve key order.
JSON