Examples of IndicesAdminClient


Examples of org.elasticsearch.client.IndicesAdminClient

        } catch (ElasticsearchException e) {
            // ok if the index didn't exist
        }

        // create mappings
        IndicesAdminClient admin = client.admin().indices();
        admin.prepareCreate(indexName).addMapping("doc", "x", "type=long", "y", "type=double");

        client.admin().cluster().prepareHealth(indexName).setWaitForGreenStatus().setTimeout("10s").execute().actionGet();
        return client;
    }
View Full Code Here

Examples of org.elasticsearch.client.IndicesAdminClient

     */
    public static boolean existsIndex(String indexName) {

        Client client = IndexClient.client;
        AdminClient admin = client.admin();
        IndicesAdminClient indices = admin.indices();
        IndicesExistsRequestBuilder indicesExistsRequestBuilder = indices.prepareExists(indexName);
        IndicesExistsResponse response = indicesExistsRequestBuilder.execute().actionGet();

        return response.isExists();
    }
View Full Code Here

Examples of org.elasticsearch.client.IndicesAdminClient

  private void createIndex(Site site) throws ContentRepositoryException,
      IOException {

    // Make sure the site index exists
    try {
      IndicesAdminClient indexAdmin = nodeClient.admin().indices();
      CreateIndexRequestBuilder siteIdxRequest = indexAdmin.prepareCreate(site.getIdentifier());
      logger.debug("Trying to create site index for '{}'", site.getIdentifier());
      CreateIndexResponse siteidxResponse = siteIdxRequest.execute().actionGet();
      if (!siteidxResponse.acknowledged()) {
        throw new ContentRepositoryException("Unable to create site index for '" + site.getIdentifier() + "'");
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.