SearchResults
Stay organized with collections
Save and categorize content based on your preferences.
Inherited Method Summary
From class java.lang.Object
From interface java.io.Closeable
From interface java.lang.AutoCloseable
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eSearchResults\u003c/code\u003e encapsulates the results of a search operation, providing access to pages of \u003ccode\u003eSearchResult\u003c/code\u003e objects.\u003c/p\u003e\n"],["\u003cp\u003eEach search operation returns a page of results, limited by the size configured in \u003ccode\u003eSearchSpec\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eYou can retrieve subsequent pages of results by calling \u003ccode\u003egetNextPage()\u003c/code\u003e until an empty list is returned.\u003c/p\u003e\n"],["\u003cp\u003eIt is essential to call \u003ccode\u003eclose()\u003c/code\u003e on the \u003ccode\u003eSearchResults\u003c/code\u003e instance after fetching all results.\u003c/p\u003e\n"],["\u003cp\u003eThis class is not thread-safe and is specific to the GMSCore AppSearch module.\u003c/p\u003e\n"]]],[],null,["# SearchResults\n\npublic class **SearchResults** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nimplements [Closeable](//developer.android.com/reference/java/io/Closeable.html) \nEncapsulates results of a search operation.\n\nEach [AppSearchClient.search(String, SearchSpec, String)](/android/reference/com/google/android/gms/appsearch/AppSearchClient#search(java.lang.String,%20com.google.android.gms.appsearch.SearchSpec,%20java.lang.String)) operation returns a list of\n[SearchResult](/android/reference/com/google/android/gms/appsearch/SearchResult)\nobjects, referred to as a \"page\", limited by the size configured by [SearchSpec.Builder.setResultCountPerPage(int)](/android/reference/com/google/android/gms/appsearch/SearchSpec.Builder#setResultCountPerPage(int)).\n\nTo fetch a page of results, call [getNextPage()](/android/reference/com/google/android/gms/appsearch/SearchResults#getNextPage()).\n\nAll instances of [SearchResults](/android/reference/com/google/android/gms/appsearch/SearchResults)\nmust call [close()](/android/reference/com/google/android/gms/appsearch/SearchResults#close())\nafter the results are fetched.\n\nThis class is not thread safe.\n\nThis class is specific to GMSCore AppSearch module and will not be synced to\nFramework. \n\n### Public Method Summary\n\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| void | [close](/android/reference/com/google/android/gms/appsearch/SearchResults#close())() |\n| Task\\\u003c[List](//developer.android.com/reference/java/util/List.html)\\\u003c[SearchResult](/android/reference/com/google/android/gms/appsearch/SearchResult)\\\u003e\\\u003e | [getNextPage](/android/reference/com/google/android/gms/appsearch/SearchResults#getNextPage())() Retrieves the next page of [SearchResult](/android/reference/com/google/android/gms/appsearch/SearchResult) objects. |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nFrom interface java.io.Closeable \n\n|---------------|---------|\n| abstract void | close() |\n\nFrom interface java.lang.AutoCloseable \n\n|---------------|---------|\n| abstract void | close() |\n\nPublic Methods\n--------------\n\n#### public void **close** ()\n\n#### public Task\\\u003c[List](//developer.android.com/reference/java/util/List.html)\\\u003c[SearchResult](/android/reference/com/google/android/gms/appsearch/SearchResult)\\\u003e\\\u003e\n**getNextPage** ()\n\nRetrieves the next page of [SearchResult](/android/reference/com/google/android/gms/appsearch/SearchResult)\nobjects.\n\nThe page size is configured by [SearchSpec.Builder.setResultCountPerPage(int)](/android/reference/com/google/android/gms/appsearch/SearchSpec.Builder#setResultCountPerPage(int)).\n\nContinue calling this method to access results until it returns an empty list,\nsignifying there are no more results."]]