hi,
The match scorer does relevance scoring based on term frequency. You can configure it as a sort option:
QueryOptions.newBuilder()
.setSortOptions(SortOptions.newBuilder()
.setMatchScorer(MatchScorer.newBuilder()))
...
.build();
then access the scores in the query results:
for (ScoredDocument scoredDoc : results) {
out.println("Score: " + scoredDoc.getSortScores().get(0));
}
If you access _score in a sort expression, e.g (suppose you have a field called 'price'):
SortExpression sortExpr = SortExpression.newBuilder()
.setExpression("price + _score")
.setDefaultValueNumeric(0.0)
.build();
then your SortOptions object should include a scorer. e.g.:
SortOptions.newBuilder()
.setMatchScorer(MatchScorer.newBuilder())
.addSortExpression(sortExpr)
...
.build();
I'm afraid my original question is still unanswered. I still don't know how to grab relevance score. I have a feeling that there's no Googler that's been assigned to look after FTS questions in this group :-(
You received this message because you are subscribed to the Google Groups "Google App Engine" group.