简体   繁体   中英

MariaDB SphinxSE not accepting weights parameter

If I try this query:

select * FROM sphinx.products where `query` = "test";

it works. But if I try to give it weights it returns an error:

select * FROM sphinx.products where `query` = "test;sort=extended:@weight DESC;weights=3,1,1,1";

Fails with error:

Error in query (1430): There was a problem processing the query on the foreign data source.
Data source error: searchd error: invalid deprecated unordered_weight count 4 (expe

(Error reported by MariaDB gets truncated there, but I believe it says "expecting 0")

And:

select * FROM sphinx.products where `query` = "test;sort=extended:@weight DESC";

Fails with error:

Error in query (1430): There was a problem processing the query on the foreign data source.
Data source error: searchd error: index 'sku_products': sort-by attribute '@weight'

(Again, error returned by SphinxSearch gets truncated by MariaDB)

All the documentation I find about SphinxSE tells me to query the index this way, yet it does not work, but nobody in the Internet seem to have met this error since nobody is asking about this anywhere...

Am I doing something wrong?

Well, the option weights= didn't work, but it accepted fieldweights=sku,90,partnumber,30,barcode,20,name,10 .

(Ie, fieldweights=<field1_name>,<field1_weight>,... )

Results came ordered by weight even without specifying sort=extended:@weight DESC , so I dodged both errors and got what I needed.

Hope this helps anyone in the same situation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM