Hey <@U01NZ4D0LDD> I have a question about Typese...
# community-help
v
Hey @Jason Bosco I have a question about Typesense schema design and filtering. I'm working with nested objects in a schema, specifically a
ratings
field that looks like this: "ratings": [ { "rating": 5, "title": "general" }, { "rating": 2, "title": "specific" } ] Users can add their own ratings, but I'm running into an issue with filtering. I want to filter documents where, for example, the
specific
rating is greater than 3. If I define the schema as: -
ratings
as
object[]
, or -
ratings.title
as
string[]
and
ratings.rating
as
int32[]
, the filter might match a
title
from one object and a
rating
from another, rather than ensuring both criteria apply to the same nested object. Is there a way to specify that both conditions (
title
and
rating
) must be satisfied within the same nested object? Any guidance or workarounds would be greatly appreciated! Similar issue can be with the color search "rgba": [ { "r": 255, "g": 0, "b": 0, "a": 1 }, { "r": 0, "g": 255, "b": 0, "a": 0.5 } ] and I want to filter specific ranges for r, g, b, a - it also should match within one object in the array. Thanks in advance!
k
We are actually working right now on adding this feature. It will be available in the next week or so. You can track: https://github.com/typesense/typesense/issues/828
thankyou 1
🔥 1