advancedSyntax
false
'advancedSyntax' => true|false
Can be used in these methods:
search,
setSettings,
browseObjects,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
search,
set_settings,
browse,
search_for_facet_values,
generate_secured_api_key,
add_api_key,
update_api_key
search,
setSettings,
browse,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
search,
set_settings,
browse_objects,
search_for_facet_values,
generate_secured_api_key,
add_api_key,
update_api_key
search,
setSettings,
browse,
searchForFacetValues
search,
setSettings,
browseObjects,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
searchAsync,
setSettingsAsync,
browseAsync,
searchForFacetValues
Search,
SetSettings,
Browse,
SearchForFacetValues,
GenerateSecuredApiKey,
AddApiKey,
UpdateApiKey
Search,
setSettings,
browse,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
Search,
SetSettings,
BrowseObjects,
SearchForFacetValues,
GenerateSecuredAPIKey,
AddAPIKey,
UpdateAPIKey
search,
setSettings,
browse index,
search into facet values,
generateSecuredApiKey,
add key,
update key
About this parameter
Enables the advanced query syntax.
This advanced syntax brings two additional features:
-
Phrase query: a specific sequence of terms that must be matched next to one another. A phrase query needs to be surrounded by double quotes (
"
). For example,"search engine"
will only match records havingsearch
next toengine
.Note: Typo tolerance is disabled inside the phrase (i.e. within the quotes).
-
Prohibit operator: excludes records that contain a specific term. This term has to be prefixed by a minus (
-
). For example,search -engine
will only match records containingsearch
but notengine
.
Examples
Enable advanced syntax by default
1
2
3
$index->setSettings([
'advancedSyntax' => true
]);
Enable advanced syntax for the current search
1
2
3
$results = $index->search('query', [
'advancedSyntax' => true
]);