public final class RescoringMatchScorer extends MatchScorer
SortOptions sortOptions = SortOptions.newBuilder()
.setMatchScorer(RescoringMatchScorer.newBuilder())
.build();
then this will sort the documents in descending score order. The scores will be
positive. If you want to sort in ascending order, then use the following code:
SortOptions sortOptions = SortOptions.newBuilder()
.setMatchScorer(RescoringMatchScorer.newBuilder())
.addSortExpression(
SortExpression.newBuilder()
.setExpression(SortExpression.SCORE_FIELD_NAME)
.setDirection(SortExpression.SortDirection.ASCENDING)
.setDefaultValueNumeric(0.0))
.build();
The scores in this case will be negative.| Modifier and Type | Class and Description |
|---|---|
static class |
RescoringMatchScorer.Builder
A builder that constructs
RescoringMatchScorers. |
| Modifier and Type | Method and Description |
|---|---|
static RescoringMatchScorer.Builder |
newBuilder()
Creates and returns a RescoringMatchScorer Builder.
|
java.lang.String |
toString() |
public static RescoringMatchScorer.Builder newBuilder()
RescoringMatchScorer.Builder. Set the parameters for scorer
on the Builder, and use the RescoringMatchScorer.Builder.build() method
to create a concrete instance of RescoringMatchScorerpublic java.lang.String toString()
toString in class MatchScorer