query
$index->search('my query');
Can be used in these methods:
search,
browseObjects,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
search,
browse_objects,
search_for_facet_values,
generate_secured_api_key,
add_api_key,
update_api_key
search,
browseObjects,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
search,
browse_objects,
search_for_facet_values,
generate_secured_api_key,
add_api_key,
update_api_key
search,
browse,
searchForFacetValues,
generateSecuredApiKey,
addAPIKey,
updateAPIKey
search,
browseObjects,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
Search,
Browse,
SearchForFacetValues,
GenerateSecuredApiKey,
AddApiKey,
UpdateApiKey
Search,
browse,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
Search,
BrowseObjects,
SearchForFacetValues,
GenerateSecuredAPIKey,
AddAPIKey,
UpdateAPIKey
search,
browse index,
search into facet values,
generateSecuredApiKey,
add key,
update key
About this parameter
The text to search in the index.
In Algolia’s documentation, the terms “query”, “query terms”, and “search text” mean the same thing: the text used to search the index.
Usage notes
- If the text is empty or absent, the search will match every object in your index.
- There’s a maximum of 512 characters per query. If a search query is longer, the API will return an error.
Don’t confuse a “query”, the search information entered by a user, with other search parameters, which you can use to further interrogate search responses.
Examples
Search a query
1
$results = $index->search('my query');
Return every record
When searching with an empty query, it will return every record in your index ordered by custom ranking.
1
$results = $index->search('');