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.
To retrieve an object, use the more efficient getObjects method instead.
Examples
Parameters
function
required
The callback used to find the object.
string
required
Scala only: the name of the index to query.
boolean
default:true
Whether to paginate the search results.
string
The query used to search.
object
A mapping of request options, when using this method.
Response
object
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
integer
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