API Reference / API Parameters / queryType
Type: string
Engine default: "prefixLast"
Parameter syntax

Can be used in these methods:
search, setSettings, browseObjects, searchForFacetValues, generateSecuredApiKey, addApiKey, updateApiKey

About this parameter# A

Controls if and how query words are interpreted as prefixes.

Options #

prefixLast

Only the last word is interpreted as a prefix(default behavior).

prefixAll

All query words are interpreted as prefixes. This option is not recommended, as it tends to yield counterintuitive results and has a negative impact on performance.

prefixNone

No query word is interpreted as a prefix. This option isn’t recommended as users must type entire word before getting any relevant results.

Examples# A

Set default query type#

1
2
3
4
5
$index->setSettings([
  'queryType' => 'prefixLast'
  // 'queryType' => 'prefixAll'
  // 'queryType' => 'prefixNone'
]);

Override default query type for the current search#

1
2
3
4
5
$results = $index->search('query', [
  'queryType' => 'prefixAll'
  // 'queryType' => 'prefixLast'
  // 'queryType' => 'prefixNone'
]);
Did you find this page helpful?
PHP v3