-
Notifications
You must be signed in to change notification settings - Fork 24.6k
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
Support min_children & max_children for nested docs #10043
Comments
+1 we should add this! I think we should also open an issue for this in Lucene, because the |
I opened: https://issues.apache.org/jira/browse/LUCENE-6354 to get this in Lucene |
+1 |
+1 |
5 similar comments
+1 |
+1 |
+1 |
+1 |
+1 |
This would be a great feature to have. The only reason why we are using parent/child instead of nested mapping is the lack of min_children/max_children options in the nested query. Considering that:
I would very much like to see this implemented. Please let me know if there's anything I can do to help. |
Any update on this? Would be really, really good to have this feature! |
@elastic/es-search-aggs |
Stalled waiting for https://issues.apache.org/jira/browse/LUCENE-6354 to be completed and merged |
+1 |
+1 I'd love to see this. To give some context - while the main reason for us to migrate to a parent/child model from nested was indexing speed we also did so because of the However, we have become painfully aware of the cost of For stability reasons, we are re-considering the nested model even if it means decreased indexing speed. Knowing, that Thank you! |
Note: for comments and last updates, please refer to: GIST 290e31176f493814823a20f281e82fd4. Alternative solutionTo support
CasesTo effectively support
Depending on the scenario, the request will look different. Notes about
|
Any update on this? I'm trying to filter my results based on an exact length. @xethorn I can't seem to get your solution working with filters, could you point me in the right direction? Here's my search with filters, which don't support scoring: GET /test/_search
{
"query" : {
"function_score": {
"min_score": 20,
"boost": 1,
"functions": [
{
"script_score": {
"script": {
"source": "if (_score > 20) { return - 1; } return _score;"
}
}
}
],
"query": {
"bool" : {
"filter": [
{ "range": { "distance": { "lt": 5 }}},
{
"nested": {
"score_mode": "sum",
"boost": 10,
"path": "dates",
"query": {
"bool": {
"filter": [
{ "range": { "dates.rooms": { "gte": 1 } } },
{ "range": { "dates.timestamp": { "lte": 2 }}},
{ "range": { "dates.timestamp": { "gte": 1 }}}
]
}
}
}
}
]
}
}
}
}
} A few more details here: https://stackoverflow.com/questions/63226805/filter-query-by-length-of-nested-objects-ie-min-child |
Question was answered on slack overflow. For comments and last updates, please refer to: GIST 290e31176f493814823a20f281e82fd4. :) |
Pinging @elastic/es-search (Team:Search) |
Pinging @elastic/es-search-relevance (Team:Search Relevance) |
I am opening this as a separate issue since the previous issue was closed with support for parent-child docs (#6019 (comment)).
We would love to have support for min_children & max_children or similar also for nested filters/docs. https://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-has-child-filter.html#_min_max_children_2
Thanks a keep up the great work.
The text was updated successfully, but these errors were encountered: