Search code examples
phpsphinx

Sphinx query strange result


I have some problems with sphinx result.

When searching for normal words there are no problems. But if enter a nonsense words like "gghghghgh", the search result will not be empty. In fact, there is no text elements, that contain such query.

And i cant understand why that happend. Thanks!

Query:

mysql> select id from newsCache where match('ghghgh'); show meta;
+--------+
| id     |
+--------+
| 133576 |
|  82617 |
|  43613 |
|  38385 |
|  37042 |
|  55744 |
|  42380 |
|  44921 |
|  52825 |
|  54994 |
|  85116 |
| 132790 |
| 143505 |
|  86185 |
|  38634 |
|  40388 |
|  49325 |
|  49751 |
|  58548 |
|  80700 |
+--------+
20 rows in set (0.01 sec)

+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| total         | 348   |
| total_found   | 348   |
| time          | 0.009 |
| keyword[0]    | g200  |
| docs[0]       | 355   |
| hits[0]       | 433   |
+---------------+-------+
6 rows in set (0.01 sec)

Solution

  • In my config i found such parameters:

    morphology     = stem_enru, soundex, metaphone
    

    What i do:

    1. Removed soundex morf engine
    2. Searchd --stop - stop searchd service
    3. delete index files (and delete the binlog as well!)
    4. Reindex my RT index
    5. Start searchd again

    After that there is no strange result like "ghghghg0" =>"g200". All works fine.

    Special thanks to @barryhunter for explanation of the solution on sphinx forum.

    Hope this helps you.