Overview | Package | Class | Tree | Deprecated | Index | Help
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES

## Package com.google.appengine.api.search

Provides a service for indexing documents and retrieving them using search queries.

See:
Description

Interface Summary
Index | An Index allows synchronous and asynchronous adding and deleting of `Documents` as well as synchronous and asynchronous searching for Documents for a given `Query`.
IndexManager | Deprecated. As of 1.6.3, replaced by `SearchService`.
SearchService | The SearchService is used to list available indexes, which can be queried about their metadata or have index/delete/search operations performed on them.

Class Summary
AddDocumentsResponse | Represents a result of adding a list of `Document` to the index.
AddResponse | Represents a result of adding a list of objects (documents or queries) to an index.
Cursor | Represents a cursor on the set of results found for executing a `Query` during a search on the `Index`.
Cursor.Builder | A builder which constructs Cursor objects.
Document | Represents a user generated document.
Document.Builder | A builder of documents.
ExpressionTreeBuilder | A generator of AST representation of an expression.
Field | Represents a field of a `Document`, which is a name, an optional locale, and at most one value: text, HTML, atom or date.
Field.Builder | A field builder.
FieldExpression | Represents an expression bound to a returned Field with the given name.
FieldExpression.Builder | A field expression builder.
IndexManagerFactory | Deprecated. As of 1.6.3, replaced by `SearchServiceFactory`.
IndexSpec | Represents information about an index.
IndexSpec.Builder | A builder of IndexSpec.
ListDocumentsRequest | Deprecated. As of 1.6.4, replaced by `ListRequest`.
ListDocumentsRequest.Builder | The builder of `ListDocumentsRequest`s.
ListDocumentsResponse | Deprecated. As of 1.6.4, replaced by `ListResponse`.
ListIndexesRequest | A request to list indexes.
ListIndexesRequest.Builder | The builder of `ListIndexesRequest`s.
ListIndexesResponse | Represents a result of executing a `ListIndexesRequest`.
ListRequest | A request to list objects in an index.
ListRequest.Builder | The builder of `ListRequest`s.
ListResponse<T> | Represents a result of executing a `ListRequest`.
MatchScorer | A scorer that returns a score based on term frequency divided by document frequency.
MatchScorer.Builder | A builder that constructs `MatchScorers`.
OperationResult | The result of an operation involving the search service.
ParserFactory | A factory which produces `QueryParsers` for a given token rewrite stream.
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.
RescoringMatchScorer | A scorer that returns a score based on term frequency divided by document frequency.
RescoringMatchScorer.Builder | A builder that constructs `RescoringMatchScorers`.
Results<T> | Represents a result of executing a search.
Schema | Contains information about the kinds of document `Fields` which are supported by the `Index`.
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.
SearchRequest | Deprecated. As of 1.6.4, replaced by `Query` and `QueryOptions`.
SearchRequest.Builder | A builder which constructs SearchRequest objects.
SearchResponse | Deprecated. As of 1.6.4, replaced by `Results`.
SearchResult | Deprecated. As of 1.6.4, replaced by `ScoredDocument`.
SearchServiceFactory | An factory that creates default implementation of `SearchService`.
SortExpression | Sorting specification for a single dimension.
SortExpression.Builder | A builder that constructs `SortExpressions`.
SortOptions | Definition of how to sort documents.
SortOptions.Builder | A builder that constructs `SortOptionss`.
SortSpec | Deprecated. As of 1.6.3, replaced by `CustomScorer` and `SortExpression`.
SortSpec.Builder | A builder that constructs `SortSpecs`.
Util | A utility class that does various checks on search and indexing parameters.

Enum Summary
Consistency | Supported consistency modes by indexes.
Field.FieldType | The type of the field value.
SearchRequest.CursorType | Use a cursor returned from a previous set of search results as a starting point to retrieve the next set of results.
SortSpec.SortDirection | The direction search results are sorted by, either ascending or descending.
SortSpec.SortType | The type of sorting to order documents in a search.
StatusCode | Status code returned by various index operations.

Exception Summary
AddDocumentsException | Thrown to indicate that a search service failure occurred while adding documents to the index.
AddException | Thrown to indicate that a search service failure occurred while adding objects to the index.
InternalFailureException | Thrown to indicate that a search service failure occurred.
ListDocumentsException | Thrown to indicate that a search service failure occurred while performing a list documents request.
ListIndexesException | Thrown to indicate that a search service failure occurred while listing indexes.
RemoveDocumentsException | Thrown to indicate that a search service failure occurred while deleting documents.
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.

## Package com.google.appengine.api.search Description

Provides a service for indexing documents and retrieving them using search queries. This is a low-level API that allows users to directly create `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 added to 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")
                 .setConsistency(Consistency.PER_DOCUMENT)
                 .build());
         for (Document document : documents) {
           AddDocumentsResponse response = index.add(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`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES