The site is bolted sphinx. But when performing a search, "User 1" returns an empty result. If you remove the number from the request, it finds users. How to fix?

    1 answer 1

    In order to earn such a search, you can make a small hack and add to the config expand_keywords = 1 .

    expand_keywords
    Automatically expands the search query to three queries.

    running -> (running | * running * | = running)

    Just a word with morphology, a word with asterisks and a complete match of the word. Previously, this option was not available and in order to search with asterisks I had to manually make an additional request, now everything is turned on by one option. Also, the full match will be automatically higher in the search results.

    In addition, you need to pay attention to the "accuracy" of the search. Namely, the min_infix_len indicator. I have its value in the config directly limits the minimum number of recognizable digits in the request.

    Found on Habr excellent article on the topic of sphinx . And, of course, documentation on this topic.