com.google.appengine.api.search
Class MatchScorer
- java.lang.Object
-
- com.google.appengine.api.search.MatchScorer
-
- Direct Known Subclasses:
- RescoringMatchScorer
public class MatchScorer extends java.lang.Object
Assigns a document score based on term frequency. 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(MatchScorer.newBuilder()) .build();
The scores in this case will be negative.SortOptions sortOptions = SortOptions.newBuilder() .setMatchScorer(MatchScorer.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 and Description static class
MatchScorer.Builder
A builder that constructsMatchScorers
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static MatchScorer.Builder
newBuilder()
Creates and returns a MatchScorer Builder.java.lang.String
toString()
-
-
-
Method Detail
-
newBuilder
public static MatchScorer.Builder newBuilder()
Creates and returns a MatchScorer Builder.- Returns:
- a new
MatchScorer.Builder
. Set the parameters for scorer on the Builder, and use theMatchScorer.Builder.build()
method to create a concrete instance of MatchScorer
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-