How to do complex querying with logical operations by using searchkick
A OR B OR ( C AND D )
Product.search where: {or: [[{brand: 'nike'}, {in-stock: true}, {price: {lte: 12}, color: 'red'}]]}
A AND B AND ( C OR D )
Product.search where: {brand: 'nike', in-stock: true, or: [ [{price: {lte: 12}}, {color: 'red'}] ]}
Update
(A OR B) AND (C OR D)
Product.search where: {or: [[ {or: [[{brand: "nike"}, {in-stock: "true"}]]}], [{or: [[{price: 100}, {color: "red"}]]}]]}