A
A
astrodso2018-11-23 10:50:46
Sphinx
astrodso, 2018-11-23 10:50:46

How to replace Russian letters with English ones in sphinx and vice versa?

Greetings.
There is a task to replace, for example, the Russian letter "x" with the English "x" when searching,
that is, so that when you enter, for example, 10x10 with the Russian "x", between the numbers, a search is made for the
English "x",
but also vice versa, so that when you enter the English letter "x" in the word "cotton" was
searched with the Russian letter "x"
Is this even possible to do?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
astrodso, 2018-11-23
@astrodso

wrote such a rule, excluding x English and x Russian
charset_table = 0..9, \
A..W->a..w,\
Y..Z->y..z,\
_,\
a..w, \
y..z,\
U+410..U+424->U+430..U+444,\
U+426..U+42F->U+446..U+44F,\
U+430 ..U+444,\
U+446..U+44F,\
U+445->x, x->U+445
but does not search

P
Puma Thailand, 2018-11-23
@opium

There is no need to do this in the sphinx
Replace in the program itself, this is one line of code

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question