The following n1ql command runs successfully on the travel sample bucket to create the partial index:
CREATE INDEX travel_info ON ``travel-sample`` (name, id, icao, iata, type) WHERE type = 'airline'
But when I run the following query under EXPLAIN, the “travel_info” partial index I created above is ignored and the “def_type” index is used instead.
SELECT * FROM ``travel-sample`` USE INDEX (travel_info) WHERE icao="MLA" AND type="airline"
The documentation where I obtained the above CREATE INDEX example states:
This creates an index only on documents that have
type='airline'. The queries must include the filter
type='airline'in addition to other filters for this index to qualify.
I assume that my issue is that I need “other filters for this index to qualify”, but I am at a loss for what those other filters are – any ideas?