Package com.google.appengine.api.search
See: Description
-
Interface Summary Interface Description Index ISearchServiceFactory A factory that creates default implementation ofSearchService
.SearchService The SearchService is used to get available indexes, which can be queried about their metadata or have index/delete/search operations performed on them. -
Class Summary Class Description AdminSearchServiceFactory BuildsSearchService
instances that are pinned to a specific application and namespace regardless of the "current" appId provided byApiProxy.getCurrentEnvironment().getAppId()
and the "current" namespace provided byNamespaceManager.get()
.Cursor Cursor.Builder A builder which constructs Cursor objects.DateUtil A utility class that centralizes processing of dates.Document Represents a user generated document.Document.Builder A builder of documents.Facet AFacet
can be used to categorize aDocument
.FacetOptions AFacetOptions
represents facet options such as the number of facets to discover (discoveryLimit
), the number of values to be included in each discovered facet (discoveryValueLimit
), and the depth of the results to check (depth
).FacetOptions.Builder Builder forFacetOptions
.FacetRange A FacetRange is a range with a start (inclusive) and an end (exclusive).FacetRefinement A Facet Refinement to filter out search results based on a facet value.FacetRequest A facet request representing parameters for requesting specific facets to be returned with a query result.FacetRequest.Builder A facet request builder.FacetResult Represents a facet result computed from an extended search result set.FacetResult.Builder A builder of facet result.FacetResultValue Represents a single facet result value.Field Represents a field of aDocument
, which is a name, an optional locale, and at most one value: text, HTML, atom, date, GeoPoint, untokenizedPrefix, tokenizedPrefix or vector.Field.Builder A field builder.FieldExpression Represents an expression bound to a returned Field with the given name.FieldExpression.Builder A field expression builder.GeoPoint Represents a point on the Earth's surface, in latitude and longitude coordinates.GetIndexesRequest A request to get a range of indexes.GetIndexesRequest.Builder The builder ofGetIndexesRequest
s.GetRequest A request to list objects in an index.GetRequest.Builder The builder ofGetRequest
s.GetResponse<T> Represents a result of executing aGetRequest
.IndexSpec Represents information about an index.IndexSpec.Builder A builder of IndexSpec.ISearchServiceFactoryProvider Factory provider forISearchServiceFactory
.MatchScorer Assigns a document score based on term frequency.MatchScorer.Builder A builder that constructsMatchScorers
.OperationResult The result of an operation involving the search service.PutResponse Represents a result of putting a list of objects (documents or queries) into an index.Query A query to search an index for documents which match, restricting the document fields returned to those given, and scoring and sorting the results, whilst supporting pagination.Query.Builder A builder which constructs Query objects.QueryOptions Represents options which control where and what in the search results to return, from restricting the document fields returned to those given, and scoring and sorting the results, whilst supporting pagination.QueryOptions.Builder A builder which constructs QueryOptions objects.RequestStatusUtil Collection of utility methods for SearchServicePb.RequestStatus.RescoringMatchScorer Assigns a document score based on term frequency weighted on document parts.RescoringMatchScorer.Builder A builder that constructsRescoringMatchScorers
.Results<T> Represents a result of executing a search.Schema Schema.Builder A builder which constructs Schema objects.ScoredDocument Represents a document which may have been scored, possibly some computed expression fields, and a cursor to continue the search from.ScoredDocument.Builder A builder of scored documents.SearchServiceConfig Configuration options for Search API.SearchServiceConfig.Builder Builder forSearchServiceConfig
.SearchServiceFactory An factory that creates default implementation ofSearchService
.SortExpression Sorting specification for a single dimension.SortExpression.Builder A builder that constructsSortExpressions
.SortOptions Definition of how to sort documents.SortOptions.Builder A builder that constructsSortOptionss
. -
Enum Summary Enum Description Field.FieldType The type of the field value.SortExpression.SortDirection The direction search results are sorted by, either ascending or descending.StatusCode Status code returned by various index operations. -
Exception Summary Exception Description DeleteException Thrown to indicate that a search service failure occurred while deleting objects.GetException Thrown to indicate that a search service failure occurred while performing a request to get requested objects.PutException Thrown to indicate that a search service failure occurred while putting objects into the index.SearchBaseException Thrown to indicate that a search service failure occurred.SearchException Thrown to indicate that a search service failure occurred while performing a search request.SearchQueryException Thrown to indicate that a search query was invalid.SearchServiceException Thrown to indicate that a search service failure occurred.
Package com.google.appengine.api.search Description
Document
s which can be indexed and
retrieved with the help of Index
.
A Document
is a collection of Field
s. Each field
is a named and typed value. A document is uniquely identified by
its ID and may contain zero or more fields. A field with a given
name can have multiple occurrences. Once documents are put into the
Index
, they can be retrieved via search queries. Typically,
a program creates an index. This operation does nothing if the
index was already created. Next, a number of documents are inserted
into the index. Finally, index is searched and matching documents,
or their snippets are returned to the user.
public List<ScoredDocument> indexAndSearch( String query, Document... documents) { SearchService searchService = SearchServiceFactory.getSearchService(); Index index = searchService.getIndex( IndexSpec.newBuilder().setIndexName("indexName")); for (Document document : documents) { PutResponse response = index.put(document); assert response.getResults().get(0).getCode().equals(StatusCode.OK); } Results<ScoredDocument> results = index.search(Query.newBuilder().build(query)); List<ScoredDocument> matched = new ArrayList<ScoredDocument>( results.getNumberReturned()); for (ScoredDocument result : results) { matched.add(result); } return matched; }
- See Also:
SearchServiceFactory