0

I'm trying to set up fulltext search using sphinx (v2.3.2-beta) for my music-related website.

When a user searchs for 'kesha', he must also find 'Ke$ha'. In order to do this, I added this to my charset_table:

U+0024->s, U+FF04->s, U+FE69->s

After that, 'kesha' returns results for 'Ke$ha'. However, when I search for 'ke$ha', i get no results.

I'm currently using SphinxQL in C#, and I'm manually escaping the $-sign.

    private string EscapeQuery(string query)
    {
        var builder = new StringBuilder(query);
        builder.Replace("\\", "\\\\");
        builder.Replace("-", "\\-");
        builder.Replace("+", "\\+");
        builder.Replace("$", "\\$");
        builder.Replace("!", "\\!");
        builder.Replace("@", "\\@");
        builder.Replace("~", "\\~");
        builder.Replace("\"", "\\\"");
        builder.Replace("/", "\\/");
        builder.Replace("(", "\\(");
        builder.Replace(")", "\\)");
        builder.Replace("*", "\\*");
        builder.Replace("<", "\\<");
        builder.Replace(">", "\\>");
        builder.Replace("=", "\\=");
        return builder.ToString();
    }

In the query log i'm seeing the following, so I think my query is escaped correctly:

SELECT artistid, artistname FROM artists WHERE MATCH('^ke\\$ha*') GROUP BY artistid LIMIT 0,2 OPTION ranker=sph04;
/* Fri Feb 10 18:21:37.764 2017 conn 44 real 0.000 wall 0.000 found 0 */

However, i'm not getting any results, while I think i should also be getting 'Ke$ha' as a result.

Does anybody have any idea what could be wrong?

Bram
  • 51
  • 7
  • I have uploaded my config (some indexes removed) [here](http://pastebin.com/M2XRVQpM) – Bram Feb 10 '17 at 17:58
  • I have also tried with version 2.2.11, but I'm getting the same results there. I have also tried using the default mysql client to connect to sphinx, and [this are the results](http://pastebin.com/n09YF91k) – Bram Feb 11 '17 at 13:32
  • Using a more simple charset_table gives the same results: charset_table = 0..9, A..Z->a..z, a..z, ?, !, U+0024->s, U+FF04->s, U+FE69->s, U+00D8->o – Bram Feb 11 '17 at 13:33
  • I reported this as a bug http://sphinxsearch.com/bugs/view.php?id=2611 – Bram Feb 16 '17 at 13:05

0 Answers0