facetFilters in autocomplete algolia

I m facing difficulties setting facetFilters for algolia-autocomplete. If i want to filter based on a few organizations like :
source: $.fn.autocomplete.sources.hits(index, { hitsPerPage: 5, facetFilters:[ ['organization_id:1', 'organization_id:10'], ['listing_status:Published' ]] })
It works perfectly fine.

Now I want to pick the values from a text box, it does not work. If the value of a text box is

<input type="hidden" id="marketplace_organization_ids" value="'organization_id:1', 'organization_id:10'"> source: $.fn.autocomplete.sources.hits(index, { hitsPerPage: 5, facetFilters:[ [$('#marketplace_organization_ids').val()], ['listing_status:Published' ]] }),
Tried using array also but no result:

var name = ["'organization_id:1'","'organization_id:10'"]; source: $.fn.autocomplete.sources.hits(index, { hitsPerPage: 5, facetFilters:[ [name.join(',')], ['listing_status:Published' ]] })

I have used the above with one organization like and t works fine:

source: $.fn.autocomplete.sources.hits(index, { hitsPerPage: 5, facetFilters:[ ['organization_id:'+$('#user_organization_id').val() , 'distributors.id:'+$('#user_organization_id').val()] ] }),

Appreciate any help.

Hi @sonal.mahajan,
I believe the issue might be with the syntax expected by facetFilters. If you contain everything in one array, it translates to an AND between all values.

So facetFilters: [ 'category:Book', 'author:John Doe' ]

is category:Book AND author:John Doe

but a nested array produces OR functionality: facetFilters: [ ['category:Book', 'category:Movie'] ]

=> (category:Book OR category:Movie).

So could you try something like

var facetFilters = [""]; 

source: $.fn.autocomplete.sources.hits(index, 
    { hitsPerPage: 5, 
     facetFilters:[ [ 'organization_id:1','organization_id:10', 'listing_status:Published' ]]
    }
)

and let us know how it works?