QueryOptions.Builder (Google App Engine API for Java)

com.google.appengine.api.search

Class QueryOptions.Builder

  • java.lang.Object
    • com.google.appengine.api.search.QueryOptions.Builder
  • Enclosing class:
    QueryOptions


    public static final class QueryOptions.Builder
    extends java.lang.Object
    A builder which constructs QueryOptions objects.
    • Method Detail

      • setLimit

        public QueryOptions.Builder setLimit(int limit)
        Sets the limit on the number of documents to return in Results.
        Parameters:
        limit - the number of documents to return
        Returns:
        this Builder
        Throws:
        java.lang.IllegalArgumentException - if numDocumentsToReturn is not within acceptable range
      • setCursor

        public QueryOptions.Builder setCursor(Cursor cursor)
        Sets the cursor. The cursor is obtained from either a Results or one of the individual ScoredDocuments. This is illustrated from the following code fragment:

         Cursor cursor = Cursor.newBuilder().build();
        
         SearchResults results = index.search(
             Query.newBuilder()
                 .setOptions(QueryOptions.newBuilder()
                     .setLimit(20)
                     .setCursor(cursor)
                     .build())
                 .build("some query"));
        
         // If the Cursor is built without setPerResult(true), then
         // by default a single