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?