Hi all,
We have some index on array keys and I notice that if that key is not index first documents not having this key are indexed. I spotted that in Couchbase console comparing 2 index whose definition are:
CREATE INDEX `cursor_test_double_array_composite` ON `mybucket`(`sl`,(distinct (array (distinct (array (`v1`.`h`) for `v1` in (`v0`.`g`) end)) for `v0` in `f` end)),(meta().`id`)) WHERE (`@T` is not missing)
and
CREATE INDEX `cursor_test_double_array` ON `mybucket`((distinct (array (distinct (array (`v1`.`h`) for `v1` in (`v0`.`g`) end)) for `v0` in `f` end)),(meta().`id`)) WHERE (`@T` is not missing)
mybucket have 7 documents, all having @T key with some value.
Only difference between these is presence of “sl” key in composite one. The first index stats indicate 7 items whereas the second one has only 3. There are 4 documents have no data “pointed” by f.g.h path, but these are indexed in composite index.
Is there any way to modify the index create query to avoid composite index from indexing the 4 documents ?
Thanks,
Best