I created an index:

index berni_filter2 { rt_mem_limit = 512M type = rt path = /var/lib/sphinxsearch/data/berni_filter rt_attr_uint = product_id rt_attr_uint = store_id rt_field = product_name rt_attr_json = attributes prefix_fields = product_name expand_keywords = 1 min_infix_len = 2 dict = keywords } 

I try to find a product by name through SphinxQL:

 SELECT product_id FROM berni_filter2 WHERE store_id = 0 AND MATCH ('@product_name mothercare') 

The query works well, but I also want the search for "mother" to contain products that contain "mothercare". I tried:

 SELECT product_id FROM berni_filter2 WHERE store_id = 0 AND MATCH ('@product_name mother') SELECT product_id FROM berni_filter2 WHERE store_id = 0 AND MATCH ('@product_name mother*') SELECT product_id FROM berni_filter2 WHERE store_id = 0 AND MATCH ('@product_name *mother*') 

I also changed min_infix_len to min_prefix_len. Nothing works.

    1 answer 1

    My mistake was that I did not delete the index from the disk after changing the config. Work final config:

     index berni_filter { rt_mem_limit = 512M type = rt path = /var/lib/sphinxsearch/data/berni_filter rt_attr_uint = product_id rt_attr_uint = store_id rt_field = product_name rt_attr_json = attributes index_exact_words = 1 expand_keywords = 1 min_prefix_len = 3 min_word_len = 2 morphology = stem_enru dict = keywords }