Search in sources :

Example 1 with ComponentTextSearchQuery

use of org.sonar.server.es.textsearch.ComponentTextSearchQueryFactory.ComponentTextSearchQuery in project sonarqube by SonarSource.

the class ComponentIndex method createQuery.

private QueryBuilder createQuery(ComponentIndexQuery query, ComponentTextSearchFeature... features) {
    BoolQueryBuilder esQuery = boolQuery();
    esQuery.filter(authorizationTypeSupport.createQueryFilter());
    ComponentTextSearchQuery componentTextSearchQuery = ComponentTextSearchQuery.builder().setQueryText(query.getQuery()).setFieldKey(FIELD_KEY).setFieldName(FIELD_NAME).build();
    return esQuery.must(ComponentTextSearchQueryFactory.createQuery(componentTextSearchQuery, features));
}
Also used : ComponentTextSearchQuery(org.sonar.server.es.textsearch.ComponentTextSearchQueryFactory.ComponentTextSearchQuery) BoolQueryBuilder(org.elasticsearch.index.query.BoolQueryBuilder)

Aggregations

BoolQueryBuilder (org.elasticsearch.index.query.BoolQueryBuilder)1 ComponentTextSearchQuery (org.sonar.server.es.textsearch.ComponentTextSearchQueryFactory.ComponentTextSearchQuery)1