Skip to content

Filtering Nested Array Objects Hangs Indefinitely in v29 #2469

Description

@rajaie

Bug Description

I recently upgraded from v27.1 to v29 and tried to use the new nested array object filtering syntax.

I had a filterBy query that looked like this

id:!=[6536380] && ((remote_locations:US) || (locations.country:=US && locations.stateOrProvince:=CO && locations.city:=Denver) ) && employer_id:!=[16832] && posting_date:[1746506569..1754282569] && salary_ending_range:>=70000

which returned pretty quickly (<200ms)

and now this filterBy just hangs indefinitely

id:!=[6536380] && ((locations.{country:=US && stateOrProvince:=CO && city:=Denver}) || (remote_locations:US)) && employer_id:!=[16832] && posting_date:[1746506764..1754282764] && salary_ending_range:>=70000

If I get rid of && city:=Denver from my query using the new filter syntax, I get a response but it takes about 6 seconds.

If I remove && stateOrProvince:=CO && city:=Denver, I get a response in about 300 ms.

So the new filtering syntax is working, it just seems to be super super slow. Is that expected, or is there something going on? I can share more info but it just seems there's something that isn't right.

Reproduction Steps

The example at https://typesense.org/docs/guide/tips-for-filtering.html#filtering-nested-array-objects is good enough, you should be able to reproduce it using that but with a lot more records

Expected vs Actual

Expected behavior
To get a response

Actual behavior
Response times out

Environment

  • Typesense version: I'm using the latest 29 Docker image
  • Operating system: Ubuntu 22.04.5 x86_64

Additional Context

I have ~1 million documents in this collection

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions