Search in sources :

Example 1 with SearchDTO

use of org.graylog.plugins.views.search.rest.SearchDTO in project graylog2-server by Graylog2.

the class SearchDriver method allMessagesJson.

private static String allMessagesJson(String queryId, String messageListId, TimeRange timeRange) {
    MessageList messageList = MessageList.builder().id(messageListId).build();
    QueryDTO q = QueryDTO.builder().id(queryId).query(ElasticsearchQueryString.of("")).timerange(timeRange).searchTypes(ImmutableSet.of(messageList)).build();
    SearchDTO s = SearchDTO.builder().id(new ObjectId().toHexString()).queries(ImmutableSet.of(q)).build();
    return JsonUtils.toJsonString(s);
}
Also used : ObjectId(org.bson.types.ObjectId) QueryDTO(org.graylog.plugins.views.search.rest.QueryDTO) SearchDTO(org.graylog.plugins.views.search.rest.SearchDTO) MessageList(org.graylog.plugins.views.search.searchtypes.MessageList)

Aggregations

ObjectId (org.bson.types.ObjectId)1 QueryDTO (org.graylog.plugins.views.search.rest.QueryDTO)1 SearchDTO (org.graylog.plugins.views.search.rest.SearchDTO)1 MessageList (org.graylog.plugins.views.search.searchtypes.MessageList)1