use of org.graylog.plugins.views.search.SearchType in project graylog2-server by Graylog2.
the class ElasticsearchBackendQueryStringDecoratorsTest method searchJobWithRootQueryString.
private SearchJob searchJobWithRootQueryString(Query query) throws InvalidRangeParametersException {
final SearchType searchType = basicSearchType();
final SearchJob searchJob = basicSearchJob(query, searchType);
when(query.query()).thenReturn(ElasticsearchQueryString.of("*"));
return searchJob;
}
use of org.graylog.plugins.views.search.SearchType in project graylog2-server by Graylog2.
the class ElasticsearchBackendQueryStringDecoratorsTest method searchJobWithSearchTypeQueryString.
private SearchJob searchJobWithSearchTypeQueryString(Query query) throws InvalidRangeParametersException {
final SearchType searchType = basicSearchType();
final SearchJob searchJob = basicSearchJob(query, searchType);
when(query.query()).thenReturn(ElasticsearchQueryString.of("*"));
when(searchType.query()).thenReturn(Optional.of(ElasticsearchQueryString.of("Should never show up")));
return searchJob;
}
use of org.graylog.plugins.views.search.SearchType in project graylog2-server by Graylog2.
the class ElasticsearchBackendQueryStringDecoratorsTest method basicSearchType.
@Nonnull
private SearchType basicSearchType() {
final SearchType searchType = mock(SearchType.class);
when(searchType.id()).thenReturn("testSearchtype");
return searchType;
}
use of org.graylog.plugins.views.search.SearchType in project graylog2-server by Graylog2.
the class ElasticsearchBackendTest method setup.
@BeforeClass
public static void setup() {
Map<String, Provider<ESSearchTypeHandler<? extends SearchType>>> handlers = Maps.newHashMap();
handlers.put(MessageList.NAME, () -> new ESMessageList(new QueryStringDecorators.Fake()));
final FieldTypesLookup fieldTypesLookup = mock(FieldTypesLookup.class);
backend = new ElasticsearchBackend(handlers, null, mock(IndexLookup.class), new QueryStringDecorators.Fake(), (elasticsearchBackend, ssb, job, query) -> new ESGeneratedQueryContext(elasticsearchBackend, ssb, job, query, fieldTypesLookup), false);
}
use of org.graylog.plugins.views.search.SearchType in project graylog2-server by Graylog2.
the class ElasticsearchBackendTest method setup.
@BeforeClass
public static void setup() {
Map<String, Provider<ESSearchTypeHandler<? extends SearchType>>> handlers = Maps.newHashMap();
handlers.put(MessageList.NAME, () -> new ESMessageList(new QueryStringDecorators.Fake()));
final FieldTypesLookup fieldTypesLookup = mock(FieldTypesLookup.class);
final QueryStringParser queryStringParser = new QueryStringParser();
backend = new ElasticsearchBackend(handlers, null, mock(IndexLookup.class), new QueryStringDecorators.Fake(), (elasticsearchBackend, ssb, job, query) -> new ESGeneratedQueryContext(elasticsearchBackend, ssb, job, query, fieldTypesLookup), false, new ObjectMapperProvider().get());
}
Aggregations