Я новичок в elasti c поиск. Я только начал писать запросы. Какой предикат лучше всего использовать для соответствия приведенному ниже запросу (textvalue.value = "HeyHow" и totalamount> 0) в php.
Любая помощь очень важна. TIA
{
"took" : 0,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 5,
"relation" : "eq"
},
"max_score" : 1.0,
"hits" : [
{
"_index" : "testindex",
"_type" : "testindex",
"_id" : "El9eOp515UcTc3",
"_score" : 1.0,
"_source" : {
"id" : "El9eOp515UcTc3",
"user_ud" : "10000000000000",
"totalamount" : 0,
"textvalue" : [
{
"key" : "he",
"value" : "qwertyt"
}
],
"canchage" : false,
"created_at" : 1588349627
}
},
{
"_index" : "testindex",
"_type" : "testindex",
"_id" : "El9mKXLwhMNT60",
"_score" : 1.0,
"_source" : {
"id" : "El9mKXLwhMNT60",
"user_ud" : "10000000000000",
"totalamount" : 0,
"textvalue" : [
{
"key" : "he",
"value" : "HeyHow"
}
],
"canchage" : false,
"created_at" : 1588350044
}
},
{
"_index" : "testindex",
"_type" : "testindex",
"_id" : "El9oApiJYuf0Wr",
"_score" : 1.0,
"_source" : {
"id" : "El9oApiJYuf0Wr",
"user_ud" : "10000000000000",
"totalamount" : 0,
"textvalue" : [
{
"key" : "he",
"value" : "HeyHow"
}
],
"canchage" : false,
"created_at" : 1588350142
}
},
{
"_index" : "testindex",
"_type" : "testindex",
"_id" : "El9wuLOHPyy6cn",
"_score" : 1.0,
"_source" : {
"id" : "El9wuLOHPyy6cn",
"user_ud" : "10000000000000",
"totalamount" : 1,
"textvalue" : [
{
"key" : "he",
"value" : "HeyHow"
}
],
"canchage" : false,
"created_at" : 1588350638
}
},
{
"_index" : "testindex",
"_type" : "testindex",
"_id" : "ElA2giaCaGp8ir",
"_score" : 1.0,
"_source" : {
"id" : "ElA2giaCaGp8ir",
"user_ud" : "10000000000000",
"totalamount" : 100,
"textvalue" : [
{
"key" : "he",
"value" : "HeyHow"
}
],
"canchage" : false,
"created_at" : 1588350966
}
}
]
}
}
Я пытался использовать must для textvalue.value и нельзя для общей суммы, но это не сработало. Он просто получает все результаты, соответствующие textvalue.value