search - How does ElasticSearch rank filter queries (rather than text queries)? -


i know elasticsearch uses relevance ranking algorithms such lucene's tf/idf, length normalization , couple of more algorithms rank term queries applied on textual fields (i.e. searching words "medical" , "journal" in "title" , "body" fields).

my question how elasticsearch rank , retrieve results of filter or range query (i.e. age=25, or weight>60)?

i know these types of queries filtering documents based on condition(s). lets have 200 documents age field value 25. of documents retrieved top 10 results?

does elasticsearch retrieve them order indexed them?

from elasticsearch documentation:

filters: general rule, filters should used instead of queries:

  • for binary yes/no searches
  • for queries on exact values

queries: general rule, queries should used instead of filters:

  • for full text search
  • where result depends on relevance score

so when running search such "age=25, or weight>60" should using filter.

however - filters not affect scoring - i.e. if used filter search results have same score.

there range query - query affect score , guess scores documents based on things document timestamp (most recent gets higher score).

you'd need explore documentation further , dig lucene documentation understand how , why document got score - above, may better using filters don't affect scoring.


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -