I seem to have had my question answered on how to order results by relevance using OPTION field_weights
. However I'm finding it does not work when using an ORDER by
in the same SphinxQL
Query e.g.
Select * from Items where MATCH('@(Listing_Title) London @(Listing_Title,Description) Jack') ORDER By Featured_Flag DESC OPTION field_weights=(Author=1000)
Which basically is trying to say:
"Find me all the books with 'Jack' and 'London', put all the books by featured sellers first and non-features sellers after, and in each group put the records where both 'Jack' and 'London' appear in the Listing_Title itself"
So a sample return should look like this where the field order is:
Listing_Title Description Featured_Flag
Jack London Books for Sale New buy now! 1
London, Steinbeck and more Call of the Wild by Jack London 1
Jack London Classics! In great shape write or call 0
Call of Wild - London THE Jack London 0
Once I add the ORDER by Featured_Flag DESC
however the field_weights=(Listing_Title=1000)
is no longer obeyed.
Is there some other way to do this? I've read that querying two indexes can act as a union perhaps a Listing_Title_Index and a All_Index would work?