Hello @flaviu
SQL++ N1QL has a built in capability to check if a value is null,
I created a sample data set on Couchbase Server 7.2.0 and this index definition seems to work well.
The query executes fully covered by this one index.
CREATE INDEX ii2 ON ii_fts(ii) WHERE ii IS NOT NULL
Give it a try and let us know how it works for you.
Thank you,
Ian McCloy (Couchbase, Director of Product)