#community-help

Resolving 'not equals filtering' Error on 'id' Field

TLDR Andrew had a problem with filtering on the 'id' field. Jason suggested duplicating the value in a different field and confirmed Daniel's understanding about the fix.

Powered by Struct AI

2

4
12mo
Solved
Join the chat
Oct 19, 2022 (12 months ago)
Andrew
Photo of md5-7766f890de99fa72a6d81315691a6758
Andrew
03:48 PM
Just a quick follow up, im trying to do

‘filter_by’: ‘id:!{ids}, but it throws ‘not equals filtering is not supported on the ‘id’ field. Is this a bug?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
03:54 PM
This is a known limitation specifically on the id field (since it’s an internal field used by Typesense). If you duplicate the same value in a different field, you should be able to do this

1

Daniel
Photo of md5-e2351af23a1bb70795da09fa3b369b10
Daniel
03:59 PM
Am I right in saying that the duplicated id field will have to be "facet": true in the schema for the negation to work Jason?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
04:00 PM
Correct

1