Boosting is limited to one boost per field

Created on 31 March 2023, over 1 year ago

Setup

  • Solr version: 8
  • Drupal Core version: 9.5
  • Search API version: 8.x-1.28
  • Search API Solr version: 4.2.10
  • Configured Solr Connector:

Issue

The code at \Drupal\search_api_solr\Plugin\search_api\processor\BoostMoreRecent::preprocessSearchQuery means that I cannot add my own boost plugin on the same field, since the key for the boost is the field id. Further to this we can't have an arbitrary key because \Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend::search tries to calls Utility::getBoostableSolrField on the field id.

FWIW my use case is as follows. I'm trying to create a custom boost that allows you to choose multiple date fields, and boost on the minimum (or maximum) date. At this stage I will just have to pick the first selected field and use that for the field id.

💬 Support request
Status

Active

Version

4.0

Component

Code

Created by

🇦🇺Australia mstrelan

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

Comments & Activities

Production build 0.71.5 2024