问题
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