I'm a bit unsure about Limit Filter's in ElasticSearch. I dont think Im understanding them correctly.
I am searching multiple shards on multiple nodes of health record information. I want the top lets say 50 highest scored results to my query.
In the docs it says
A limit filter limits the number of documents (per shard) to execute on.
And this SO response states
You should use filters when you don't care about scoring, they are faster and cache-able.
But if scoring does matter in my case should I not use Limit Filter to limit my returns to the only the top 50 highest scored results?
Would something like this be more accurate (in java):
SearchResponse response = client.prepareSearch().setSearchType(SearchType.DFS_QUERY_THEN_FETCH).setQuery(qb).setFrom(0).setSize(50).setExplain(true).execute().actionGet();
Update I stumbled on this SO post where the response states:
Right, you should use filters to exclude documents from being even considered when executing the query.
Okay. So in this case, perhaps I can refine my question to the following:
How do I only return the top 50 scored results? Is the above java reference the correct solution?