V
V
Vladimir Soldatov2016-04-04 14:23:47
Sphinx
Vladimir Soldatov, 2016-04-04 14:23:47

Why doesn't SPHINX return a result when searching for two words?

There is a table of goods that I drive into SPHINX.
I'm doing a search by product name. Everything is pretty normal.
Product name "Low-profile Cabin MTZ small I for MTZ 80, MTZ 82, Moscow"
When searching for any one word, there is a result. If the request is made, let's say this "Low profile Ka", then the result is also returned, but if you add at least one more character "Low profile Kabin", there is no result, and when we supplement the second word so that one character is missing, the result is again "Low profile cab".
config

index product
{
  source					= product
  path					= c:/sphinx/data/product
  
  docinfo                	= extern
    morphology              = stem_enru, soundex, metaphone
    charset_table          	= 0..9, A..Z->a..z, _, a..z, U+410..U+42C->U+430..U+44C, U+42E..U+42F->U+44E..U+44F, U+430..U+44C, U+44E..U+44F, U+0401->U+0435, U+0451->U+0435, U+042D->U+0435, U+044D->U+0435
    min_prefix_len          = 0
    min_infix_len          	= 0
    min_word_len            = 1
    min_stemming_len        = 4
    phrase_boundary        	= :, - , . , $
    phrase_boundary_step    = 1
    html_strip              = 1
  index_exact_words 		= 1
  dict 					= keywords
}

if I set
min_prefix_len = 3
min_infix_len = 3
then I catch the error "prefixes and infixes can not both be enabled on all fields"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Soldatov, 2016-04-04
@TPbIHTPABA

strange but solved the problem

index product
{
  source					= product
  path					= c:/sphinx/data/product
    
  rt_attr_string = name
  rt_field = name
    
  docinfo                	= extern
    morphology              = stem_enru, soundex, metaphone
    charset_table          	= 0..9, A..Z->a..z, _, a..z, U+410..U+42C->U+430..U+44C, U+42E..U+42F->U+44E..U+44F, U+430..U+44C, U+44E..U+44F, U+0401->U+0435, U+0451->U+0435, U+042D->U+0435, U+044D->U+0435
    min_prefix_len          = 3
    min_infix_len          	= 0
    min_stemming_len = 3
  min_word_len = 3
    phrase_boundary        	= :, - , . , $
    phrase_boundary_step    = 100
    html_strip              = 1
  expand_keywords 		= 1
  index_exact_words 		= 1
  dict 					= keywords
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question