Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
How can the autocomplete used with multilanguage? So that a search only uses the current language?
Idea 1
I added a filter inside the view "current language". May work .. testing
Comments
Comment #1
marcoka CreditAttribution: marcoka commenteddoes not seem to work:
http://www.root.artwaves.de/screensnapr/1336587975-Fulkew.jpg
its mixing up all three different languages (de,fr,en)
Comment #2
marcoka CreditAttribution: marcoka commentedAnother thing, adding "current language" somehow only displays results if a complete word is typed, like "Concrete"...typing only "Con" would not trigger the autocomplete to appear.But you need to still have "current language" filter in views activated or the search will display duplicates (muliple languages)
edit:
caused by:
$max_occurence = $response->response->numFound * 0.9;foreach ($matches as $match => $count) {
if ($count > $max_occurence) {
unset($matches[$match]);
}
}
removing that shows it correctly again.
Comment #3
marcoka CreditAttribution: marcoka commentedi was digging around in public function getAutocompleteSuggestions.... isnt there a way to add a parameter to get the terms/suggestions in the current language?
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedI can't reproduce this. I also have a multilingual index, a Search API View filtered by language (language = current user language). Autocomplete shows me only 1 language.
Comment #5
facine CreditAttribution: facine commentedMe too I shows all languages.
It may be to use Entity Translation?
Comment #6
marcoka CreditAttribution: marcoka commentedwhat is drunken monkeys opinion on this? should it work like said, with the current language filter in views?
i used core search field and a custom one. only english appears or mixed language. sites uses i18n. each node exists in every language.
example page:
http://www.texturecase.com/de (top serach field is a custom module that puts the field in a block)
http://www.texturecase.com/de/search (views exposed search fielf)
Comment #7
drunken monkeyYes, I think it should.
Also, don't you have the exact contrary problem for the same site in #1998646: Search language? How can you complain in one issue that autocomplete shows only one language, and in the other that it shows three?
Comment #8
marcoka CreditAttribution: marcoka commentedno not really, the origin problem was more complex and now everything works (after killing the index (delete) settings) and recreating.
now results in autocomplete are mainly english and or mixed words in DE/EN.
i am focusing now on this issue #1998646: Search language issue
the intention here was just to ask if it should work like morningtime said. sorry for the confusion
Comment #9
drunken monkeyOh, OK. Then this is fixed?
Comment #11
ressa CreditAttribution: ressa as a volunteer commentedI can't seem to create a multilingual index, has this option been removed?
EDIT: I got it working with the solution in this post: https://www.drupal.org/node/2166113#comment-8418375