Now when D6 supports translations of nodes, search module should be updated to index words according to languages and let user limit searching to particular languages.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Gábor Hojtsy’s picture

Title: Searching in languages » Language-aware search

Modified title.

meba’s picture

Version: 6.x-dev » 7.x-dev

Bumping to 7.x

robertDouglass’s picture

Component: search.module » node.module
Assigned: Unassigned » robertDouglass
Category: task » feature
Status: Active » Needs review
FileSize
2.26 KB

Very straightforward. Note that this doesn't provide and method for setting search preferences, you have to set the language every search. This is consistent with the other advanced search features.

search-languages

Damien Tournoud’s picture

It does not make much sense to use checkboxes for the language selection. I would rather see a select box here (a search term is rarely the same across different languages). Otherwise, the patch looks good.

Damien Tournoud’s picture

Oh, and as a next step, we will also need a language-specific steemer and user-language aware search (but that's for another feature request).

robertDouglass’s picture

select or radios? Which do people think are better?

meba’s picture

Checkboxes are respecting usability a little bit more because they present the choices directly to the user. But I am afraid we need to be consistent with the fact, that thay may be too many languages enabled so I vote for the select box too.

robertDouglass’s picture

Actually, I disagree. If Drupal.org were a mishmash of languages, I'd still search for Drupal in de and en.

Damien Tournoud’s picture

Would you really search the *same exact word* in both English and German? Even if it could, as a corner case, make sense (for instance for family names or names of organizations), I'm not sure it would be really useful.

robertDouglass’s picture

FileSize
2.19 KB

This one makes it a select. The side effect is that you can only search for one language, even if you use a syntax like language:en,ar,de, it won't work. The select now contains an option "All" which is the default.

Gábor Hojtsy’s picture

Well, especially with German, there are lots of words which that language share with English, at least in the tech world I know. I'd support selecting multiple languages. Why make it impossible?

robertDouglass’s picture

I should be able to work it out so that we have a select widget, but the extraction supports multiple values (so a url with language:en,de,ar would work). That way someone could come along and form_alter the widget if they need. Will do this tomorrow unless someone else takes a stab.

robertDouglass’s picture

FileSize
2.37 KB

This one leaves the select widget but allows for language:en,de,jp,ar syntax.

Dries’s picture

I might want to search for the word 'Drupal' in English, Dutch and French, but not in Chinese or Japanese. A lot of words, and names in particular, are language independent. I think this is a nice little improvement. (Would even be better if it came with a simpletest.)

Dries’s picture

Status: Needs review » Fixed

I've tested this some more and committed it to CVS HEAD. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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