Hi!
This is the first patch I create, so please be kind :)
I have already tested it and is working.

This patch performs the transliteration of the search strings and search index.
It implements the hook_search_preprocess() and then runs the text through the transliteration_get() function to do the job.
I also added a checkbox so that the user can choose to use this functionality or not.
This patch is quite useful for greek where users can perform searches with accented or not accented letters eg 'πλάνη' vs 'πλανη' or use a latin keybord to perform a search eg gata vs γάτα (=cat). Hopefully, it will solve similar problems with other languages.
You can refer to issue #1054956: Accented letters? from Search Lucene API project for more info.

Mike

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

smk-ka’s picture

Cool stuff! One change I've made was setting the $source_language parameter of the transliteration_get() call to the site default language, because transliteration is language specific. However, since we do not know the original input language of a piece of text passed to hook_search_preprocess(), we need to set it to the site default, otherwise the results may differ. The reason being that if unset, transliteration_get() falls back to the current display language, which may be different from the language used when indexing the same piece of text during a cron run or the like. Other than that I've applied only minor whitespace and some wording changes.

msti’s picture

I am glad it's useful.
Is this going to be applied to the dev release, or will you wait for people to test it first?

cpliakas’s picture

I have tested the patch in #1, and it works perfectly for me. Great contribution, msti.

~Chris

dropbydrop’s picture

Priority: Normal » Major
Status: Needs review » Needs work

Did this patch got in latest dev or not yet?
thanks

dropbydrop’s picture

Version: 6.x-3.x-dev » 7.x-3.0-alpha1

Will this possibility be integrated in module?

amateescu’s picture

Version: 7.x-3.0-alpha1 » 6.x-3.x-dev
Priority: Major » Normal
Status: Needs work » Fixed
FileSize
1.87 KB
2.7 KB

I think this setting doesn't belong to the file system configuration form so I moved it to the search settings form.

Commited attached patches to 6.x-3.x and 7.x-3.x.

http://drupalcode.org/project/transliteration.git/commit/9130c70
http://drupalcode.org/project/transliteration.git/commit/26ae882

Status: Fixed » Closed (fixed)

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

mgifford’s picture

Can this be added to the project page?

There's no indication that this module now corrects searches as well.

amateescu’s picture

Category: feature » task
Status: Closed (fixed) » Active

Reopening for #8. Would you mind giving me a hint at how this info should sound like? :)

mgifford’s picture

Right after the paragraph on transliteration for URLs, maybe something like.

By enabling this module it will make it easier for people to search with or without accents. So if someone wanted to find references to the world 'conteúdo' one could type that in exactly or 'conteudo' and get the same result.

Maybe something like that. Just a short paragraph so someone can quickly indicate that this functionality is addressed here.

amateescu’s picture

Category: task » feature
Status: Active » Closed (fixed)

Done! Added this text:

By enabling this module, it will be easier for people to search with or without accents. Thus, if someone wanted to find references to the word 'conteúdo' they could type it with an accent or 'conteudo' and get the same result.

Thanks Mike :)

mgifford’s picture

Excellent!