ruleContexts
is a Search parameter that you can pass either from your back-end Search or your front-end Search.
back-end Search
You can pass this parameter when you call the search
API Client method:
index.search('query', {
ruleContexts: ['category-category_id-5252']
}).then(({ hits }) => {
console.log(hits);
});
You can find more information about the ruleContexts
API parameter in the following documentation: https://www.algolia.com/doc/api-reference/api-parameters/ruleContexts/
front-end Search
If you have a front-end Search implementation you would need to use the configure widget provided by our InstantSearch library. This lets you provide raw search parameters to the Algolia API:
instantsearch.widgets.configure({
ruleContexts: ['desktop']
});
Here you can see a working implementation on InstantSearch.js: https://codesandbox.io/s/async-framework-9pmnpg?file=/src/app.js