A
A
Alexander N++2014-07-22 12:47:36
Sphinx
Alexander N++, 2014-07-22 12:47:36

How to set multiple Option in SphinxQL?

The request itself

SELECT id, post_type, weight() FROM post_ru 
WHERE MATCH('@(name,full_description) Samsung') 
AND ( system_id >=1 AND system_id<=16 ) LIMIT 0,30 
OPTION 
field_weights=(name=10,full_description=1) 
ranker=expr('sum((4*lcs+2*(min_hit_pos==1)+exact_hit)*user_weight)*1000+bm25'))

In addition to the ranker, I want to set the weight for the field_weights fields,
but I get an error
CDbCommand не удалось исполнить SQL-запрос: SQLSTATE[42000]: Syntax error or access violation: 1064 sphinxql: syntax error, unexpected IDENT, expecting $end near 'ranker=expr('sum((4*lcs+2*(min_hit_pos==1)+exact_hit)*user_weight)*1000+bm25') ) ;'

Everything works separately.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander N++, 2014-07-22
@sanchezzzhak

In general, we list - this is a matter separated by a comma with a space
For those who will use!
max_matches=10000 must also be set in the searchd config, then restart searchd, otherwise the result will be 0 documents.
Any changes to searchd require a service restart.
I tested everything on shinxql version 2.2.3 beta on puff.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question