Language-aware search

meba - June 23, 2007 - 21:28
Project:Drupal
Version:7.x-dev
Component:node.module
Category:feature request
Priority:normal
Assigned:robertDouglass
Status:closed
Description

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.

#1

Gábor Hojtsy - June 25, 2007 - 11:40
Title:Searching in languages» Language-aware search

Modified title.

#2

meba - February 15, 2008 - 22:22
Version:6.x-dev» 7.x-dev

Bumping to 7.x

#3

robertDouglass - April 18, 2008 - 19:25
Component:search.module» node.module
Category:task» feature request
Assigned to:Anonymous» robertDouglass
Status:active» needs review

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

AttachmentSizeStatusTest resultOperations
search-languages.patch2.26 KBIgnoredNoneNone

#4

Damien Tournoud - April 18, 2008 - 19:57

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.

#5

Damien Tournoud - April 18, 2008 - 19:58

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

#6

robertDouglass - April 18, 2008 - 20:09

select or radios? Which do people think are better?

#7

meba - April 18, 2008 - 20:10

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.

#8

robertDouglass - April 18, 2008 - 20:19

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

#9

Damien Tournoud - April 18, 2008 - 21:38

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.

#10

robertDouglass - April 19, 2008 - 08:56

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.

AttachmentSizeStatusTest resultOperations
search-languages.patch2.19 KBIgnoredNoneNone

#11

Gábor Hojtsy - April 19, 2008 - 13:16

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?

#12

robertDouglass - April 19, 2008 - 15:51

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.

#13

robertDouglass - April 19, 2008 - 18:05

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

AttachmentSizeStatusTest resultOperations
search-languages.patch2.37 KBIgnoredNoneNone

#14

Dries - April 19, 2008 - 22:09

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

#15

Dries - April 20, 2008 - 05:31
Status:needs review» fixed

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

#16

Anonymous (not verified) - May 4, 2008 - 05:33
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.