Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.google.appengine.api.search.checkers
Class SearchRequestChecker

    java.lang.Object
      com.google.appengine.api.search.checkers.SearchRequestChecker

    public final class SearchRequestChecker

extends java.lang.Object

Checks values of SearchRequests.

Field Summary
`static int` | `DEFAULT_LIMIT` The default limit on the number of documents to return in results.
`static int` | `DEFAULT_MATCHED_COUNT_ACCURACY` The default matched count accuracy.
`static int` | `MAXIMUM_LIMIT` The maximum number of documents that can be requested to be returned in search results.
`static int` | `MAXIMUM_MATCHED_COUNT_ACCURACY` The maximum matched count accuracy that can be requested.
`static int` | `MAXIMUM_NUMBER_OF_FIELDS_TO_RETURN` The maximum number of names of fields to return in results.
`static int` | `MAXIMUM_OFFSET` The maximum offset into all search results to return results from.

Constructor Summary
`SearchRequestChecker()`

Method Summary
`static java.lang.String` | `checkCursor(java.lang.String cursor)` Checks the cursor if provided is not empty.
`static java.util.List<java.lang.String>` | `checkFieldNames(java.util.List<java.lang.String> fieldNames)` Checks that there are at most #MAXIMUM_NUMBER_OF_FIELDS_TO_RETURN field names and that each field name is valid.
`static int` | `checkLimit(int limit)` Checks whether the number of documents to return is between 1 and the maximum.
`static int` | `checkMatchedCountAccuracy(int matchedCountAccuracy)` Checks whether the minimum documents matched count accuracy is between 1 and the maximum.
`static java.lang.Integer` | `checkOffset(java.lang.Integer offset)` Checks whether the offset is between 0 and the maximum.
`static java.lang.String` | `checkQuery(java.lang.String query)` Checks that query is not null and is parsable.
`static SearchParams` | `checkValid(SearchParams params)` Checks the search specification is valid, specifically, has a valid index specification, a non-null query, a non-null number of documents to return specification, a valid cursor if present, valid sort specification list, a valid collection of field names for sorting, and a valid scorer specification.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### MAXIMUM_OFFSET

    public static final int MAXIMUM_OFFSET

  The maximum offset into all search results to return results from.

  See Also:
    Constant Field Values

### MAXIMUM_LIMIT

    public static final int MAXIMUM_LIMIT

  The maximum number of documents that can be requested to be returned in search results.

  See Also:
    Constant Field Values

### DEFAULT_LIMIT

    public static final int DEFAULT_LIMIT

  The default limit on the number of documents to return in results.

  See Also:
    Constant Field Values

### MAXIMUM_MATCHED_COUNT_ACCURACY

    public static final int MAXIMUM_MATCHED_COUNT_ACCURACY

  The maximum matched count accuracy that can be requested.

  See Also:
    Constant Field Values

### DEFAULT_MATCHED_COUNT_ACCURACY

    public static final int DEFAULT_MATCHED_COUNT_ACCURACY

  The default matched count accuracy.

  See Also:
    Constant Field Values

### MAXIMUM_NUMBER_OF_FIELDS_TO_RETURN

    public static final int MAXIMUM_NUMBER_OF_FIELDS_TO_RETURN

  The maximum number of names of fields to return in results.

  See Also:
    Constant Field Values

Constructor Detail

### SearchRequestChecker

    public SearchRequestChecker()

Method Detail

### checkQuery

    public static java.lang.String checkQuery(java.lang.String query)

  Checks that query is not null and is parsable.

  Parameters:
    `query` - the query to check
  Returns:
    the checked query
  Throws:
    `SearchQueryException` - if the query is not parsable

### checkLimit

    public static int checkLimit(int limit)

  Checks whether the number of documents to return is between 1 and the maximum.

  Parameters:
    `limit` - the maximum number of documents to return in search results
  Returns:
    the checked number of documents to return
  Throws:
    `java.lang.IllegalArgumentException` - if the number of documents to return is out of range

### checkOffset

    public static java.lang.Integer checkOffset(java.lang.Integer offset)

  Checks whether the offset is between 0 and the maximum. Can be null.

  Parameters:
    `offset` - the offset of the first result to return results
  Returns:
    the checked offset of the first result to return
  Throws:
    `java.lang.IllegalArgumentException` - if the offset is out of range

### checkMatchedCountAccuracy

    public static int checkMatchedCountAccuracy(int matchedCountAccuracy)

  Checks whether the minimum documents matched count accuracy is between 1 and the maximum.

  Parameters:
    `matchedCountAccuracy` - the minimum number of documents matched accuracy
  Returns:
    the checked accuracy
  Throws:
    `java.lang.IllegalArgumentException` - if the minimum is out of range

### checkFieldNames

    public static java.util.List<java.lang.String> checkFieldNames(java.util.List<java.lang.String> fieldNames)

  Checks that there are at most #MAXIMUM_NUMBER_OF_FIELDS_TO_RETURN field names and that each field name is valid.

  Parameters:
    `fieldNames` - the list of field names to check
  Returns:
    the checked list of field names
  Throws:
    `java.lang.IllegalArgumentException` - if the field names list size exceeds the maximum, or some name is invalid

### checkCursor

    public static java.lang.String checkCursor(java.lang.String cursor)

  Checks the cursor if provided is not empty.

  Parameters:
    `cursor` - the search cursor to check
  Returns:
    the checked cursor
  Throws:
    `java.lang.IllegalArgumentException` - if the cursor is empty

### checkValid

    public static SearchParams checkValid(SearchParams params)

  Checks the search specification is valid, specifically, has a valid index specification, a non-null query, a non-null number of documents to return specification, a valid cursor if present, valid sort specification list, a valid collection of field names for sorting, and a valid scorer specification.

  Parameters:
    `params` - the SearchParams to check
  Returns:
    this checked SearchParams
  Throws:
    `java.lang.IllegalArgumentException` - if some part of the specification is invalid
    `SearchQueryException` - if the query is unparsable

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD