Needs work
Project:
Search (from core)
Version:
1.0.0
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
3 Apr 2019 at 04:49 UTC
Updated:
19 Sep 2026 at 08:50 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
shaalCreated a patch that checks if any language is selected in advanced search options.
If not - it adds a filter of current_language (+ undefined language + n/a language).
I tested it with Umami demo,
As an anonymous user, using the English interface, search for the word 'chocolate'.
3 results in English should be displayed.
Change the language to Spanish, and search for 'chocolate' again,
3 results in Spanish should be displayed.
Log in as admin, using the English interface, search for the word 'chocolate'.
(3 results in English should be displayed)
In the search results page, open the 'Advanced Search' options, choose English, and click the "Advanced Search" button
(3 results in English should be displayed)
Choose 'English' in "Languages" options, and click the "Advanced Search" button
(3 results in English should be displayed)
Choose 'Spanish' in "Languages" options, and click the "Advanced Search" button
(3 results in Spanish should be displayed)
Choose both 'English' and 'Spanish' in "Languages" options, and click the "Advanced Search" button
(6 results in both English and Spanish should be displayed)
Comment #4
jasonawantHi Shaal!
Thanks for the patch and referencing the related issue #3041039: Search for content in current language. These maybe duplicates of each other, but I'll leave that for someone else to decide.
I've updated the issue summary so someone can see this related issue more prominently.
I've changed the status to Needs Review to hopefully get some eyes on it. To me this seems like a fine path forward that will needs tests associated with it.
I think we'll need to get consensus on the path forward first before putting time into tests.
Comment #5
pawandubey commented@shaal
Please find the below feedback of patch#2:
1. All the test cases which you have mentioned is working fine and tested for both anonymous and admin user.
2. Strange things I have found is that when you open the advance search and put keyword 'chocolate' with English language then you will find total 3 result as expected but in the normal Search box you will get two keywords 'chocolate chocolate' which gets increase if you put the same in the advance search.
3. Normal Search (en/search/node) : At the same time in the normal search keyword, search only with 'chocolate' and you will get the 3 results as expected. Now open the Advance search and select both languages and click on the normal search button and you will get total 6 results in this case. As per my understanding Search and Advance Search both shouldn't be mixed up in this case. The issue related to search URL where the keywords just getting added and not cleared. Need to work on this.
4. Patch#2 also needs changes related to coding standard which you can find from the codesniffer_fixes.patch result in your patch.
Comment #6
shaalThank you @pawandubey for the review in #5
This patch is a re-roll for Drupal 8.8, and includes 3 coding standard issues.
(no interdiff)
5.2
I couldn't replicate:
Can you please test it again? add screenshots? steps to replicate?
5.3
This is the expected result.
By default, the search returns results only in the current language, but if you open the advanced search box and choose specific languages it will return results in the chosen languages.
5.4
Fixed in this patch.
Comment #10
chandrashekhar_srijan commentedFixed all the failures.
Comment #12
chandrashekhar_srijan commentedComment #13
luco commentedhi all,
please find an updated patch for D8.9.x.
Comment #14
luco commentedsorry, forgot the comments at the top.
Comment #15
abhijith s commentedPatch #13 can't be applied on 9.2.x.Needs reroll.
Comment #16
abhijith s commentedRerolled patch #13
Comment #19
meenakshi_j commentedHere is the patch which has fixed the fails of #16
Comment #20
adsyy commented#16 is working on 9.2.1
Comment #21
mellowtothemax commented#16 is working on 9.2.10 for me too
Comment #24
nicrodgersRe-rolled #19 for latest 9.3.x
Comment #26
gaurav-mathur commentedThe patch #24 is applied on drupal version 9.5 successfully and this patch also applied on the latest branch and it working fine.
Thankyou
Comment #27
sonam.chaturvedi commentedVerified and tested patch #24 on 10.1.x-dev. Patch applied successfully.
Test Results:
1. When no language is chosen in advance-search and normal search, display results only in current language.
2. Issue #5 point 2 (5.2) is reproducible after applying patch
Basically, keyword searched in Advanced-search "Containing any of the words" field is cleared from advance search box and appended to normal search box. And this results in increase of same keywords - "test test".
Moving to Needs Work
Comment #29
jonnyhocks commentedRe-rolled #24 for latest 10.3.x
Comment #31
quietone commentedThe Search Module was approved for removal in #3476883: [Policy, no patch] Move Search module to contrib .
This is Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.
The deprecation work is in #3565780: [meta] Tasks to deprecate the Search module and the removal work in #3565783: [meta] Tasks to remove the Search module.
Search will be moved to a contributed project before Drupal 12.0.0 is released.
Comment #32
quietone commentedThe Search Module has moved from core to contrib,