Stay organized with collections
Save and categorize content based on your preferences.
publicfinalclassSortOptions
Definition of how to sort documents. You may specify zero or more sort
expressions and set a match scorer. If you have a large index, it is
advisable to set a limit.
a new SortOptions.Builder. Set the parameters for
SortOptions on the Builder, and use the Builder#build() method
to create a concrete instance of SortOptions
[[["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-08-07 UTC."],[[["\u003cp\u003eSortOptions defines how to sort documents, allowing for the specification of multiple sort expressions and a match scorer.\u003c/p\u003e\n"],["\u003cp\u003eIt is recommended to set a limit when dealing with large indexes to enhance performance.\u003c/p\u003e\n"],["\u003cp\u003eSortOptions includes methods to retrieve the set limit, match scorer, and the list of sort expressions.\u003c/p\u003e\n"],["\u003cp\u003eYou can use the \u003ccode\u003enewBuilder()\u003c/code\u003e static method to get a builder that allows for configuration before creating a SortOptions instance.\u003c/p\u003e\n"],["\u003cp\u003eThis class inherits from \u003ccode\u003ejava.lang.Object\u003c/code\u003e, with methods like \u003ccode\u003eequals()\u003c/code\u003e, \u003ccode\u003etoString()\u003c/code\u003e, \u003ccode\u003ewait()\u003c/code\u003e etc.\u003c/p\u003e\n"]]],[],null,["# Class SortOptions (2.0.0)\n\n public final class SortOptions\n\nDefinition of how to sort documents. You may specify zero or more sort\nexpressions and set a match scorer. If you have a large index, it is\nadvisable to set a limit. \n\nInheritance\n-----------\n\n[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e SortOptions \n\nInherited Members\n-----------------\n\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.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \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 SortOptions.Builder newBuilder()\n\nCreates and returns a SortOptions Builder.\n\nMethods\n-------\n\n### getLimit()\n\n public int getLimit()\n\n### getMatchScorer()\n\n public MatchScorer getMatchScorer()\n\n### getSortExpressions()\n\n public List\u003cSortExpression\u003e getSortExpressions()\n\n### toString()\n\n public String toString()\n\n**Overrides** \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--)"]]