public class ElasticSearchIndexProvider extends Object implements IndexProvider
Modifier and Type | Field and Description |
---|---|
static int |
ELASTICSEARCH_MAX_SIZE |
static String |
ES_KEYWORD_TYPE |
static String |
ES_TEXT_TYPE |
Constructor and Description |
---|
ElasticSearchIndexProvider(MetaModelStore metaModelStore,
ElasticSearchContext elasticSearchContext,
org.apache.lucene.analysis.Analyzer analyzer) |
Modifier and Type | Method and Description |
---|---|
protected void |
addSort(org.elasticsearch.search.builder.SearchSourceBuilder searchSourceBuilder,
org.apache.lucene.search.SortField sortField) |
protected String |
createElasticType(MetaProperty metaProperty) |
org.elasticsearch.action.index.IndexRequestBuilder |
createIndexRequest(ElasticMetaObject object) |
void |
delete(String index) |
void |
delete(String index,
String id) |
void |
dispose() |
protected String |
escapeSpecialCharacters(String queryString) |
boolean |
exists(String index,
String id) |
List<KObject> |
findById(String index,
String id) |
List<KObject> |
findByQuery(List<String> indices,
org.apache.lucene.search.Query query,
int limit) |
List<KObject> |
findByQuery(List<String> indices,
org.apache.lucene.search.Query query,
org.apache.lucene.search.Sort sort,
int limit) |
protected Optional<org.elasticsearch.action.search.SearchResponse> |
findByQueryRaw(List<String> indices,
org.apache.lucene.search.Query query,
org.apache.lucene.search.Sort sort,
int limit) |
long |
findHitsByQuery(List<String> indices,
org.apache.lucene.search.Query query) |
org.elasticsearch.client.Client |
getClient() |
long |
getIndexSize(String index) |
List<String> |
getIndices() |
Optional<org.elasticsearch.cluster.metadata.MappingMetaData> |
getMapping(String index,
String type) |
void |
index(KObject object) |
void |
index(List<KObject> elements) |
boolean |
isFreshIndex(KCluster cluster) |
void |
putMapping(String index,
String type,
List<MetaProperty> metaProperties) |
void |
putMapping(String index,
String type,
MetaObject metaObject) |
void |
rename(String index,
String id,
KObject to) |
protected String |
sanitizeIndex(String index) |
protected List<String> |
sanitizeIndexes(List<String> indices) |
public static final int ELASTICSEARCH_MAX_SIZE
public static final String ES_TEXT_TYPE
public static final String ES_KEYWORD_TYPE
public ElasticSearchIndexProvider(MetaModelStore metaModelStore, ElasticSearchContext elasticSearchContext, org.apache.lucene.analysis.Analyzer analyzer)
public org.elasticsearch.client.Client getClient()
public boolean isFreshIndex(KCluster cluster)
isFreshIndex
in interface IndexProvider
public void index(KObject object)
index
in interface IndexProvider
public void index(List<KObject> elements)
index
in interface IndexProvider
public org.elasticsearch.action.index.IndexRequestBuilder createIndexRequest(ElasticMetaObject object)
public boolean exists(String index, String id)
exists
in interface IndexProvider
public void delete(String index)
delete
in interface IndexProvider
public void delete(String index, String id)
delete
in interface IndexProvider
public List<KObject> findById(String index, String id) throws IOException
findById
in interface IndexProvider
IOException
public void rename(String index, String id, KObject to)
rename
in interface IndexProvider
public long getIndexSize(String index)
getIndexSize
in interface IndexProvider
public List<KObject> findByQuery(List<String> indices, org.apache.lucene.search.Query query, int limit)
findByQuery
in interface IndexProvider
public List<KObject> findByQuery(List<String> indices, org.apache.lucene.search.Query query, org.apache.lucene.search.Sort sort, int limit)
findByQuery
in interface IndexProvider
protected Optional<org.elasticsearch.action.search.SearchResponse> findByQueryRaw(List<String> indices, org.apache.lucene.search.Query query, org.apache.lucene.search.Sort sort, int limit)
protected void addSort(org.elasticsearch.search.builder.SearchSourceBuilder searchSourceBuilder, org.apache.lucene.search.SortField sortField)
public long findHitsByQuery(List<String> indices, org.apache.lucene.search.Query query)
findHitsByQuery
in interface IndexProvider
public List<String> getIndices()
getIndices
in interface IndexProvider
public void putMapping(String index, String type, MetaObject metaObject)
public Optional<org.elasticsearch.cluster.metadata.MappingMetaData> getMapping(String index, String type)
public void putMapping(String index, String type, List<MetaProperty> metaProperties)
protected String createElasticType(MetaProperty metaProperty)
public void dispose()
dispose
in interface org.uberfire.commons.lifecycle.Disposable
Copyright © 2012–2019 JBoss by Red Hat. All rights reserved.