couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tony Sun <tony.sun...@gmail.com>
Subject Re: Mango full text search is immune to accented letters?
Date Mon, 01 Aug 2016 16:50:57 GMT
Hey Teo,

   Were you able to get Mango text search working? Specifying the analyzer
get's a little tricky.

On Sat, Jul 30, 2016 at 5:17 AM, Constantin Teodorescu <brailateo@gmail.com>
wrote:

> Is Mango Full text indexer/search (or would it be) immune for accented
> letters?
>
> I'm planning to use it for searching "posta" but it may be "poştă" in
> documents!
> SQLite3 FTS4 is able to do that!
>
> For the moment I'm using CouchDB 1.6 views with explicit "flatten function"
> in JavaScript to create a non-accented index:
>
>   var translate_re = /[ŞȘŢȚÎĂÂÁşșţțîăâá]/g,
>       translate = {
>         'Ş': 'S', 'ş': 's',
>         'Ș': 'S', 'ș': 's',
>         'Ţ': 'T', 'ţ': 't',
>         'Ț': 'T', 'ț': 't',
>         'Ă': 'A', 'ă': 'a',
>         'Â': 'A', 'â': 'a',
>         'Á': 'A', 'á': 'a',
>         'Î': 'I', 'î': 'i'
>       };
>
>     function makeSearchString(s) {
>         return ( s.replace(translate_re, function(match) {
>           return translate[match];
>         }) );
>     }
>
> Teo
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message