Search query language not respected

Created on 5 November 2020, about 4 years ago
Updated 27 October 2023, about 1 year ago

Problem/Motivation

The search query alter is not respecting its own language filter. Instead it uses the current language to create the solr ID of an entity for a boost or exclude. A solr query is not necessarily querying using the current language, this could be a fixed language as well (or 'und').

Steps to reproduce

Create entities with no specified language (und).
Create a search page (View) displaying entities in English and undefined language.
Create a search override excluding one of the undefined langyage entities above.
Visit the search page in English and the entity will not be excluded. The solr entity ID will contain the current language 'en' while it's only known in Solr with language 'und'.

Proposed resolution

In the query_alter hook, use the query language(s) to generate the solr ID instead of the current language.

Remaining tasks

Adjust the query_alter hook as described above.

User interface changes

None.

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Needs review

Version

2.1

Component

Code

Created by

🇧🇪Belgium fernly

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.71.5 2024