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
Class SearchRequest

    java.lang.Object
      com.google.appengine.api.search.SearchRequest

Deprecated. As of 1.6.4, replaced by `Query` and `QueryOptions`.

    @Deprecated
    public final class SearchRequest

extends java.lang.Object

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.

For example, the following request will search for documents where the tokens 'good' and 'story' occur in some fields, returns up to 20 results including the fields 'author' and 'date-sent' as well as snippeted fields 'subject' and 'body'. The results are sorted by 'author' in descending order, getting the next 20 results from the responseCursor in the previously returned results, giving back a single cursor in the `SearchResponse` to get the next batch of results after this.

     SearchRequest request = SearchRequest.newBuilder()
          .setQuery("good story")
          .setLimit(20)
          .setFieldsToReturn("author", "date-sent")
          .setFieldsToSnippet("subject", "body")
          .addSortSpec(SortSpec.newBuilder()
              .setExpression("author")
              .setDirection(SortDirection.DESCENDING)
              .setDefaultValue(""))
          .setCursor(responseCursor)
          .setCursorType(CursorType.RESPONSE_CURSOR)
          .build();

Nested Class Summary
`static class` | `SearchRequest.Builder` Deprecated. A builder which constructs SearchRequest objects.
`static class` | `SearchRequest.CursorType` Deprecated. Use a cursor returned from a previous set of search results as a starting point to retrieve the next set of results.

Method Summary
`java.lang.String` | `getCursor()` Deprecated.
`SearchRequest.CursorType` | `getCursorType()` Deprecated.
`java.util.List<FieldExpression>` | `getExpressionsToReturn()` Deprecated.
`java.util.List<java.lang.String>` | `getFieldsToReturn()` Deprecated.
`java.util.List<java.lang.String>` | `getFieldsToSnippet()` Deprecated.
`int` | `getLimit()` Deprecated.
`int` | `getMatchedCountAccuracy()` Deprecated. Any `SearchResponse.getMatchedCount()` less than or equal to this setting will be accurate.
`int` | `getOffset()` Deprecated.
`java.lang.String` | `getQuery()` Deprecated. The query can be as simple as a single term ("foo"), or as complex as a boolean expression, including field names ("title:hello OR body:important -october").
`java.util.List<SortSpec>` | `getSortSpecs()` Deprecated.
`boolean` | `isReturningIdsOnly()` Deprecated.
`static SearchRequest.Builder` | `newBuilder()` Deprecated. Creates and returns a `SearchRequest` builder.
`static SearchRequest.Builder` | `newBuilder(SearchRequest request)` Deprecated. Creates a builder from the given request.
`java.lang.String` | `toString()` Deprecated.

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

Method Detail

### getQuery

    public java.lang.String getQuery()

  Deprecated.
  The query can be as simple as a single term ("foo"), or as complex as a boolean expression, including field names ("title:hello OR body:important -october").

  Returns:
    the query

### getLimit

    public int getLimit()

  Deprecated.
  Returns:
    the limit on the number of documents to return in search results

### getCursor

    public java.lang.String getCursor()

  Deprecated.
  Returns:
    a cursor returned from a previous set of search results to use as a starting point to retrieve the next set of results. Can be null

### getOffset

    public int getOffset()

  Deprecated.
  Returns:
    the offset of the first result to return; returns 0 if was not set

### getCursorType

    public SearchRequest.CursorType getCursorType()

  Deprecated.
  Returns:
    the type of cursor to return with the search results

### getMatchedCountAccuracy

    public int getMatchedCountAccuracy()

  Deprecated.
  Any `SearchResponse.getMatchedCount()` less than or equal to this setting will be accurate.

  Returns:
    the matched count accuracy

### getSortSpecs

    public java.util.List<SortSpec> getSortSpecs()

  Deprecated.
  Returns:
    a list of field sorting specifications representing a multi-dimensional sort

### isReturningIdsOnly

    public boolean isReturningIdsOnly()

  Deprecated.
  Returns:
    if this search request returns results document IDs only

### getFieldsToReturn

    public java.util.List<java.lang.String> getFieldsToReturn()

  Deprecated.
  Returns:
    an unmodifiable list of names of fields to return in search results

### getFieldsToSnippet

    public java.util.List<java.lang.String> getFieldsToSnippet()

  Deprecated.
  Returns:
    an unmodifiable list of names of fields to snippet in search results

### getExpressionsToReturn

    public java.util.List<FieldExpression> getExpressionsToReturn()

  Deprecated.
  Returns:
    an unmodifiable list of expressions which will be evaluated and returned in results

### newBuilder

    public static SearchRequest.Builder newBuilder()

  Deprecated.
  Creates and returns a `SearchRequest` builder. Set the search request parameters and use the `SearchRequest.Builder.build()` method to create a concrete instance of SearchRequest.

  Returns:
    a `SearchRequest.Builder` which can construct a search request

### newBuilder

    public static SearchRequest.Builder newBuilder(SearchRequest request)

  Deprecated.
  Creates a builder from the given request.

  Parameters:
    `request` - the search request for the builder to use to build another request

### toString

    public java.lang.String toString()

  Deprecated.
  Overrides:
    `toString` in class `java.lang.Object`

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