I need to perform a N1QL query where some of the records can be selected by an indexed attribute and others can be identified by their IDs. I tried to use
SELECT name FROM b WHERE collection in $cList OR meta().id IN $idList
But this returns an error saying there is no index available that matches my query. I can use UNION with 2 separate queries:
SELECT name FROM b WHERE collection in $cList
UNION
SELECT name FROM b USE KEYS $idList
Is that the best way to do this? Or is there some way to combine results from an index and USE KEYS in a single query?