This should work, assuming "rating" is a numeric field:
from whoosh import sorting
facet = sorting.MultiFacet(["rating", sorting.ScoreFacet()])
results = searcher.search(myquery, sortedby=facet)
Hope this helps :)
Matt
I probably should have reversed the rating field, assuming rating=5 is
better than rating=1...
facet = sorting.MultiFacet([sorting.FieldFacet("rating", reverse=True),
sorting.ScoreFacet()])
Matt
Matt
--
You received this message because you are subscribed to the Google Groups "Whoosh" group.
To post to this group, send email to who...@googlegroups.com.
To unsubscribe from this group, send email to whoosh+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/whoosh?hl=en.
sortedby = []
sortedby.append(FieldFacet('rating', reverse=True))
sortedby.append(ScoreFacet())
results = searcher.search(myquery, sortedby=sortedby)
There should be no difference... if you pass a list to sortedby Whoosh
will automatically wrap it with a MultiFacet object.
Matt