Package com.google.appengine.api.search
Class RescoringMatchScorer
- java.lang.Object
-
- com.google.appengine.api.search.MatchScorer
-
- com.google.appengine.api.search.RescoringMatchScorer
-
public final class RescoringMatchScorer extends MatchScorer
Assigns a document score based on term frequency weighted on document parts. If you add a MatchScorer to a SortOptions as in the following code:
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()) .build();
The scores in this case will be negative.SortOptions sortOptions = SortOptions.newBuilder() .setMatchScorer(RescoringMatchScorer.newBuilder()) .addSortExpression( SortExpression.newBuilder() .setExpression(SortExpression.SCORE_FIELD_NAME) .setDirection(SortExpression.SortDirection.ASCENDING) .setDefaultValueNumeric(0.0)) .build();
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRescoringMatchScorer.BuilderA builder that constructsRescoringMatchScorers.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RescoringMatchScorer.BuildernewBuilder()Creates and returns a RescoringMatchScorer Builder.StringtoString()
-
-
-
Method Detail
-
newBuilder
public static RescoringMatchScorer.Builder newBuilder()
Creates and returns a RescoringMatchScorer Builder.- Returns:
- a new
RescoringMatchScorer.Builder. Set the parameters for scorer on the Builder, and use theRescoringMatchScorer.Builder.build()method to create a concrete instance of RescoringMatchScorer
-
toString
public String toString()
- Overrides:
toStringin classMatchScorer
-
-