Select Union in SphinxQL?

十年热恋 提交于 2019-12-13 21:23:54

问题


Is it possible to do any sort of Union using SphinxQL? I want to return one set of results containing two queries and in order of the query. A simple example would be:

Select Author from idx_jobs where MATCH('@(Author) Steinbeck') Union Select Author from idx_jobs where MATCH('@(Description) Steinbeck')

Naturally I could do

Select Author from idx_jobs where MATCH('@(Author, Description) Steinbeck')

but I'm trying to provide some control over 'relevance' in the results.


回答1:


No union.

But seems like field weight would be useful http://sphinxsearch.com/docs/current.html#sphinxql-select

.... OPTION field_weights=(author=1000)

Should put the matches against the author field first. (ie add that to end of second query)



来源:https://stackoverflow.com/questions/43032231/select-union-in-sphinxql

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!