Hello, I have a multi-select field populated as an array. Let's
consider I have a field
cities = ["NY","SF","CH",AL","LA"]
I want to find entries which contains "NY" and "AL", so I perform a
textQuery with field cities and query as "NY AND AL". However, this
would return any entry which contains NY and AL, for eg ["NY","SF"]
and ["CH","AL"] would both be returned.
However, I would also like to only provide only those entries which
only contain both NY and AL. Any entry which contains only either of
this fields should not be returned. I solve this by constructing a
query string which contains ["NY","AL"] and doing a phrase_prefix
query. This returns to me only entries which contain for eg
["NY","AL"] or even an entry which contains ["NY","AL","LA"] in cities
However, it cannot return the entry ["NY","SF","AL"] or
["NY","SF,"CH","AL","LA"]..because SF and CH are entries between NY
and AL. Do I have to construct then a permutation of all possible
entries between NY and AL..eg. phrase_prefix of ["NY","SF","AL"] and
["NY","SF","CH","AL"] to return what I need. Is what I'm trying to do
correct Or is there an easier and more correct way of doing this?
Also, at a later point in time I would like to provide any 2/3 city
match though its only something I might think about adding at a later
point in time? How could I also achieve this? Thanks!