Issue with Nested Objects Functionality in Typesense
TLDR Edward encounters unexpected results with nested objects functionality. Kishore Nallan confirms it's a limitation in Typesense and cites a related issue. Oliver shares a similar experience.
1
Feb 24, 2023 (9 months ago)
Edward
10:25 AMOn each one of our records we have a data structure like so
record1: aud_countries = [{name: 'United Kingdom', value: 10}, {name: 'Italy', value: 90}]
record2: aud_countries = [{name: 'Jamaica', value: 10}, {name: 'London', value: 90}]
The issue we are having is that when performing a search for say ‘London’ and ‘> 85’ we would expect to only get back record2, but we get back record1 as well. It appears to check for the presence of both values in both the whole array and objects within it, rather than just the object itself so it finds a value of 90 in both records.
Hopefully that makes sense.
Is there a way to achieve the desired functionality? or have we written our objects wrong?
Any help is greatly appreciated
Kishore Nallan
10:30 AMI think this is along the similar lines of this: https://github.com/typesense/typesense/issues/828
It's on our immediate backlog.
1
Oliver
02:03 PMTypesense
Indexed 3011 threads (79% resolved)
Similar Threads
Discussing Support for Nested Objects in Typesense
Martin expressed the need for support for nested objects in Typesense. Kishore Nallan mentioned the possibility of flattening objects before indexing and restoring them later. An issue has been created on GitHub to track this.
Efficient Data Structure for Querying Nested Parameters
Nikhil asked about nested parameter querying with 30,000 lists in Typesense. Jason suggested changing the data structure and flattening to multiple documents. Handling arrays of 30,000 IDs for list membership should be fine.
Nested Objects and Arrays in Typesense
Robert seeks advice on managing nested objects in Typesense. Kishore Nallan informs of upcoming support for nested objects and provides a current workaround. Robert indicates interest in tracking this feature. Kishore Nallan provides a link to follow the issue.