Package org.nuxeo.elasticsearch.core
Class ElasticSearchServiceImpl
- java.lang.Object
-
- org.nuxeo.elasticsearch.core.ElasticSearchServiceImpl
-
- All Implemented Interfaces:
ElasticSearchService
public class ElasticSearchServiceImpl extends Object implements ElasticSearchService
- Since:
- 6.0
-
-
Field Summary
Fields Modifier and Type Field Description protected io.dropwizard.metrics5.Timer
fetchTimer
protected io.dropwizard.metrics5.MetricRegistry
registry
protected io.dropwizard.metrics5.Timer
scrollTimer
protected io.dropwizard.metrics5.Timer
searchTimer
-
Constructor Summary
Constructors Constructor Description ElasticSearchServiceImpl(ElasticSearchAdminImpl esa)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected org.elasticsearch.action.search.SearchScrollRequest
buildEsScrollRequest(String scrollId, long keepAlive)
protected org.elasticsearch.action.search.SearchRequest
buildEsSearchRequest(NxQueryBuilder query, org.elasticsearch.action.search.SearchType searchType)
protected org.elasticsearch.action.search.SearchRequest
buildEsSearchScrollRequest(NxQueryBuilder query, org.elasticsearch.action.search.SearchType searchType, long keepAlive)
protected void
clearScroll(String scrollId)
void
clearScroll(EsScrollResult scrollResult)
Clear scroll on ElasticSearch cluster for the givenEsScrollResult
.protected List<Aggregate<Bucket>>
getAggregates(NxQueryBuilder queryBuilder, org.elasticsearch.action.search.SearchResponse response)
protected DocumentModelListImpl
getDocumentModels(NxQueryBuilder queryBuilder, org.elasticsearch.action.search.SearchResponse response)
protected EsScrollResult
getScrollResults(NxQueryBuilder queryBuilder, org.elasticsearch.action.search.SearchResponse response, String scrollId, long keepAlive)
protected String
getSearchIndexesAsString(NxQueryBuilder query)
protected void
logScrollRequest(String scrollId, long keepAlive)
protected void
logSearchRequest(org.elasticsearch.action.search.SearchRequest request, NxQueryBuilder query, org.elasticsearch.action.search.SearchType searchType)
protected void
logSearchResponse(org.elasticsearch.action.search.SearchResponse response)
protected org.elasticsearch.action.search.SearchResponse
nextScroll(String scrollId, long keepAlive)
DocumentModelList
query(CoreSession session, String nxql, int limit, int offset, SortInfo... sortInfos)
Deprecated.DocumentModelList
query(CoreSession session, org.elasticsearch.index.query.QueryBuilder queryBuilder, int limit, int offset, SortInfo... sortInfos)
Deprecated.DocumentModelList
query(NxQueryBuilder queryBuilder)
Returns a document list using anNxQueryBuilder
.EsResult
queryAndAggregate(NxQueryBuilder queryBuilder)
Returns documents and aggregates.EsScrollResult
scroll(EsScrollResult scrollResult)
Retrieves the next batch of results of a scrollable search request for the givenEsScrollResult
.EsScrollResult
scroll(NxQueryBuilder queryBuilder, long keepAlive)
Performs the initial search of a scrollable search request using anNxQueryBuilder
.protected EsScrollResult
scroll(NxQueryBuilder queryBuilder, org.elasticsearch.action.search.SearchType searchType, long keepAlive)
protected org.elasticsearch.action.search.SearchResponse
search(NxQueryBuilder query)
protected org.elasticsearch.action.search.SearchResponse
searchScroll(NxQueryBuilder query, org.elasticsearch.action.search.SearchType searchType, long keepAlive)
-
-
-
Constructor Detail
-
ElasticSearchServiceImpl
public ElasticSearchServiceImpl(ElasticSearchAdminImpl esa)
-
-
Method Detail
-
query
@Deprecated public DocumentModelList query(CoreSession session, String nxql, int limit, int offset, SortInfo... sortInfos)
Deprecated.Description copied from interface:ElasticSearchService
Returns a document list using an NXQL query. Fetch documents from the VCS repository.- Specified by:
query
in interfaceElasticSearchService
-
query
@Deprecated public DocumentModelList query(CoreSession session, org.elasticsearch.index.query.QueryBuilder queryBuilder, int limit, int offset, SortInfo... sortInfos)
Deprecated.Description copied from interface:ElasticSearchService
Returns a document list using an ElasticSearchQueryBuilder
. Fetch documents from the VCS repository.- Specified by:
query
in interfaceElasticSearchService
-
query
public DocumentModelList query(NxQueryBuilder queryBuilder)
Description copied from interface:ElasticSearchService
Returns a document list using anNxQueryBuilder
.- Specified by:
query
in interfaceElasticSearchService
-
queryAndAggregate
public EsResult queryAndAggregate(NxQueryBuilder queryBuilder)
Description copied from interface:ElasticSearchService
Returns documents and aggregates.- Specified by:
queryAndAggregate
in interfaceElasticSearchService
-
scroll
public EsScrollResult scroll(NxQueryBuilder queryBuilder, long keepAlive)
Description copied from interface:ElasticSearchService
Performs the initial search of a scrollable search request using anNxQueryBuilder
.- Specified by:
scroll
in interfaceElasticSearchService
keepAlive
- the search context lifetime- Returns:
- an
EsScrollResult
including the search results and a scroll id, to be passed to the subsequent calls toElasticSearchService.scroll(EsScrollResult)
-
scroll
protected EsScrollResult scroll(NxQueryBuilder queryBuilder, org.elasticsearch.action.search.SearchType searchType, long keepAlive)
-
scroll
public EsScrollResult scroll(EsScrollResult scrollResult)
Description copied from interface:ElasticSearchService
Retrieves the next batch of results of a scrollable search request for the givenEsScrollResult
.- Specified by:
scroll
in interfaceElasticSearchService
- Returns:
- an
EsScrollResult
including the search results and a scroll id, to be passed to the subsequent calls to {code scroll}.
-
clearScroll
public void clearScroll(EsScrollResult scrollResult)
Description copied from interface:ElasticSearchService
Clear scroll on ElasticSearch cluster for the givenEsScrollResult
.- Specified by:
clearScroll
in interfaceElasticSearchService
-
clearScroll
protected void clearScroll(String scrollId)
-
getScrollResults
protected EsScrollResult getScrollResults(NxQueryBuilder queryBuilder, org.elasticsearch.action.search.SearchResponse response, String scrollId, long keepAlive)
-
getDocumentModels
protected DocumentModelListImpl getDocumentModels(NxQueryBuilder queryBuilder, org.elasticsearch.action.search.SearchResponse response)
-
getAggregates
protected List<Aggregate<Bucket>> getAggregates(NxQueryBuilder queryBuilder, org.elasticsearch.action.search.SearchResponse response)
-
search
protected org.elasticsearch.action.search.SearchResponse search(NxQueryBuilder query)
-
searchScroll
protected org.elasticsearch.action.search.SearchResponse searchScroll(NxQueryBuilder query, org.elasticsearch.action.search.SearchType searchType, long keepAlive)
-
nextScroll
protected org.elasticsearch.action.search.SearchResponse nextScroll(String scrollId, long keepAlive)
-
buildEsSearchRequest
protected org.elasticsearch.action.search.SearchRequest buildEsSearchRequest(NxQueryBuilder query, org.elasticsearch.action.search.SearchType searchType)
-
buildEsSearchScrollRequest
protected org.elasticsearch.action.search.SearchRequest buildEsSearchScrollRequest(NxQueryBuilder query, org.elasticsearch.action.search.SearchType searchType, long keepAlive)
-
buildEsScrollRequest
protected org.elasticsearch.action.search.SearchScrollRequest buildEsScrollRequest(String scrollId, long keepAlive)
-
logSearchResponse
protected void logSearchResponse(org.elasticsearch.action.search.SearchResponse response)
-
logSearchRequest
protected void logSearchRequest(org.elasticsearch.action.search.SearchRequest request, NxQueryBuilder query, org.elasticsearch.action.search.SearchType searchType)
-
logScrollRequest
protected void logScrollRequest(String scrollId, long keepAlive)
-
getSearchIndexesAsString
protected String getSearchIndexesAsString(NxQueryBuilder query)
-
-