API Reference / API Parameters / restrictHighlightAndSnippetArrays
Feb. 26, 2019

restrictHighlightAndSnippetArrays

Type: boolean
Engine default: false
Parameter syntax
'restrictHighlightAndSnippetArrays' => true|false

Can be used in these methods:

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
]);
1
2
3
$results = $index->search('query', [
  'restrictHighlightAndSnippetArrays' => false
]);

Did you find this page helpful?