I think it is common practice across all search frameworks that item scores (or relevancy, …) and boosts can only be non-negative numbers. However, we never specify that in the Search API framework, even though some of the code (e.g., the Database backend) implicitly assumes it. We now even got a bug report (#3484686: Error when trying to boost on numeric field with negative value) where indexing failed because of this.
We should officially declare that scores and boosts are non-negative and deprecate setting negative score/boost values in preparation of failing directly on them (probably with a RuntimeException so it doesn’t need to be caught).
Issue fork search_api-3485260
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
drunken monkeyCreated a change record and an MR.
Comment #4
drunken monkeyMerged.