Hi all !
I'm trying to merge multiple search query in ES but the result had no enough informations to match searched objects with results.
How can I do that ?
Thanks
query sample:
curl -X GET "localhost:9200/_search?pretty" -H 'Content-Type: application/json' -d'
{
"query": {
"terms": {
"labels": [ "Rebic", "Toto" ],
"boost": 1.0
}
}
}
curl -X GET "localhost:9200/_search?pretty" -H 'Content-Type: application/json' -d'
{
"_source": [ "labels", "id" ],
"query" : {
"bool": {
"should": [
{"match" : { "labels" : "Rebic" }},
{"match" : { "labels" : "Toto" }}
]
}
}
}'
response sample:
{
"took" : 6,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 15,
"relation" : "eq"
},
"max_score" : 24.525375,
"hits" : [
{
"_index" : "enwiki_latest",
"_type" : "_doc",
"_id" : "r-1jU3QBzwBIdiQJJlKB",
"_score" : 24.525375,
"_source" : {
"id" : "\"Q87486800\"",
"labels" : "{\"en\": {\"language\": \"en\", \"value\": \"Jelena Rebic\"}, \"nl\": {\"language\": \"nl\", \"value\": \"Jelena Rebic\"}}"
}
},
{
"_index" : "enwiki_latest",
"_type" : "_doc",
"_id" : "ktgeU3QBzwBIdiQJ2ssN",
"_score" : 17.667746,
"_source" : {
"id" : "\"Q2384109\"",
"labels" : "{\"fr\": {\"language\": \"fr\", \"value\": \"La T\\u00eate \\u00e0 Toto\"}}"
}
}
]
}
}