0

I would like to search text for words prefiexed by $.

Sample records (table with 3 rows):

This is my string containing the $word special word.
Again $word is here.
My special $word must be found.

Example RoR (thinking sphinx):

MyModel.search '$word'

I get no results but if I search for '\$word' the word is found.

How can I fix that?

MrSmith42
  • 9,961
  • 6
  • 38
  • 49
xpepermint
  • 35,055
  • 30
  • 109
  • 163

1 Answers1

3

Sphinx uses as word separators ANY character except English alphabet. This means '$' in never indexed and equivalent to a blank space. No way you can find it.

See http://sphinxsearch.com/docs/current.html#conf-charset-table

In your config/sphinx.yml add something like:

charset_table: 0..9, A..Z->a..z, _, a..z, $

rebuild, restart and find it !

David
  • 4,080
  • 1
  • 26
  • 34