Search code examples
sphinxcase-sensitive

Force acronyms to be upper case sphinx?


Searches for 'HR' as in Human Resources is returning docs with hr e.g $90 hr. I've tried wordforms to no avail and am stuck. I understand it may be possible to change char_set but that will mean I lose the ability to match any other cases. This must be an issue for Sphinx search in general does anyone have a way around it?


Solution

  • I think the only way to solve this would be with regexp_filter, which can do case sensitive replacements.

    Something like...

    regexp_filter = \b([A-Z]{2,})\b => upper_\1
    

    It will replace it with different word, but the upper prefix, will survive charset_table lower-casing the tokens.