How to sort search results by relevance (score)

Created on 11 December 2017, over 6 years ago
Updated 23 June 2023, about 1 year ago

Hello,

I am trying to sort the results of a view by relevance (score)
I see that the score is always set to 1.

This has led me to this issue which is very similar to our setup.

https://www.drupal.org/project/search_api_solr/issues/2800261 β†’

We use an aggregated field (boost 1) as exposed filter of the view.
We have other fields (term name of taxonomies etc) among the indexed contents with a higher boost.

I have debugged a bit an I see that the drupal module uses the fq parameter to query solr and not the q parameter. (I don't know if this is normal)

If I debug the query directly on solr:

  • I can see that all results have a score of 1 if I use the FQ parameter with q = *:* (similar to what does the drupal module) o
  • I can also see that results have a score if the q parameter is used (my_aggreagated_field="my_search_term"

From what I see in issue 2800261, it should be possible to have an exposed filter using the aggreagated field but still have score other than 1 for the different results.

Since we are not very familiar with solr we can miss something and I didn't find any usefule info about that in the documentation .
Thanks for your tips

πŸ’¬ Support request
Status

Closed: works as designed

Version

1.2

Component

Documentation

Created by

πŸ‡§πŸ‡ͺBelgium bendev

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.

Production build 0.69.0 2024