Index time boost is deprecated

Created on 18 November 2020, about 4 years ago
Updated 17 July 2024, 4 months ago

Problem/Motivation

From Official Elasticsearch documentation:
"Index time boost is deprecated. Instead, the field mapping boost is applied at query time. For indices created before 5.0.0, the boost will still be applied at index time"

Why index time boosting is a bad idea
We advise against using index time boosting for the following reasons:

  • You cannot change index-time boost values without reindexing all of your documents.
  • Every query supports query-time boosting which achieves the same effect. The difference is that you can tweak the boost value without having to reindex.
  • Index-time boosts are stored as part of the norm, which is only one byte. This reduces the resolution of the field length normalization factor which can lead to lower quality relevance calculations.

Proposed resolution

1. Remove field level boost mapping.
2. Remove boost from Search API interface, or warn it has no effect.

Remaining tasks

1. Write a patch

User interface changes

If possible Search API field mapping should have no setting for boost.

API changes

-

Data model changes

-

📌 Task
Status

RTBC

Version

7.0

Component

Code

Created by

🇫🇮Finland sokru

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States SiliconValet

    I've attached a patch that will exclude the boost config from UI as well as remove boost from properties on the mapping config.

  • 🇦🇺Australia sonnykt Melbourne, Australia

    I think we only need to remove the boosting from MappingFactory. Removing/disabling the boosting config from the index form will impact the query-time boosting in SearchBuilder::getSearchQueryOptions().

    The patch from #5 📌 Index time boost is deprecated Needs review also removes query-time boosting from SearchBuilder which I don't think it's correct.

  • Status changed to Needs review about 1 year ago
  • 🇳🇱Netherlands tvoesenek

    This patch only removes the boosting in the mapping factory and leaves the query-time boosting in SearchBuilder as is.
    Tested with elasticsearch 8.9.1

  • Status changed to RTBC 10 months ago
  • 🇩🇪Germany a.dmitriiev

    +1 for the patch in #7. As it is safe to add for Elastic starting from version 5. And of course it is good to keep the boosting and query time. I checked for Elastic server 8.11.3 and it works.

  • 🇺🇸United States ebeyrent

    +1 for the patch in #7. I tested against Elastic 8.14.3 and it works.

    Without this patch, I wasn't able to create the field mappings, so the sooner this gets committed, the better.

Production build 0.71.5 2024