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.
|
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.
|
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.
|
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 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 String getNxql()
public boolean isFetchFromElasticsearch()
public CoreSession getSession()
public org.elasticsearch.index.query.QueryBuilder makeQuery()
public org.elasticsearch.search.sort.SortBuilder[] getSortBuilders()
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)
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 boolean returnsDocuments()
public boolean returnsRows()
Copyright © 2015 Nuxeo SA. All rights reserved.