Package it.ernytech.tdlib

## Class TdApi.SearchMessages

- java.lang.Object
- - it.ernytech.tdlib.TdApi.Object
  - - it.ernytech.tdlib.TdApi.Function
    - - it.ernytech.tdlib.TdApi.SearchMessages

Enclosing class:
  TdApi

    public static class TdApi.SearchMessages
    extends TdApi.Function

Searches for messages in all chats except secret chats. Returns the results in reverse chronological order (i.e., in order of decreasing (date, chatId, messageId)). For optimal performance the number of returned messages is chosen by the library.

Returns `Messages`

### Field Summary

Fields
`static int` `CONSTRUCTOR` Identifier uniquely determining type of the object.
`int` `limit` The maximum number of messages to be returned, up to 100.
`long` `offsetChatId` The chat identifier of the last found message, or 0 for the first request.
`int` `offsetDate` The date of the message starting from which the results should be fetched.
`long` `offsetMessageId` The message identifier of the last found message, or 0 for the first request.
`java.lang.String` `query` Query to search for.

### Constructor Summary

Constructors
`SearchMessages()` Default constructor.
`SearchMessages​(java.lang.String query, int offsetDate, long offsetChatId, long offsetMessageId, int limit)` Constructor for initialization of all fields.

### Method Summary

All Methods Instance Methods Concrete Methods
`int` `getConstructor()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from class it.ernytech.tdlib.TdApi.Function

`toString`

### Field Detail

#### query

    public java.lang.String query

Query to search for.

#### offsetDate

    public int offsetDate

The date of the message starting from which the results should be fetched. Use 0 or any date in the future to get results from the beginning.

#### offsetChatId

    public long offsetChatId

The chat identifier of the last found message, or 0 for the first request.

#### offsetMessageId

    public long offsetMessageId

The message identifier of the last found message, or 0 for the first request.

#### limit

    public int limit

The maximum number of messages to be returned, up to 100. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached.

#### CONSTRUCTOR

    public static final int CONSTRUCTOR

Identifier uniquely determining type of the object.

See Also:
  Constant Field Values

### Constructor Detail

#### SearchMessages

    public SearchMessages()

Default constructor.

#### SearchMessages

    public SearchMessages​(java.lang.String query,
                          int offsetDate,
                          long offsetChatId,
                          long offsetMessageId,
                          int limit)

Constructor for initialization of all fields.

Parameters:
  `query` - Query to search for.
  `offsetDate` - The date of the message starting from which the results should be fetched. Use 0 or any date in the future to get results from the beginning.
  `offsetChatId` - The chat identifier of the last found message, or 0 for the first request.
  `offsetMessageId` - The message identifier of the last found message, or 0 for the first request.
  `limit` - The maximum number of messages to be returned, up to 100. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached.

### Method Detail

#### getConstructor

    public int getConstructor()

Specified by:
  `getConstructor` in class `TdApi.Object`
Returns:
  this.CONSTRUCTOR