- Type:
list<string> - Default:
[] - Scope:
settings,search
attributesToSnippet parameter defines which attributes should return snippets—short text fragments surrounding matched query terms.
Usage
- The default snippet length is 10 words unless otherwise specified, for example
"content:80". - Use
"*"to apply snippets to all attributes. - To turn off snippeting, pass an empty array (
[]). - Snippeting is limited to the first 50,000 characters per result (or 5,000 logograms for CJK languages).
- When enabled, the search response includes a
_snippetResultobject.
_snippetResult
Examples
Set default attributes to snippet
Current API clients
Current API clients
Legacy API clients
Legacy API clients
Snippet all attributes by default
Current API clients
Current API clients
Legacy API clients
Legacy API clients
Override default attributes to snippet for the current search
Current API clients
Current API clients
Legacy API clients
Legacy API clients