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.FilterBuilder |
getAggregateFilter() |
protected org.elasticsearch.index.query.FilterBuilder |
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() |
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.action.search.SearchRequestBuilder 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 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 org.elasticsearch.index.query.FilterBuilder getAggregateFilter()
protected org.elasticsearch.index.query.FilterBuilder getAggregateFilterExceptFor(String id)
public List<AggregateEsBase<? extends Bucket>> getAggregates()
public List<org.elasticsearch.search.aggregations.bucket.filter.FilterAggregationBuilder> getEsAggregates()
public void updateRequest(org.elasticsearch.action.search.SearchRequestBuilder 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 © 2016 Nuxeo SA. All rights reserved.