restrictHighlightAndSnippetArrays
false
'restrictHighlightAndSnippetArrays' => true|false
Can be used in these methods:
search,
setSettings,
browseObjects,
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,
browseObjects,
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,
generateSecuredApiKey,
addAPIKey,
updateAPIKey
search,
setSettings,
browseObjects,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
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
Restrict highlighting and snippeting to items that matched the query.
Impact on the response:
-
When
false
, all items are highlighted/snippeted -
When
true
, only items that matched at least partially are highlighted/snippeted
Examples
Set restrictHighlightAndSnippetArrays default value
1
2
3
$index->setSettings([
'restrictHighlightAndSnippetArrays' => true
]);
Override restrictHighlightAndSnippetArrays for the current search
1
2
3
$results = $index->search('query', [
'restrictHighlightAndSnippetArrays' => false
]);