Ich habe ein Problem, wie man Punkte (_score
) für Elemente der Sammlung von gefundenen Dokument (eingebettete Dokumente) erhalten.Elasticsearch - Punktzahl für Objekte der Sammlung
z. Ich suche ein Produkt mit einem bestimmten Teil. Ich möchte also wissen, welcher Teil am besten passt.
Um genau zu sein: Ich möchte nicht die Anzahl der inneren Dokumente (Teile des Produkts) in der Ergebnismenge beschränken. Ich muss nur wissen, welcher Teil am besten passt.
Meine Mapping:
"products": {
"properties": {
"Id": {
"type": "string"
},
"Name": {
"type": "string"
},
"RelationshipId": {
"type": "string"
},
"Parts": {
"properties": {
"PartName": {
"type": "string"
},
"CompanyId": {
"type": "string"
},
"IsPrimary": {
"type": "boolean"
}
}
}
}
}
Meine Abfrageergebnis:
{
"took": 2,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 1,
"hits": [
{
"_index": "localhost",
"_type": "products",
"_id": "9AEEA518-D4F1-E611-8274-8CDCD44D0F98",
"_score": 1,
"_source": {
"Id": "9AEEA518-D4F1-E611-8274-8CDCD44D0F98",
"Name": "Test1",
"RelationshipId": "B51AA2C8-D3F1-E611-8274-8CDCD44D0F98",
"Parts": [
{
"PartName": "abc 1",
"CompanyId": "9EEEA518-D4F1-E611-8274-8CDCD44D0F98",
"IsPrimary": "1"
},
{
"PartName": "wer 2",
"CompanyId": "BAAF7E32-D4F1-E611-8274-8CDCD44D0F98",
"IsPrimary": "0"
}
]
}
}
]
}
}
können Sie uns auch Ihre Anfrage zeigen – user3775217
@ user3775217 gerade jetzt war es nur "match_all" –