M
M
Maxim2015-03-05 15:18:06
Sphinx
Maxim, 2015-03-05 15:18:06

How to search for special characters in Sphinx?

Hello!
Please tell me how to reconfigure the index or how to correct the query so that it would be possible to search for documents containing special characters.
Index:

source src_tasks_delta
{
    type = xmlpipe
    xmlpipe_command = /usr/bin/php /home/tasks/bots/xmlpipe_bot_tm_test.php delta tasks
}

index i_tasks_delta {
        source                  = src_tasks_delta
        path                    = /var/lib/sphinxsearch/data/i_tasks_delta
        docinfo                 = extern
        enable_star             = 1
        morphology              = none
        charset_type            = utf-8
#       expand_keywords         = 1
#       index_exact_words       = 1

        min_word_len            = 2
        min_prefix_len          = 2
        #min_infix_len          = 5

        html_strip              = 1
        charset_table = +, 0..9, A..Z->a..z, _, -, /, @, !, $, %, ^, &, (, ), +, `, ~, #, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F
}

There is a document whose name is "haha%"
Query:
@(name,msg) (хаха\%\%| хаха\%\%*)
returns this document, but it is also returned by any of the following queries:
@(name,msg) (хаха\%\%?:\%| хаха\%\%?:\%*)
@(name,msg) (хаха\#| хаха\#*)
@(name,msg) (хаха\!| хаха\!*)
@(name,msg) (хаха\(\)| хаха\(\)*)
etc.
And the query:
@(name,msg) (\%\%| \%\%*)
generally returns everything.
How to overcome such issue and make a strict search by matching the special character in its place?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
ideological, 2017-01-10
@ideological

Problem solved?
If so, it would be nice to write the answer yourself;)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question