queryType
'queryType' => 'prefixLast'|'prefixAll'|'prefixNone'
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
Determine how query words are interpreted as prefixes.
Query words are interpreted as prefixes in one of three ways.
Options
|
(Default.) Only the last word in the query is interpreted as a prefix. Other words in the query must be complete matches. |
|
Every word in the query is a prefix |
|
Turns off prefix search: only returns results if the full query matches words in the attribute |
Examples
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'
]);