I have a requirement to sort search results by relevance and another field.
I need to do something similar to this:
using Lucene.Net.Search;
SortField[] fields = new[] { SortField.SCORE, new SortField("customField") };
Sort sort = new Sort(fields);
IndexSearcher searcher = GetSearcher();
Hits = searcher.Search(query, sort);
Except, SortField.SCORE
is an integer constant, not a SortField
.
Lucene.net version 2.3.1.3.
Has anyone come across this?
Found an answer to this:
SortField.FIELD_SCORE
Not sure how or why I missed this...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With