0

I use SphinxQl, I got query like this

SELECT `id`, WEIGHT() as relevance FROM `rt_table` WHERE MATCH('dubai')

I want to set match mode extended to make search by * (wildcard) like

SELECT `id`, WEIGHT() as relevance FROM `rt_table` WHERE MATCH('dub*')

to get all data which contains "dub" substring.

min_word_len    =   1
min_prefix_len  =   2

and this is part of my config of index . I have tried set min_infix_len=2 but it does not help Problem is that I can not make wildcard search *.

Please help someone!

  • 1
    Did you recreate the index after changing the config? You need to delete (or TRUNCATE) the index, and reinsert all the data again. (assuming its a RT index, if a standard disk index, it will need to be recreated via indexer) – barryhunter Nov 08 '15 at 22:04

1 Answers1

-1

If you use SphinxQl you need to just make some changes in index config

min_word_len    =   2   
min_infix_len   =   2   
enable_star =   1   
dict        =   keywords

and you can search using wildcard

  • 1
    THis answer is misleading, its not really correct, dont need to make these changes at all. Don't need to change min_word_len. Can use wildcards with min_prefix_len, only need infix if want wildcards at both ends of the word. Don't need enable_star=1 - its the detail anyway. And don't need dict=keywords (its the default , and infix/prefix indexing does work with dict=crc anyway) – barryhunter Nov 08 '15 at 22:09