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:
a new RescoringMatchScorer.Builder. Set the parameters for scorer
on the Builder, and use the Builder#build() method
to create a concrete instance of RescoringMatchScorer
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003e\u003ccode\u003eRescoringMatchScorer\u003c/code\u003e assigns a document score based on term frequency, weighted on document parts.\u003c/p\u003e\n"],["\u003cp\u003eUsing \u003ccode\u003eRescoringMatchScorer\u003c/code\u003e within \u003ccode\u003eSortOptions\u003c/code\u003e sorts documents in descending score order with positive scores.\u003c/p\u003e\n"],["\u003cp\u003eTo sort in ascending order, include a \u003ccode\u003eSortExpression\u003c/code\u003e with \u003ccode\u003eASCENDING\u003c/code\u003e direction, resulting in negative scores.\u003c/p\u003e\n"],["\u003cp\u003eA new \u003ccode\u003eRescoringMatchScorer\u003c/code\u003e instance is created through the static method \u003ccode\u003enewBuilder()\u003c/code\u003e, which returns a \u003ccode\u003eRescoringMatchScorer.Builder\u003c/code\u003e object.\u003c/p\u003e\n"],["\u003cp\u003eThe method \u003ccode\u003etoString()\u003c/code\u003e is an override of the \u003ccode\u003eMatchScorer.toString()\u003c/code\u003e method.\u003c/p\u003e\n"]]],[],null,["# Class RescoringMatchScorer (2.0.0)\n\n public final class RescoringMatchScorer extends MatchScorer\n\nAssigns a document score based on term frequency weighted on document parts.\n\nIf you add a MatchScorer to a SortOptions as in the following code: \n\n\n SortOptions sortOptions = SortOptions.newBuilder()\n .setMatchScorer(RescoringMatchScorer.newBuilder())\n .build();\n \nthen this will sort the documents in descending score order. The scores will be\npositive. If you want to sort in ascending order, then use the following code: \n\n\n SortOptions sortOptions = SortOptions.newBuilder()\n .setMatchScorer(RescoringMatchScorer.newBuilder())\n .addSortExpression(\n SortExpression.newBuilder()\n .setExpression(SortExpression.SCORE_FIELD_NAME)\n .setDirection(SortExpression.SortDirection.ASCENDING)\n .setDefaultValueNumeric(0.0))\n .build();\n \nThe scores in this case will be negative. \n\nInheritance\n-----------\n\n[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e [MatchScorer](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.search.MatchScorer) \\\u003e RescoringMatchScorer \n\nInherited Members\n-----------------\n\n[MatchScorer.newBuilder()](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.search.MatchScorer#com_google_appengine_api_search_MatchScorer_newBuilder__) \n[MatchScorer.toString()](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.search.MatchScorer#com_google_appengine_api_search_MatchScorer_toString__) \n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nStatic Methods\n--------------\n\n### newBuilder()\n\n public static RescoringMatchScorer.Builder newBuilder()\n\nCreates and returns a RescoringMatchScorer Builder.\n\nMethods\n-------\n\n### toString()\n\n public String toString()\n\n**Overrides** \n[MatchScorer.toString()](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.search.MatchScorer#com_google_appengine_api_search_MatchScorer_toString__)"]]