public class NxQueryBuilder extends Object
Constructor and Description |
---|
NxQueryBuilder(CoreSession coreSession) |
Modifier and Type | Method and Description |
---|---|
NxQueryBuilder |
addAggregate(AggregateEsBase<? extends Bucket> aggregate) |
NxQueryBuilder |
addAggregates(List<AggregateEsBase<? extends Bucket>> aggregates) |
NxQueryBuilder |
addSearchRepository(String repositoryName)
Add a specific repository to search.
|
protected org.elasticsearch.index.query.QueryBuilder |
addSecurityFilter(org.elasticsearch.index.query.QueryBuilder query) |
NxQueryBuilder |
addSort(SortInfo sortInfo) |
NxQueryBuilder |
addSort(SortInfo[] sortInfos) |
NxQueryBuilder |
esQuery(org.elasticsearch.index.query.QueryBuilder queryBuilder)
Build the query using the Elasticsearch QueryBuilder API.
|
NxQueryBuilder |
fetchFromDatabase()
Fetch the documents using VCS (database) engine.
|
NxQueryBuilder |
fetchFromElasticsearch()
Ask for the Elasticsearch _source field, use it to build documents.
|
protected org.elasticsearch.index.query.QueryBuilder |
getAggregateFilter() |
protected org.elasticsearch.index.query.QueryBuilder |
getAggregateFilterExceptFor(String id) |
static String |
getAggregateFilterId(Aggregate agg) |
List<AggregateEsBase<? extends Bucket>> |
getAggregates() |
List<org.elasticsearch.search.aggregations.bucket.filter.FilterAggregationBuilder> |
getEsAggregates() |
Fetcher |
getFetcher(org.elasticsearch.action.search.SearchResponse response,
Map<String,String> repoNames) |
int |
getLimit() |
String |
getNxql() |
int |
getOffset() |
List<String> |
getSearchRepositories()
Return the list of repositories to search, or an empty list to search on all available repositories;
|
String[] |
getSelectFields() |
Map<String,Type> |
getSelectFieldsAndTypes() |
CoreSession |
getSession() |
org.elasticsearch.search.sort.SortBuilder[] |
getSortBuilders() |
List<SortInfo> |
getSortInfos() |
protected String |
guessFieldType(String field) |
NxQueryBuilder |
highlight(List<String> highlightFields) |
boolean |
isFetchFromElasticsearch() |
NxQueryBuilder |
limit(int limit)
No more than that many documents will be returned.
|
org.elasticsearch.index.query.QueryBuilder |
makeQuery()
Get the Elasticsearch queryBuilder.
|
NxQueryBuilder |
nxql(String nxql)
Build the query from a NXQL string.
|
protected boolean |
nxqlHasSelectClause(String nxql) |
NxQueryBuilder |
offset(int offset)
Says to skip that many documents before beginning to return documents.
|
NxQueryBuilder |
onlyElasticsearchResponse()
Don't return document model list, aggregates or rows, only the original Elasticsearch response is accessible from
EsResult.getElasticsearchResponse() |
boolean |
returnsDocuments() |
boolean |
returnsRows() |
NxQueryBuilder |
searchOnAllRepositories()
Search on all available repositories.
|
void |
updateRequest(org.elasticsearch.search.builder.SearchSourceBuilder request) |
public NxQueryBuilder(CoreSession coreSession)
public static String getAggregateFilterId(Aggregate agg)
public NxQueryBuilder limit(int limit)
public NxQueryBuilder offset(int offset)
public NxQueryBuilder addSort(SortInfo sortInfo)
public NxQueryBuilder addSort(SortInfo[] sortInfos)
public NxQueryBuilder nxql(String nxql)
public NxQueryBuilder esQuery(org.elasticsearch.index.query.QueryBuilder queryBuilder)
public NxQueryBuilder fetchFromElasticsearch()
public NxQueryBuilder fetchFromDatabase()
public NxQueryBuilder onlyElasticsearchResponse()
EsResult.getElasticsearchResponse()
public NxQueryBuilder addAggregate(AggregateEsBase<? extends Bucket> aggregate)
public NxQueryBuilder addAggregates(List<AggregateEsBase<? extends Bucket>> aggregates)
public NxQueryBuilder highlight(List<String> highlightFields)
public int getLimit()
public int getOffset()
public List<SortInfo> getSortInfos()
public boolean isFetchFromElasticsearch()
public CoreSession getSession()
public org.elasticsearch.index.query.QueryBuilder makeQuery()
protected boolean nxqlHasSelectClause(String nxql)
public org.elasticsearch.search.sort.SortBuilder[] getSortBuilders()
protected String guessFieldType(String field)
protected org.elasticsearch.index.query.QueryBuilder getAggregateFilter()
protected org.elasticsearch.index.query.QueryBuilder getAggregateFilterExceptFor(String id)
public List<AggregateEsBase<? extends Bucket>> getAggregates()
public List<org.elasticsearch.search.aggregations.bucket.filter.FilterAggregationBuilder> getEsAggregates()
public void updateRequest(org.elasticsearch.search.builder.SearchSourceBuilder request)
protected org.elasticsearch.index.query.QueryBuilder addSecurityFilter(org.elasticsearch.index.query.QueryBuilder query)
public NxQueryBuilder addSearchRepository(String repositoryName)
public NxQueryBuilder searchOnAllRepositories()
public List<String> getSearchRepositories()
public Fetcher getFetcher(org.elasticsearch.action.search.SearchResponse response, Map<String,String> repoNames)
public String[] getSelectFields()
public Map<String,Type> getSelectFieldsAndTypes()
public boolean returnsDocuments()
public boolean returnsRows()
Copyright © 2018 Nuxeo. All rights reserved.