Skip to content

Feature/9450 improve search relevance calculation - #357

Closed
shaunahu wants to merge 12 commits into
mainfrom
feature/9450-improve-search-relevance-calculation
Closed

shaunahu wants to merge 12 commits into
mainfrom
feature/9450-improve-search-relevance-calculation

Conversation

@shaunahu

@shaunahu shaunahu commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Before this change, a search word was scored twice: once on title or description, and again on the synonyms field. That happened even when the word was not an acronym, so ordinary words and full names like "ships of opportunity" got too much weight. Now ogcapi loads the acronym list from the Elasticsearch synonyms set when it starts and reloads it every day. It only searches the synonyms fields when the search text has an acronym in it, so "soop temperature" is still searched as "ships of opportunity temperature" but plain words count once.

A following up PR is required to update application-staging and application-production setup.

Explain endpoint demo:

Image

Before change, the relevance score got doubled:

Image

@shaunahu
shaunahu marked this pull request as ready for review October 7, 2026 01:20
@shaunahu
shaunahu marked this pull request as draft October 7, 2026 03:07
@utas-raymondng

utas-raymondng commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Maybe for fuzzy tile we can do

GET /your-index/_search
{
  "query": {
    "multi_match": {
      "query": "javascrip frameworks",
      "fields": [
        "title^3",
        "title.synonyms"
      ],
      "type": "best_fields",
      "fuzziness": "AUTO",
      "prefix_length": 2,
      "tie_breaker": 0.1
    }
  }
}

and exactly match use

GET /your-index/_search
{
  "query": {
    "multi_match": {
      "query": "AI applications",
      "fields": [
        "title^3",
        "title.synonyms"
      ],
      "type": "best_fields",
      "tie_breaker": 0.1
    }
  }
}

and you just need to change inside CQLFields.java

Finally remove the existing acronym_title and acronym_desc

@utas-raymondng utas-raymondng left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added comments

@shaunahu

shaunahu commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

Close this one as approach changed to: #357 (comment)

@shaunahu shaunahu closed this Oct 8, 2026
@shaunahu
shaunahu deleted the feature/9450-improve-search-relevance-calculation branch October 8, 2026 02:49

This branch had an error being deployed

1 failed deployment
test — 0ac990fa Deployed Oct 8, 2026 by shaunahu via build_test #862
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants