ElasticSearch 5.6.3
'da iç içe geçmiş belgelerin toplanmasıyla ilgili bir sorunum var.İç içe geçmiş belgelerin toplamalarını ElasticSearch içinde alma 5.6.3, Lucene istisnasına yol açar
Benim sorgu aşağıdaki şekilde yapılandırılmıştır: beklendiği gibi
query
aggs
|_filter
|_nested
|_term
|_top-hits
Ben olmayan bir iç içe alanda toplanmasını çalışırsanız (ve tabii kaldırıldı iç içe AGG ile), her şey çalışıyor. şimdi yapılandırılmıştır gibi, ben Lucene bir durum alırsınız: Child query must not match same docs with parent filter. Combine them as must clauses (+) to find a problem doc. docId=2147483647, class org.apache.lucene.search.ConstantScoreScorer
Bu istisna değil ElasticSearch 2.4.6
tetiklenir olduğunu.
Toplamaları farklı bir şekilde yapılandırmaya çalıştım, ancak istenen sonuçları veren ve çalıştıran bir kombinasyonla gelemedim.
"recording": {
"dynamic": "strict",
"_all" : {
"enabled" : false
},
"properties": {
"id": {
"type": "integer"
},
"soloists": {
"properties": {
"type": "nested",
"person": {
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string",
"index": "not_analyzed"
}
}
}
},
"work": {
"id": {
"type": integer
},
"title": {
"type": "string",
"index": "not_analyzed"
}
}
}
Ve sorguda kendisi: Herhangi bir yardım son derece mutluluk duyacağız
{
"query": {},
"aggs": {
"my_top_results": {
"global": {},
"aggs": {
"my_filter_agg": {
"filter": {
"bool": {
"must": [
{
"bool": {
"should": [
{
"nested": {
"path": "soloists",
"query": {
"bool": {
"must": {
"match": {
"soloists.person.id": 77957
}
}
}
}
}
}
]
}
}
]
}
},
"aggs": {
"my_nested_agg": {
"nested": {
"path": "soloists"
},
"aggs": {
"my_terms_agg": {
"term": {
"field": "soloists.person.id",
"size": 10
}
"aggs": {
"my_top_hits_agg": {
"size": 1,
"_source": {
"include": [
"soloists.person.id",
"soloists.person.name"
]
}
}
}
}
}
}
}
}
}
}
}
}
haritalama neye benzediğini
budur.
bazı bağlantılar Ben tökezledi genelinde bir çözüm ararken:
- https://issues.apache.org/jira/browse/LUCENE-7674
- https://discuss.elastic.co/t/querying-on-a-subobject-field-within-a-nested-object/65533
- https://github.com/elastic/elasticsearch/issues/23280
- https://github.com/elastic/elasticsearch/issues/11749
Hey Claudiu, ilk şey şu ki 'my_top_hits_agg' doğru yerde değil,' my_terms_agg' topluluğunun içine yerleştirilmeli ve 'top_hits' anahtar sözcüğü eksik değil, değil mi? Sorgunun işe yaramadığına şaşırdım. – Val
Hey @Val! Böyle bir buluşma yolu. Tamamen haklısın - benim tarafımda bir kopya-yapıştır hatasıydı. Sorguyu düzelttim, ancak sorun devam ediyor ... – cvursache
Illy ;-) Filtreyi, en az gereksinim duyulana göre basitleştirirseniz, yani sadece iç içe filtre (bool/must + bool/should part)) ne olursa olsun ne olur? – Val