Search code examples
rubyfull-text-searchsphinxthinking-sphinxultrasphinx

How can I index and search on the percent (%) character in sphinx


Our index is full of data that have associated units with them.

Units such as degrees (°) and percent (%) are proving difficult to index and search on.

We're using ultrasphinx and sphinx 0.9.9 but Riddle/ThinkingSphinx doesn't seem to handle searching on the % sign.

We allow setting a unit label and unit symbol which we construct a unit string from which is indexed.

Unit strings such as "Power (W)" can be found using a query such as

@units "W"

Solution

  • Try adding it to your charset table like in: https://stackoverflow.com/a/8640248/960702