Partial Index (index with WHERE) is ignored by SELECT queries

According to the following linked thread, it appears that if all documents within a bucket do not have the attribute set that the partial index is filtered on, in this case the “type” attribute, then the partial index will be ignored by queries.

https://www.couchbase.com/forums/t/how-to-use-partial-index-without-where-clause/19114/3

I assumed that may be the case with the travel sample bucket, so I created my own bucket with two test documents and then created the partial index and then ran the query, which did then use the partial index that I had created.

The documentation that I cited in the previous post may want to not use the travel sample bucket for the partial index example because it appears to not work on that sample bucket.