query
$index->search('YourQuery');
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,
GenerateSecuredApiKeys,
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
Search query string
The query parameter represents the query string Algolia matches against your index.
For an overview of how Algolia interprets and ranks queries, see Relevance overview.
Formatting rules
- An empty string (
"") returns all records, sorted bycustomRanking. - Query strings can be up to 512 bytes long.
- Boolean operators (
AND,OR,NOT) aren’t supported in the query string. - Multi-word queries require all words to match.
For example,
hot dogonly returns records containing bothhotanddog.
Related features and parameters
- Boolean logic: use filters or
optionalWords. - Broader matching when no results are found: use
removeWordsIfNoResults. - Phrase exclusion or exact matching: use
advancedSyntax.
Examples
Search for “shirt”
1
$results = $index->search('shirt');
Return all records
1
$results = $index->search('');