Asking for help, search nested objects
GonzalesDK opened this issue · comments
Hi
I kindly ask for some help regarding searching objects.
All the examples I have seen, assume that the item list has a structure similar to :
var rows = [
{
"runtime": 142,
"country": [
"USA"
],
"tags": [
"prison",
"wrongful imprisonment",
], .....
Then
aggregation filters (and more)
aggregations: {
tags: {
title: 'Tags',
size: 10,
conjunction: true
},
Now this makes it possible to search tags for the values, but imagine that tags in rows would not be a list of string but a list objects
{ desc: "A super tag",
created: "some date" }
How would you filter that ?
Thank you
regards
Tommy
Hey @GonzalesDK,
Personally I'd preprocess your data so it has a flat structure. I'd keep the flat array only for searching and I'd keep the separate array with nested object for displaying in your layout / views. Imo this is the common practice even with more sophisticated engines like Elasticsearch (different search data in ES and original nested / relational data in PostgreSQL or MySQL)
@cigolpl Thanks a lot, was doing something like that, just wanted to make sure that there wasn't some other way of doing it. Thank you
i have the same problem with realizing custom facet values ordering - something like with fields value as objects {name: USA, sortcode:1}
The story looks the same not only with elastic , but Algolia and Meilisearch +Typesense. May be to solve it is the way to make advantage for itemsjs ?
Hello!
first of all, thank you for the awesome project.
But, i'm agree with previous comments
you are already using lodash as dependency, it will be great if you will implement GET function of lodash for nested props of json objects,