I have a question about how to implement an FTS query. I have documents where we store metadata (which are mainly key/value as string).
I need to match or find all the documents where the metadata field does not have the field “test” defined.
I know that with N1QL is possible, but not sure if there is an equivalent query in FTS.
One way to achieve this is using the
must_not clause of the boolean query. Here’s how that’d look -
With this query you’d be requesting for documents that do not contain anything (wildcard) within the field metadata.test. This won’t be the most performant query, but it should get you what you’re looking for.
N.b. in the SDKs this is represented with a BooleanQuery and its mustNot() method.