I am looking for a better way of filtering an array of values through Maeiliseach using an array. I have users that can have multiple accounts and want to search all of a users accounts inventory. I have indexed the Inventory items.
This what a current do
Inventory.search("",{filter: ['account_id = 4 OR account_id = 5']})
I can use
accounts = user.accounts.pluck(:id)
to get all the id's. Once I have them I can turn it into a string for answer like this 'account_id = 4 OR account_id = 5'. But seems like that might not be the best way and I am missing something. Any help much appreciated. The documentation didn't seem to have the answer I was looking for but maybe I missed it.
I had the wrong version of pagy that is why I was getting the errors.