private ElasticsearchQueryString groupByQueryString(Event event) {
        ElasticsearchQueryString result = ElasticsearchQueryString.empty();
        if (!config.groupBy().isEmpty()) {
            for (String key : event.getGroupByFields().keySet()) {
                String value = event.getGroupByFields().get(key);
                String query = new StringBuilder(key).append(":\"").append(luceneEscape(value)).append("\"").toString();
                result = result.concatenate(ElasticsearchQueryString.of(query));
            }
        }
        return result;
    }
@Test
    public void testGroupByQueryString() throws EventProcessorException {
        Map<String, String> groupByFields = ImmutableMap.of(
                "group_field_one", "one",
                "group_field_two", "two"
        );
        sourceMessagesWithAggregation(groupByFields, 1, emptyList());

        String expectedQueryString = "(aQueryString) AND ((group_field_one:\"one\") AND (group_field_two:\"two\"))";
        verify(moreSearch).scrollQuery(eq(expectedQueryString), any(), any(), any(), any(), eq(1), any());
    }