ruleContexts
[]
'ruleContexts' => [ 'context_value', ... ]
Can be used in these methods:
search,
browseObjects,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
search,
browse,
search_for_facet_values,
generate_secured_api_key,
add_api_key,
update_api_key
search,
browse,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
search,
browse_objects,
search_for_facet_values,
generate_secured_api_key,
add_api_key,
update_api_key
search,
browse,
searchForFacetValues
search,
browseObjects,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
searchAsync,
browseAsync,
searchForFacetValues
Search,
Browse,
SearchForFacetValues,
GenerateSecuredApiKey,
AddApiKey,
UpdateApiKey
Search,
browse,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
Search,
BrowseObjects,
SearchForFacetValues,
GenerateSecuredAPIKey,
AddAPIKey,
UpdateAPIKey
search,
browse index,
search into facet values,
generateSecuredApiKey,
add key,
update key
About this parameter
Enables contextual rules.
Provides a list of contexts for which rules are enabled. Contextual rules matching any of these contexts are activated, as well as generic rules.
Usage notes:
-
When empty, only generic rules are activated.
-
For performance reasons, you may pass up to 10 different contexts to the API at a time at query time.
Examples
Specify query rules context for the current search
1
2
3
4
5
6
$results = $index->search('query', [
'ruleContexts' => [
'front_end',
'website2'
]
]);