Advanced guides

How Monocle ranks results

Monocle first classifies the query. It then ranks results for that query type.

Short version

Results rank higher when they meet more of these conditions:

  1. The result covers the full query. For a multiword query, a complete match ranks above a partial match.
  2. The result is an exact or close match. An exact word ranks above a fuzzy match. A small typo ranks above a larger typo.
  3. The terms are close together. Terms in one passage rank above terms that are far apart.
  4. The match is in an important field. Titles and structural fields have more weight. Body text and descriptions have more weight for natural-language queries.
  5. The query identifies a page. A short navigational query gives more weight to titles, URLs, aliases, and headings.
  6. Semantic matching is useful. Monocle can add semantic matches for longer queries. It reduces semantic matching for short or exact queries.
  7. The result is recent. Newer content can win a tie.

Monocle prioritises complete, exact, and nearby matches. It broadens the search when the query benefits from broader matching.

Detailed version

1. Query classification

Before ranking, Monocle classifies the query:

  • Exact queries include quoted phrases, URLs, and code-like strings. Monocle applies strict matching to these queries.
  • Navigational queries are short queries that identify a page. Monocle gives more weight to page-identifying fields.
  • Natural-language queries are longer and more descriptive. Monocle can give more weight to descriptions, body text, and semantic matches.

This classification controls field weights and semantic matching.

2. Keyword matching

Keyword matching provides the main score. It prioritises:

  1. Coverage: results that match all query terms
  2. Low typo distance: smaller spelling differences
  3. Exact whole-word matches: exact words instead of prefix or fuzzy matches
  4. Proximity: query terms that occur close together
  5. Field importance: titles and structural text before descriptions and body text, depending on the query type
  6. Exact phrases: phrases that appear as written
  7. Recency and lexical score: signals that can break a tie

For a multiword query, results usually must contain the full query. The terms must also occur near one another somewhere on the page.

3. Typeahead uses prefixes

While a visitor types, Monocle treats the last positive term as a prefix. For example, interior desi can find interior design without making the full query fuzzy.

Quoted phrases remain strict. Excluded terms remain excluded.

4. Semantic matching supports keyword matching

Semantic matching supplements keyword matching:

  • Monocle reduces or disables it for short or exact queries and for strong keyword results.
  • It contributes more to longer queries when keyword matching is too narrow.
  • A result that only has semantic support must meet a higher threshold.

5. Specific page signals

If a query identifies a page, utility item, URL slug, or known label, Monocle can rank that page higher.

6. Ambiguous queries

For an ambiguous short query or an exact query without a clear match, Monocle uses less expansion and stricter filtering. It can return no result instead of ranking an unrelated result first.

Previous
Add custom content