#community-help

Query Hack without Exists/Doesn't Exist Tag

TLDR David asks how to perform a specific query. Jason suggests a hack, creating a new boolean field and set it during indexing. The solution is agreed upon. Gustavo suggests allowing 'null' indexing.

Powered by Struct AI

1

5
4mo
Solved
Join the chat
Jul 14, 2023 (4 months ago)
David
Photo of md5-94c93df7325e8fde185c76c659656ee9
David
10:27 PM
Is there a hack to do this kind of query without an explicity exists/doesn’t exist tag?

https://github.com/typesense/typesense/issues/798
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
10:29 PM
I guess what you mentioned is the hack - create a new boolean field called fieldx_exists: true|false and set that at indexing time when you put together the JSON document, then filter on it
David
Photo of md5-94c93df7325e8fde185c76c659656ee9
David
10:32 PM
Ha
10:33
David
10:33 PM
Yes that sounds like it should work! thanks

1

Jul 15, 2023 (4 months ago)
Gustavo
Photo of md5-f930fdb99fd46477205fa1201164ea50
Gustavo
12:31 AM
Would be useful to allow indexing null besides omitting the field.