public class ElasticSearchHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
SECURITY_FIELD |
| Constructor and Description |
|---|
ElasticSearchHelper() |
| Modifier and Type | Method and Description |
|---|---|
static void |
clearIndex(org.elasticsearch.client.Client client,
String indexName,
String indexTypeName) |
static Long |
collectionDocumentsCountElasticSearch(org.elasticsearch.client.Client client,
String indexName,
String collectionID) |
static Boolean |
collectionExists(org.elasticsearch.client.Client client,
String indexName,
String collID) |
static void |
commit(org.elasticsearch.client.Client client,
String indexName) |
static org.elasticsearch.common.xcontent.XContentBuilder |
createJSONObject(Map<String,? extends Object> keyValues) |
static String |
createKnownHostsString(Map<String,Integer> hosts) |
static boolean |
delete(org.elasticsearch.client.Client client,
String indexName) |
static Boolean |
deleteCollection(org.elasticsearch.client.Client client,
String indexName,
String collID) |
static Boolean |
deleteCollections(org.elasticsearch.client.Client client,
String indexName,
Collection<String> colls) |
static void |
deleteDocuments(org.elasticsearch.client.Client client,
String indexName,
List<String> docIDs) |
static Set<String> |
getAllCollectionsOfIndex(org.elasticsearch.client.Client client,
String indexName) |
static Set<String> |
getIndicesOfAlias(org.elasticsearch.client.Client client,
String alias) |
static List<org.elasticsearch.action.get.MultiGetItemResponse> |
getMultipleDocuments(org.elasticsearch.client.Client client,
Set<String> indices,
Collection<String> docIDs) |
static List<org.elasticsearch.action.get.MultiGetItemResponse> |
getMultipleDocumentsOfAlias(org.elasticsearch.client.Client client,
String alias,
Collection<String> docIDs) |
static org.elasticsearch.action.search.SearchResponse |
getNextSearchResponse(org.elasticsearch.client.Client client,
org.elasticsearch.action.search.SearchResponse scrollResponse) |
static Set<String> |
indicesOfCollection(org.elasticsearch.client.Client client,
String indexName,
String collID) |
static void |
insertBulk(org.elasticsearch.action.bulk.BulkRequestBuilder bulkRequest,
String jsonDoc,
org.elasticsearch.client.Client indexClient,
String indexName,
String indexType,
Set<String> allowedIndexTypes) |
static int |
insertRowSet(org.elasticsearch.action.bulk.BulkRequestBuilder bulkRequest,
org.elasticsearch.client.Client client,
String indexName,
org.gcube.indexmanagement.common.FullTextIndexType idxType,
Set<String> allowedIndexTypes,
String rowsetXML,
Set<String> securityIdentifiers) |
static void |
insertSimple(String jsonDoc,
org.elasticsearch.client.Client indexClient,
String indexName,
String indexType,
Set<String> allowedIndexTypes) |
static Long |
queryCountElasticSearch(org.elasticsearch.client.Client client,
String indexName,
String queryString) |
static org.elasticsearch.search.SearchHit[] |
queryElasticSearch(org.elasticsearch.client.Client client,
String indexName,
String queryString,
int maxHits,
int from,
List<String> projections) |
static org.elasticsearch.search.SearchHit[] |
queryElasticSearch(org.elasticsearch.client.Client client,
String indexName,
String queryString,
int maxHits,
List<String> projections) |
static org.elasticsearch.search.SearchHit[] |
queryElasticSearch(org.elasticsearch.client.Client client,
String indexName,
String queryString,
int maxHits,
List<String> highlightedFields,
List<String> projections,
int maxFragmentSize,
int maxFragmentCnt,
int from) |
static org.elasticsearch.action.search.SearchResponse |
queryElasticSearchScroll(org.elasticsearch.client.Client client,
String indexName,
String queryString,
int maxHits,
List<String> projections) |
static org.elasticsearch.action.search.SearchResponse |
queryElasticSearchScroll(org.elasticsearch.client.Client client,
String indexName,
String queryString,
int maxHits,
List<String> highlightedFields,
List<String> projections,
int maxFragmentSize,
int maxFragmentCnt) |
public static final String SECURITY_FIELD
public static void commit(org.elasticsearch.client.Client client,
String indexName)
public static org.elasticsearch.search.SearchHit[] queryElasticSearch(org.elasticsearch.client.Client client,
String indexName,
String queryString,
int maxHits,
List<String> projections)
public static org.elasticsearch.search.SearchHit[] queryElasticSearch(org.elasticsearch.client.Client client,
String indexName,
String queryString,
int maxHits,
int from,
List<String> projections)
public static org.elasticsearch.search.SearchHit[] queryElasticSearch(org.elasticsearch.client.Client client,
String indexName,
String queryString,
int maxHits,
List<String> highlightedFields,
List<String> projections,
int maxFragmentSize,
int maxFragmentCnt,
int from)
public static org.elasticsearch.action.search.SearchResponse queryElasticSearchScroll(org.elasticsearch.client.Client client,
String indexName,
String queryString,
int maxHits,
List<String> projections)
public static org.elasticsearch.action.search.SearchResponse queryElasticSearchScroll(org.elasticsearch.client.Client client,
String indexName,
String queryString,
int maxHits,
List<String> highlightedFields,
List<String> projections,
int maxFragmentSize,
int maxFragmentCnt)
public static Long collectionDocumentsCountElasticSearch(org.elasticsearch.client.Client client, String indexName, String collectionID)
public static Long queryCountElasticSearch(org.elasticsearch.client.Client client, String indexName, String queryString)
public static org.elasticsearch.action.search.SearchResponse getNextSearchResponse(org.elasticsearch.client.Client client,
org.elasticsearch.action.search.SearchResponse scrollResponse)
public static boolean delete(org.elasticsearch.client.Client client,
String indexName)
public static void deleteDocuments(org.elasticsearch.client.Client client,
String indexName,
List<String> docIDs)
public static Boolean deleteCollections(org.elasticsearch.client.Client client, String indexName, Collection<String> colls)
public static Boolean deleteCollection(org.elasticsearch.client.Client client, String indexName, String collID)
public static Boolean collectionExists(org.elasticsearch.client.Client client, String indexName, String collID)
public static Set<String> indicesOfCollection(org.elasticsearch.client.Client client, String indexName, String collID)
public static Set<String> getIndicesOfAlias(org.elasticsearch.client.Client client, String alias)
public static List<org.elasticsearch.action.get.MultiGetItemResponse> getMultipleDocumentsOfAlias(org.elasticsearch.client.Client client, String alias, Collection<String> docIDs)
public static List<org.elasticsearch.action.get.MultiGetItemResponse> getMultipleDocuments(org.elasticsearch.client.Client client, Set<String> indices, Collection<String> docIDs)
public static Set<String> getAllCollectionsOfIndex(org.elasticsearch.client.Client client, String indexName)
public static void clearIndex(org.elasticsearch.client.Client client,
String indexName,
String indexTypeName)
public static void insertSimple(String jsonDoc, org.elasticsearch.client.Client indexClient, String indexName, String indexType, Set<String> allowedIndexTypes) throws org.elasticsearch.ElasticSearchException, IOException
org.elasticsearch.ElasticSearchExceptionIOExceptionpublic static void insertBulk(org.elasticsearch.action.bulk.BulkRequestBuilder bulkRequest,
String jsonDoc,
org.elasticsearch.client.Client indexClient,
String indexName,
String indexType,
Set<String> allowedIndexTypes)
throws org.elasticsearch.ElasticSearchException,
IOException
org.elasticsearch.ElasticSearchExceptionIOExceptionpublic static int insertRowSet(org.elasticsearch.action.bulk.BulkRequestBuilder bulkRequest,
org.elasticsearch.client.Client client,
String indexName,
org.gcube.indexmanagement.common.FullTextIndexType idxType,
Set<String> allowedIndexTypes,
String rowsetXML,
Set<String> securityIdentifiers)
public static org.elasticsearch.common.xcontent.XContentBuilder createJSONObject(Map<String,? extends Object> keyValues) throws IOException
IOExceptionCopyright © 2014. All Rights Reserved.