Search within the results got from elasticsearch -


is possible search within results elasticsearch?

to achieve need run & wait 2 searches on elasticsearch: first search is

{ "match": { "title": "foo" } } 

it takes 5 seconds , returns 500 docs etc.. , second search

{   "bool": {     "must": [       { "match": { "title": "foo" } },       { "match": { "title": "bar" } }     ]   } } 

it takes 5 seconds , returns 200 docs, has nothing first search elasticsearch's perspective.

instead of doing way, i'd offer "search further within result" option users. option, users can make search more keyword provided based on result returned first search.

so scenario user makes first search keyword "foo", , gets 500 results on webpage, , selects "search further within result", make second search within 500 results, , hope refined results quick.

how can achive it? thanks!

what use ids query. collect document ids first request, , post them new bool query includes ids query in must clause next original query. efficiently collect ids in first request using scroll api. since return second result sorted anyway, not make sense sorting in first request, can speed first request.

see:


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -