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

marcoka’s picture

does not seem to work:
http://www.root.artwaves.de/screensnapr/1336587975-Fulkew.jpg
its mixing up all three different languages (de,fr,en)

marcoka’s picture

Another 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.

marcoka’s picture

i was digging around in public function getAutocompleteSuggestions.... isnt there a way to add a parameter to get the terms/suggestions in the current language?

Anonymous’s picture

I 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.

facine’s picture

Me too I shows all languages​​.
It may be to use Entity Translation?

marcoka’s picture

what 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)

drunken monkey’s picture

what is drunken monkeys opinion on this? should it work like said, with the current language filter in views?

Yes, 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?

marcoka’s picture

no 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

drunken monkey’s picture

Status: Active » Fixed

Oh, OK. Then this is fixed?

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

ressa’s picture

Issue summary: View changes

I 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