#community-help

Numeric Fields Search in Typesense

TLDR Sean asked how to search numeric fields in Typesense. Kishore Nallan suggested creating a string version of the numeric field.

Powered by Struct AI

1

Aug 26, 2023 (3 months ago)
Sean
Photo of md5-cd6101523d59f9331291c2b25acbceac
Sean
08:52 AM
Hi, just getting started with Typesense. Is there a way to search against a numeric field? In the books example, I want to type a year in the search and return books that match that year. I don’t want to create a separate filter in the UI for it.
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
08:54 AM
q paramter only searches on string fields. So you will have to create another string version of year field.
Sean
Photo of md5-cd6101523d59f9331291c2b25acbceac
Sean
08:54 AM
ah ok. that’s great, thanks.

1