So I have a question, do all of your documents have a deleted_at field with an empty string or explicitly marked as a null value? Or is the field missing in that document? Forgive me I am exploring this issue for the first time with FTS and although this may seem obvious I’d like to make sure that I understand how to replicate your underlying data. Sorry for the delay.
Can you show the query you are using this clause in? Any additional code and context you can give .
Is it possible that you can just use a N1QL query that uses FTS?
SELECT meta().id, x.name
FROM `my-bucket` as x
WHERE SEARCH(x, {"field": "name", "match": "something*"}, {"index": "my-index"})
AND t.iata IS NOT NULL;
Also, since FTS searches on text within a field, and not on the value of a field, I think the approach you were trying would only find fields that have an empty string as their value. I’m not sure there is any way (with an FTS search) to match on a null value, BUT I am continuing to look into this and the possibility of using a BooleanQuery.
do all of your documents have a deleted_at field with an empty string or explicitly marked as a null value? Or is the field missing in that document?
all documents have deleted_at and it’s either null or a string
Is it possible that you can just use a N1QL query that uses FTS?
yeah we do that in other places, and that’s why i know we can use a null comparison just like you suggest. it’s just this part is using the SDK builder methods and i don’t want to rewrite it if i don’t have to just to work around this common case.
i guess i could go dig around in the SDK source and see how this code actually works under the covers–trying to avoid that too