Scoping autocompletion in a meta collection by the selected sub-collection

I could use some help filtering my autocomplete suggestions by the current facet.

I have set up a meta collection with 3 sub-collections. I have also set up a facet containing the 3 sub-collections.

When I start typing a search term, suggestions from outside the selected sub-category facet are being displayed. This seems to happen because the autocomplete keywords are not filtered by the selected facet. I found that this might be misleading to some users.

As a workaround, I tried setting the collection in the autocomplete plugin as the selected sub-category. But the category doesn’t seem to update when I select a different subcategory. Here’s a snippet:

$studyTypeInput.on('change', () => {
    let type               = $(this).find('option:selected').val();
        selectedCollection = collections[type];
            
    $searchInput.autocompletion({
        datasets: {
            organic: {
                collection: selectedCollection,
                profile : '_default',
                program: 'https://mysearchhost.squiz.cloud/s/suggest.json',
                format: 'extended',
                alpha: '0.5',
                show: '10',
                sort: '0'
            },
        },
        typeahead: {
            hint: true
        },
        length: 3
    });    
}).change();

Hi zenozaplaic,

Funnelback only supports scoping auto complete by collection and profile. i.e.

collection: selectedCollection,
profile : '_default',

It currently does not support being able to scope based on a facet selection.

However, if the facets are based around urls (i.e. refining search based on sections of a site or different websites), a potential workaround would be to setup profiles and use gscopes. Please note that this will be a non-trivial task.

Hope this helps.

Gioan