I create an autocomplete search using elasticsearch, so I need to query 3 indexes for posts , comments , authors . I have the following query:
{ "query":{ "query_string":{ "query":"something" } } }
call:
curl -X GET 'http://localhost:9200/posts,comments,authors/_search?pretty' -d '{ "query": { "query_string": { "query": "something" } } }'
I need to sort the results by specific index fields, for example:
index has a field called comments_count , votes_count comments_count , and posts_count authors. When comparing posts, it should be sorted by comments_count , when comments then votes_count , when authors then posts_count .
Is there anything you can do? I would not want to combine indexes into one, because they index completely different documents.
source share