#community-help

Filtering Items with Low, Mid, and High Labels

TLDR Jameshwart needed assistance with filtering using Low, Mid, and High labels. Kishore Nallan provided an example and clarified that actual range of numbers should be used for filtering.

Powered by Struct AI
May 09, 2023 (7 months ago)
Jameshwart
Photo of md5-283d3397742c32cc2b6be6bda508c03e
Jameshwart
01:28 AM
Hi guys, is range facet working for you? I needed a range facet for product prices.
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
02:02 AM
Let me verify this again and get back to you.
Jameshwart
Photo of md5-283d3397742c32cc2b6be6bda508c03e
Jameshwart
02:02 AM
Thank you
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
02:31 AM
It does work, check this example: https://gist.github.com/kishorenc/a9521d19689999b5695bf5b47e04c286

Can you try the above and see?
Jameshwart
Photo of md5-283d3397742c32cc2b6be6bda508c03e
Jameshwart
02:33 AM
let me recheck things in my end.
02:33
Jameshwart
02:33 AM
and try again
02:41
Jameshwart
02:41 AM
it does work so if I want to filter using the low, mid and high I just pass in the value?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
02:47 AM
This is only faceting. So you want to filter also using those Low/High labels?
Jameshwart
Photo of md5-283d3397742c32cc2b6be6bda508c03e
Jameshwart
02:47 AM
yes
02:48
02:48
Jameshwart
02:48 AM
it has a filter
Image 1 for it has a filter
02:49
Jameshwart
02:49 AM
ah looks like I just need to pass in a value of number? for filter?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
02:50 AM
For filter you should send actual range of numbers and not label.
Jameshwart
Photo of md5-283d3397742c32cc2b6be6bda508c03e
Jameshwart
02:51 AM
for example, like price:>=100 && price<=150 ?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
03:20 AM
Yes

Typesense

Lightning-fast, open source search engine for everyone | Knowledge Base powered by Struct.AI

Indexed 3015 threads (79% resolved)

Join Our Community