Autocomplete filter

Hi guys. Could somebody suggest on how to use “NOT” operator for autocomplete filters . I need to exclude products which not has inventory_management = shopify. Here is condition which i have tried to use NOT inventory_management:shopify.

Here is the full code on how i have used the filters:

var sourceOptions = {
    hitsPerPage: params.hitsPerPage,
    highlightPreTag: '<span class="aa-highlight">',
    highlightPostTag: '</span>'
};

if (section === 'products') {
    sourceOptions.filters = 'NOT inventory_management:shopify';
}

return {
   name: section,
   source: $.fn.autocomplete.sources.hits(params.index, sourceOptions),
   displayKey: 'title',
   templates: templates
}

I use Algolia app for Shopify, Thanks in advance.

This is exactly the filter you need to use.

The issue here is that any attribute that you want to use as a filter needs to be added to your index attributesForFaceting setting.
To see them, head to Settings > Synchronize Settings and click on primary index settings > Display tab.
This is something that we do implicitely when you change your facets in the Search Options tab.
In this case though, we didn’t expect users to be able to facet on this, so you can’t do this yourself.

I’ve just deployed a change that will put in inside those attributesForFaceting for everybody.
To make use of it, head in your app, change the facets in the Search Options tab, Save, then restore them as they were and resave.
If you go see your primary index settings again, you should now see inventory_management being added.