Represents a result of executing a search.
The Results include an OperationResult, a collection of
results, and a number of found and returned results.
aggregated facets of this search results as a collection of FacetResult
from the search
Methods
getCursor()
publicCursorgetCursor()
A cursor to be used to continue the search after all the results
in this search response. For this field to be populated,
use QueryOptions.Builder#setCursor with a value of
Cursor.newBuilder().build(), otherwise #getCursor
will return null.
cursor to be used to get the next set of results after the
end of these results, or null if there are no more results
to be expected or if no cursor was configured in the QueryOptions.
an unmodifiable collection of aggregated facets for this search results
getNumberFound()
publiclonggetNumberFound()
The number of results found by the search.
If the value is less than or equal to the corresponding
QueryOptions#getNumberFoundAccuracy(),
then it is accurate, otherwise it is an approximation
[[["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-03 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eResults<T>\u003c/code\u003e class represents the outcome of a search operation, including an \u003ccode\u003eOperationResult\u003c/code\u003e, a collection of results, and counts of found and returned results.\u003c/p\u003e\n"],["\u003cp\u003eIt implements \u003ccode\u003eIterable<T>\u003c/code\u003e and \u003ccode\u003eSerializable\u003c/code\u003e, allowing iteration over the results and serialization of the result set.\u003c/p\u003e\n"],["\u003cp\u003eThe class provides constructors to initialize search results with details like \u003ccode\u003eOperationResult\u003c/code\u003e, \u003ccode\u003eresults\u003c/code\u003e, \u003ccode\u003enumberFound\u003c/code\u003e, \u003ccode\u003enumberReturned\u003c/code\u003e, and an optional \u003ccode\u003eCursor\u003c/code\u003e for paginated results.\u003c/p\u003e\n"],["\u003cp\u003eIt offers methods to retrieve the search operation's result, the collection of search results, the number of results found, the number of results returned, any available cursor, and any available facets.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egetCursor\u003c/code\u003e method will return null if no cursor was configured in the \u003ccode\u003eQueryOptions\u003c/code\u003e or if no more results are expected.\u003c/p\u003e\n"]]],[],null,["# Class Results<T> (2.0.0)\n\n public class Results\u003cT\u003e implements Iterable\u003cT\u003e, Serializable\n\nRepresents a result of executing a search.\nThe Results include an [OperationResult](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.search.OperationResult), a collection of\nresults, and a number of found and returned results. \n\nInheritance\n-----------\n\n[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e Results\\\u003cT\\\u003e \n\nImplements\n----------\n\n[Iterable\\\u003cT\\\u003e](https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html), [Serializable](https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html) \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\nConstructors\n------------\n\n### Results(OperationResult operationResult, Collection\\\u003cT\\\u003e results, long numberFound, int numberReturned, Cursor cursor)\n\n protected Results(OperationResult operationResult, Collection\u003cT\u003e results, long numberFound, int numberReturned, Cursor cursor)\n\nCreates a [Results](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.search.Results) by specifying a collection of search\nresults, the number of results found, and the number of results\nreturned.\n\n### Results(OperationResult operationResult, Collection\\\u003cT\\\u003e results, long numberFound, int numberReturned, Cursor cursor, Collection\\\u003cFacetResult\\\u003e facets)\n\n protected Results(OperationResult operationResult, Collection\u003cT\u003e results, long numberFound, int numberReturned, Cursor cursor, Collection\u003cFacetResult\u003e facets)\n\nCreates a [Results](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.search.Results) by specifying a collection of search\nresults, the number of results found, and the number of results\nreturned.\n\nMethods\n-------\n\n### getCursor()\n\n public Cursor getCursor()\n\nA cursor to be used to continue the search after all the results\nin this search response. For this field to be populated,\nuse [QueryOptions.Builder#setCursor](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.search.QueryOptions.Builder#com_google_appengine_api_search_QueryOptions_Builder_setCursor_) with a value of\n`Cursor.newBuilder().build()`, otherwise #getCursor\nwill return null.\n\n### getFacets()\n\n public Collection\u003cFacetResult\u003e getFacets()\n\n### getNumberFound()\n\n public long getNumberFound()\n\nThe number of results found by the search.\nIf the value is less than or equal to the corresponding\n[QueryOptions#getNumberFoundAccuracy()](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.search.QueryOptions#com_google_appengine_api_search_QueryOptions_getNumberFoundAccuracy__),\nthen it is accurate, otherwise it is an approximation\n\n### getNumberReturned()\n\n public int getNumberReturned()\n\n### getOperationResult()\n\n public OperationResult getOperationResult()\n\n### getResults()\n\n public Collection\u003cT\u003e getResults()\n\n### iterator()\n\n public Iterator\u003cT\u003e iterator()\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--)"]]