<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0-google-v4) on Mon Dec 12 14:51:11 PST 2011 --> <TITLE> com.google.appengine.api.search </TITLE> <META NAME="date" CONTENT="2011-12-12"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../dev_javadoc.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="com.google.appengine.api.search"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../com/google/appengine/api/quota/package-summary.html"><B>PREV PACKAGE</B></A> <A HREF="../../../../../com/google/appengine/api/search/query/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?com/google/appengine/api/search/package-summary.html" target="_top"><B>FRAMES</B></A> <A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <H2> Package com.google.appengine.api.search </H2> The search package provides an API for indexing documents and retrieving them using search queries. <P> <B>See:</B> <BR> <A HREF="#package_description"><B>Description</B></A> <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Interface Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/Index.html" title="interface in com.google.appengine.api.search">Index</A></B></TD> <TD>An Index allows synchronous adding and deleting of <A HREF="../../../../../com/google/appengine/api/search/Document.html" title="class in com.google.appengine.api.search"><CODE>Documents</CODE></A> as well as synchronous searching for Documents.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/IndexManager.html" title="interface in com.google.appengine.api.search">IndexManager</A></B></TD> <TD>A manager capable of listing available indexes, which can be queried about their metadata or have index/delete/search operations performed on them.</TD> </TR> </TABLE> <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Class Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/AddDocumentsResponse.html" title="class in com.google.appengine.api.search">AddDocumentsResponse</A></B></TD> <TD>Represents a result of adding a list of <A HREF="../../../../../com/google/appengine/api/search/Document.html" title="class in com.google.appengine.api.search"><CODE>Document</CODE></A> to the index.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/Document.html" title="class in com.google.appengine.api.search">Document</A></B></TD> <TD>Represents a user generated document.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/Document.Builder.html" title="class in com.google.appengine.api.search">Document.Builder</A></B></TD> <TD>A builder of documents.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/DocumentChecker.html" title="class in com.google.appengine.api.search">DocumentChecker</A></B></TD> <TD>Checks values of a Document.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/ExpressionTreeBuilder.html" title="class in com.google.appengine.api.search">ExpressionTreeBuilder</A></B></TD> <TD>A generator of AST representation of an expression.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/Field.html" title="class in com.google.appengine.api.search">Field</A></B></TD> <TD>Represents a field of a <A HREF="../../../../../com/google/appengine/api/search/Document.html" title="class in com.google.appengine.api.search"><CODE>Document</CODE></A>, which is a name, an optional locale, and at most one value: text, HTML, atom or date.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/Field.Builder.html" title="class in com.google.appengine.api.search">Field.Builder</A></B></TD> <TD>A field builder.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/FieldChecker.html" title="class in com.google.appengine.api.search">FieldChecker</A></B></TD> <TD>Provides checks for Field names, language code, and values: text, HTML, atom or date.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/FieldExpression.html" title="class in com.google.appengine.api.search">FieldExpression</A></B></TD> <TD>Represents an expression bound to a returned Field with the given name.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/FieldExpression.Builder.html" title="class in com.google.appengine.api.search">FieldExpression.Builder</A></B></TD> <TD>A field expression builder.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/IndexChecker.html" title="class in com.google.appengine.api.search">IndexChecker</A></B></TD> <TD>Checks values of <A HREF="../../../../../com/google/appengine/api/search/Index.html" title="interface in com.google.appengine.api.search"><CODE>Indexes</CODE></A>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/IndexManagerFactory.html" title="class in com.google.appengine.api.search">IndexManagerFactory</A></B></TD> <TD>An factory that creates default implementation of <A HREF="../../../../../com/google/appengine/api/search/IndexManager.html" title="interface in com.google.appengine.api.search"><CODE>IndexManager</CODE></A>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/IndexSpec.html" title="class in com.google.appengine.api.search">IndexSpec</A></B></TD> <TD>Represents information about an index.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/IndexSpec.Builder.html" title="class in com.google.appengine.api.search">IndexSpec.Builder</A></B></TD> <TD>A builder of IndexSpec.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/ListDocumentsRequest.html" title="class in com.google.appengine.api.search">ListDocumentsRequest</A></B></TD> <TD>A request to list documents in an index.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/ListDocumentsRequest.Builder.html" title="class in com.google.appengine.api.search">ListDocumentsRequest.Builder</A></B></TD> <TD>The builder of <A HREF="../../../../../com/google/appengine/api/search/ListDocumentsRequest.html" title="class in com.google.appengine.api.search"><CODE>ListDocumentsRequest</CODE></A>s.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/ListDocumentsRequestChecker.html" title="class in com.google.appengine.api.search">ListDocumentsRequestChecker</A></B></TD> <TD>Checks values of <CODE>ListDocumentsParams</CODE>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/ListDocumentsResponse.html" title="class in com.google.appengine.api.search">ListDocumentsResponse</A></B></TD> <TD>Represents a result of executing a <A HREF="../../../../../com/google/appengine/api/search/ListDocumentsRequest.html" title="class in com.google.appengine.api.search"><CODE>ListDocumentsRequest</CODE></A>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/ListIndexesRequest.html" title="class in com.google.appengine.api.search">ListIndexesRequest</A></B></TD> <TD>A request to list indexes.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/ListIndexesRequest.Builder.html" title="class in com.google.appengine.api.search">ListIndexesRequest.Builder</A></B></TD> <TD>The builder of <A HREF="../../../../../com/google/appengine/api/search/ListIndexesRequest.html" title="class in com.google.appengine.api.search"><CODE>ListIndexesRequest</CODE></A>s.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/ListIndexesRequestChecker.html" title="class in com.google.appengine.api.search">ListIndexesRequestChecker</A></B></TD> <TD>Checks values of <A HREF="../../../../../com/google/appengine/api/search/ListIndexesRequest.html" title="class in com.google.appengine.api.search"><CODE>ListIndexesRequest</CODE></A>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/ListIndexesResponse.html" title="class in com.google.appengine.api.search">ListIndexesResponse</A></B></TD> <TD>Represents a result of executing a <A HREF="../../../../../com/google/appengine/api/search/ListIndexesRequest.html" title="class in com.google.appengine.api.search"><CODE>ListIndexesRequest</CODE></A>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/OperationResult.html" title="class in com.google.appengine.api.search">OperationResult</A></B></TD> <TD>The result of an operation involving the search service.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/ParserFactory.html" title="class in com.google.appengine.api.search">ParserFactory</A></B></TD> <TD>A factory which produces <CODE>QueryParsers</CODE> for a given token rewrite stream.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/Preconditions.html" title="class in com.google.appengine.api.search">Preconditions</A></B></TD> <TD>Simple static methods to be called at the start of your own methods to verify correct arguments and state.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/Schema.html" title="class in com.google.appengine.api.search">Schema</A></B></TD> <TD>Contains information about the kinds of document <A HREF="../../../../../com/google/appengine/api/search/Field.html" title="class in com.google.appengine.api.search"><CODE>Fields</CODE></A> which are supported by the <A HREF="../../../../../com/google/appengine/api/search/Index.html" title="interface in com.google.appengine.api.search"><CODE>Index</CODE></A>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/SearchRequest.html" title="class in com.google.appengine.api.search">SearchRequest</A></B></TD> <TD>A request to search an index for documents which match a query, restricting the document fields returned to those given, and scoring and sorting the results, whilst supporting pagination.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/SearchRequest.Builder.html" title="class in com.google.appengine.api.search">SearchRequest.Builder</A></B></TD> <TD>A builder which constructs SearchRequest objects.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/SearchRequestChecker.html" title="class in com.google.appengine.api.search">SearchRequestChecker</A></B></TD> <TD>Checks values of SearchRequests.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/SearchResponse.html" title="class in com.google.appengine.api.search">SearchResponse</A></B></TD> <TD>Represents a result of executing a <A HREF="../../../../../com/google/appengine/api/search/SearchRequest.html" title="class in com.google.appengine.api.search"><CODE>SearchRequest</CODE></A>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/SearchResult.html" title="class in com.google.appengine.api.search">SearchResult</A></B></TD> <TD>Represents a single search result consisting of a scored document, a cursor to continue the search from, and any expression fields.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/SortSpec.html" title="class in com.google.appengine.api.search">SortSpec</A></B></TD> <TD>Sorting specification for a single dimension.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/SortSpec.Builder.html" title="class in com.google.appengine.api.search">SortSpec.Builder</A></B></TD> <TD>A builder that constructs <A HREF="../../../../../com/google/appengine/api/search/SortSpec.html" title="class in com.google.appengine.api.search"><CODE>SortSpecs</CODE></A>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/SortSpecChecker.html" title="class in com.google.appengine.api.search">SortSpecChecker</A></B></TD> <TD>Checks the values of a <A HREF="../../../../../com/google/appengine/api/search/SortSpec.html" title="class in com.google.appengine.api.search"><CODE>SortSpec</CODE></A>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/Util.html" title="class in com.google.appengine.api.search">Util</A></B></TD> <TD>A utility class that does various checks on search and indexing parameters.</TD> </TR> </TABLE> <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Enum Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/Consistency.html" title="enum in com.google.appengine.api.search">Consistency</A></B></TD> <TD>Supported consistency modes by indexes.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/Field.FieldType.html" title="enum in com.google.appengine.api.search">Field.FieldType</A></B></TD> <TD>The type of the field value.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/SearchRequest.CursorType.html" title="enum in com.google.appengine.api.search">SearchRequest.CursorType</A></B></TD> <TD>Use a cursor returned from a previous set of search results as a starting point to retrieve the next set of results.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/SortSpec.SortDirection.html" title="enum in com.google.appengine.api.search">SortSpec.SortDirection</A></B></TD> <TD>The direction search results are sorted by, either ascending or descending.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/SortSpec.SortType.html" title="enum in com.google.appengine.api.search">SortSpec.SortType</A></B></TD> <TD>The type of sorting to order documents in a search.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/StatusCode.html" title="enum in com.google.appengine.api.search">StatusCode</A></B></TD> <TD>Status code returned by various index operations.</TD> </TR> </TABLE> <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Exception Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/AddDocumentsException.html" title="class in com.google.appengine.api.search">AddDocumentsException</A></B></TD> <TD>Thrown to indicate that a search service failure occurred while adding documents to the index.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/DeleteDocumentsException.html" title="class in com.google.appengine.api.search">DeleteDocumentsException</A></B></TD> <TD>Thrown to indicate that a search service failure occurred while deleting documents.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/InternalFailureException.html" title="class in com.google.appengine.api.search">InternalFailureException</A></B></TD> <TD>Thrown to indicate that a search service failure occurred.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/ListDocumentsException.html" title="class in com.google.appengine.api.search">ListDocumentsException</A></B></TD> <TD>Thrown to indicate that a search service failure occurred while performing a list documents request.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/ListIndexesException.html" title="class in com.google.appengine.api.search">ListIndexesException</A></B></TD> <TD>Thrown to indicate that a search service failure occurred while listing indexes.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/SearchBaseException.html" title="class in com.google.appengine.api.search">SearchBaseException</A></B></TD> <TD>Thrown to indicate that a search service failure occurred.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/SearchException.html" title="class in com.google.appengine.api.search">SearchException</A></B></TD> <TD>Thrown to indicate that a search service failure occurred while performing a search request.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../../com/google/appengine/api/search/SearchQueryException.html" title="class in com.google.appengine.api.search">SearchQueryException</A></B></TD> <TD>Thrown to indicate that a search query was invalid.</TD> </TR> </TABLE> <P> <A NAME="package_description"><!-- --></A><H2> Package com.google.appengine.api.search Description </H2> <P> The search package provides an API for indexing documents and retrieving them using search queries. This is a low-level API that allows users to directly create <CODE>Document</CODE>s which can be indexed and retrieved with the help of <CODE>Index</CODE>. A <CODE>Document</CODE> is a collection of <CODE>Field</CODE>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 <CODE>Index</CODE>, 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. <pre> public List<Document> indexAndSearch(String query, Document... docs) { IndexManager indexManager = IndexManagerFactory.newIndexManager(); Index index = indexManager.getIndex( IndexSpec.newBuilder() .setIndexName("indexName") .setConsistency(Consistency.PER_DOCUMENT) .build()); for (Document d : docs) { OperationResult result = index.addDocument(d); assert result.getCode().equals(StatusCode.OK); } SearchResponse response = index.search(query); List<Document> matched = new ArrayList<Document>( response.getDocumentsReturned()); if (StatusCode.OK.equals(response.getOperationResult().getCode())) { for (SearchResult result : response) { matched.add(result.getDocument()); } } return matched; }</pre> <P> <P> <DL> </DL> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../com/google/appengine/api/quota/package-summary.html"><B>PREV PACKAGE</B></A> <A HREF="../../../../../com/google/appengine/api/search/query/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?com/google/appengine/api/search/package-summary.html" target="_top"><B>FRAMES</B></A> <A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>