use of org.opensearch.index.query.QueryBuilder in project fess by codelibs.
the class BsBoostDocumentRuleCB method build.
// ===================================================================================
// Build
// =====
@Override
public SearchRequestBuilder build(SearchRequestBuilder builder) {
if (_conditionQuery != null) {
QueryBuilder queryBuilder = _conditionQuery.getQuery();
if (queryBuilder != null) {
builder.setQuery(queryBuilder);
}
_conditionQuery.getFieldSortBuilderList().forEach(sort -> {
builder.addSort(sort);
});
}
if (_conditionAggregation != null) {
_conditionAggregation.getAggregationBuilderList().forEach(builder::addAggregation);
}
if (_specification != null) {
builder.setFetchSource(_specification.columnList.toArray(new String[_specification.columnList.size()]), null);
}
return builder;
}
use of org.opensearch.index.query.QueryBuilder in project fess by codelibs.
the class BsCrawlingInfoParamCB method build.
// ===================================================================================
// Build
// =====
@Override
public SearchRequestBuilder build(SearchRequestBuilder builder) {
if (_conditionQuery != null) {
QueryBuilder queryBuilder = _conditionQuery.getQuery();
if (queryBuilder != null) {
builder.setQuery(queryBuilder);
}
_conditionQuery.getFieldSortBuilderList().forEach(sort -> {
builder.addSort(sort);
});
}
if (_conditionAggregation != null) {
_conditionAggregation.getAggregationBuilderList().forEach(builder::addAggregation);
}
if (_specification != null) {
builder.setFetchSource(_specification.columnList.toArray(new String[_specification.columnList.size()]), null);
}
return builder;
}
use of org.opensearch.index.query.QueryBuilder in project fess by codelibs.
the class BsElevateWordToLabelCB method build.
// ===================================================================================
// Build
// =====
@Override
public SearchRequestBuilder build(SearchRequestBuilder builder) {
if (_conditionQuery != null) {
QueryBuilder queryBuilder = _conditionQuery.getQuery();
if (queryBuilder != null) {
builder.setQuery(queryBuilder);
}
_conditionQuery.getFieldSortBuilderList().forEach(sort -> {
builder.addSort(sort);
});
}
if (_conditionAggregation != null) {
_conditionAggregation.getAggregationBuilderList().forEach(builder::addAggregation);
}
if (_specification != null) {
builder.setFetchSource(_specification.columnList.toArray(new String[_specification.columnList.size()]), null);
}
return builder;
}
use of org.opensearch.index.query.QueryBuilder in project fess by codelibs.
the class EsAbstractConditionQuery method regRangeQ.
protected RangeQueryBuilder regRangeQ(String name, ConditionKey ck, Object value) {
checkEsInvalidQuery(name, value);
assertObjectNotNull("ck", ck);
if (queryBuilderList != null) {
for (QueryBuilder builder : queryBuilderList) {
if (builder instanceof RangeQueryBuilder) {
RangeQueryBuilder rangeQueryBuilder = (RangeQueryBuilder) builder;
if (rangeQueryBuilder.toString().replaceAll("\\s", "").startsWith("{\"range\":{\"" + name + "\"")) {
addRangeC(rangeQueryBuilder, ck, value);
return rangeQueryBuilder;
}
}
}
}
RangeQueryBuilder rangeQueryBuilder = QueryBuilders.rangeQuery(name);
addRangeC(rangeQueryBuilder, ck, value);
regQ(rangeQueryBuilder);
return rangeQueryBuilder;
}
use of org.opensearch.index.query.QueryBuilder in project fess by codelibs.
the class EsAbstractConditionQuery method regRangeQ.
protected RangeQueryBuilder regRangeQ(String name, ConditionKey ck, Object value) {
checkEsInvalidQuery(name, value);
assertObjectNotNull("ck", ck);
if (queryBuilderList != null) {
for (QueryBuilder builder : queryBuilderList) {
if (builder instanceof RangeQueryBuilder) {
RangeQueryBuilder rangeQueryBuilder = (RangeQueryBuilder) builder;
if (rangeQueryBuilder.toString().replaceAll("\\s", "").startsWith("{\"range\":{\"" + name + "\"")) {
addRangeC(rangeQueryBuilder, ck, value);
return rangeQueryBuilder;
}
}
}
}
RangeQueryBuilder rangeQueryBuilder = QueryBuilders.rangeQuery(name);
addRangeC(rangeQueryBuilder, ck, value);
regQ(rangeQueryBuilder);
return rangeQueryBuilder;
}
Aggregations