-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add multilevel structure example #8
Comments
Thanks for example. I don't think it will work with the current API version but it is definitely good use case for some requirements (i.e. ecommerce !?) I am thinking about the implementation and wondering how to store data that elasticsearch will be aware that
|
not only for ecommerce, but for any catalog contain system, like a sales aggregation page there is example of mapping for nested field from real project variants:
type: "nested"
properties:
id:
type: "integer"
status:
type: "boolean"
prices:
type: "nested"
properties:
value:
type: "integer"
oldValue:
type: "integer"
currencyCode:
type: "string"
options:
type: "nested"
properties:
id:
type: "integer"
value:
type: "string"
index: not_analyzed
minSize:
type: "integer"
maxSize:
type: "integer" |
It is not easy for implementation but it would be great feature. |
yeah this is looks like 👍 |
@pilot as I said this is great feature and even I would use it but it will take more time because I don't know yet how to make it simple and don't affect too much current functionality (import / export, / schema / response / elasticsearch mapping converting). How would you like to provide data to ItemsAPI to achieve multilevel structure in API response ? My idea is to add new aggregations type which override current var paths = [
'category1': ['sub-category1', 'sub-category2'],
'category2': ['sub-category1', 'sub-category3'],
'category3': ['sub-category2', 'sub-category3'],
'sub-category2': ['sub-sub-category1']
] Current terms aggregation looks like:
and the another new one aggregation could look like:
It would generate multilevel filters out of the box like in your picture. Do you think does it make sense ? |
I am sorry, configuration could look like this without additional field: {
"aggregations": {
"actors_terms": {"type": "recursive_terms", "field": "category", "size": 10, "title": "Categories", "paths": [
'category1': ['sub-category1', 'sub-category2'],
'category2': ['sub-category1', 'sub-category3'],
'category3': ['sub-category2', 'sub-category3'],
'sub-category2': ['sub-sub-category1']
]},
}
} |
yes, to clarify above aggregations will valid only for |
simple and ofter to use categories structure like:
The text was updated successfully, but these errors were encountered: