** Ich versuche zu aggregieren und Preisbereiche zu finden, wenn auf der Grundlage von geschachtelten Angebotspreis Array (verschachtelte Array) Objekt von sellerInfoES. Internes Feld ist "offerPrice". Wie kann ich Aggregation für das verschachtelte Array-Feld in Elasticsearch schreiben? Ich habe diese folgende Abfrage versucht, aber es funktioniert nicht. Immer diese Fehlermeldung: Parse Fehler [zwei Aggregationstypdefinitionen gefunden in [price_ranges]: [verschachtelte] und [Filter]]Wie funktioniert ElasticSearch verschachtelten Bereich Aggregation Abfrage
Mapping:
{
"productsearch": {
"mappings": {
"product": {
"properties": {
"brand": {
"type": "string"
},
"categories": {
"type": "string"
},
"model": {
"type": "string"
},
"mrp": {
"type": "double"
},
"productName": {
"type": "string"
},
"rating": {
"type": "double"
},
"reviewCount": {
"type": "long"
},
"sellerInfoES": {
"type": "nested",
"properties": {
"addr": {
"type": "string"
},
"country": {
"type": "string"
},
"geoAddress": {
"type": "string"
},
"location": {
"type": "string"
},
"offerPrice": {
"type": "double"
},
"pinCode": {
"type": "string"
},
"sellerId": {
"type": "long"
},
"sellerLocation": {
"type": "geo_point"
},
"state": {
"type": "string"
}
}
},
"sku": {
"type": "long"
},
"subCategory": {
"type": "string"
}
}
}
}
}
}
Abfrage:
{
"price_ranges": {
"nested": {
"path": "sellerInfoES"
},
"aggs": {
"range": {
"field": "offerPrice",
"ranges": [
{
"gte": 1000
},
{
"gte": 1000,
"lte": 10000
},
{
"gte": 10000,
"lte": 25000
},
{
"gte": 25000
}
]
}
}
}
}
Super! Es funktioniert. Danke vielmals ! –
Sie können es als akzeptiert markieren dann ..: P – Richa