L
L
Larisa .•º2018-10-23 15:52:34
Sphinx
Larisa .•º, 2018-10-23 15:52:34

For some reason, ranking with an exact match in words with a hyphen is not correct?

i have a request

select * from appl_index() where MATCH('Синее, яблоко') OPTION ranker=expr('sum(lcs*user_weight)*1000+bm25');

if there are words with a hyphen in the database, then the result of such a query is
Синее, яблоко-дерево 1
Синее, яблоко-дерево 4
Синее, яблоко-дерево 3
Синее, яблоко

I would like to see the opposite
Синее, яблоко
Синее, яблоко-дерево 1
Синее, яблоко-дерево 3
Синее, яблоко-дерево 4

if there are no words with a hyphen in the database, then everything seems to be correct in the result, the results with an exact match come first.
Index settings next:
index_exact_words =1
min_stemming_len = 3
min_word_len = 3
min_prefix_len = 3
expand_keywords = 1

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Tikhonov, 2018-10-23
@tumbler

  1. Add snippets to understand what exactly matched
  2. ranker=export() to see what sphinx counted there in terms of indicators
  3. lcs does not take into account the distance between matched words, only the order. Look at [w]lccs
  4. Add abs(query_word_count - doc_word_count) to the ranker, then the results will go ahead in which there are as many words as in the query)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question