Relevance is how closely a search result matches a user’s query or information need. In full-text search, matching is not simply yes or no: documents receive positive scores and are ordered so stronger matches appear first. section 1.2.1 section 3.4
This matters when people search text with ambiguous terms. A bookstore search for “Java” should favor books about the programming language rather than documents about the Indonesian island or coffee. Relevant, fast results also help preserve the user’s search experience. section 10.0 section 10.1
Elasticsearch treats relevance differently across query types:
- Structured-data searches seek exact matches and ordinarily do not attach a relevance score. section 1.2.1
- Full-text queries search unstructured text and return scored documents for relevance-based ranking. section 10.0 section 10.13
- The common match query searches text fields and scores matching documents with a relevance algorithm. section 10.13
By default, Elasticsearch uses the BM25 similarity algorithm. Scores depend on factors including term frequency, inverse document frequency, and field length; Elasticsearch also offers other similarity algorithms for ranking matching documents. section 3.4.1 section 3.7
Why a shorter title can rank higher
For a title search for “Java,” “Effective Java” receives a higher score than longer matching titles such as “Head First Java.” All contain the term, but field-length normalization makes the term in the shorter title more relevant in this example. The highest returned score is max_score. section 3.4.1
Compare the returned Java-title documents and their scores to see relevance expressed as ranked search results. section 3.4.1
Relevance is commonly considered alongside precision and recall. These measures help frame whether results are appropriate and closely related to what a user searched for. section 10.1










