minProximity
1
'minProximity' => integer // From 1 to 7
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
Precision of the proximity
ranking criterion.
Usage notes
The proximity ranking criterion measures how close together two matching words are in a search result.
The default value of minProximity
is 1. This means that the two matching words are right next to each other.
You can increase the minProximity
value to as much as 7 so that words that are further apart have the same proximity score. For example, if you set minProximity
to 2, the following phrases would have the same score:
- JavaScript framework
- JavaScript charting framework
The proximity ranking criterion is ignored if minProximity
is higher than 7.
Examples
Set default min proximity
1
2
3
$index->setSettings([
'minProximity' => 1
]);
Override default min proximity for the current search
1
2
3
$results = $index->search('query', [
'minProximity' => 2
]);