Package com.dotcms.content.elasticsearch.util

Examples of com.dotcms.content.elasticsearch.util.ESClient


    }

    public void closeIndex(String indexName) {
      AdminLogger.log(this.getClass(), "closeIndex", "Trying to close index: " + indexName);
     
        Client client=new ESClient().getClient();
        client.admin().indices().close(new CloseIndexRequest(indexName)).actionGet();
       
        AdminLogger.log(this.getClass(), "closeIndex", "Index: " + indexName + " closed");
    }
View Full Code Here


    }

    public void openIndex(String indexName) {
      AdminLogger.log(this.getClass(), "openIndex", "Trying to open index: " + indexName);
     
        Client client=new ESClient().getClient();
        client.admin().indices().open(new OpenIndexRequest(indexName)).actionGet();
       
        AdminLogger.log(this.getClass(), "openIndex", "Index: " + indexName + " opened");
    }
View Full Code Here

       
        AdminLogger.log(this.getClass(), "openIndex", "Index: " + indexName + " opened");
    }

    public List<String> getClosedIndexes() {
        Client client=new ESClient().getClient();
        Map<String,IndexMetaData> indexState=client.admin().cluster().prepareState().execute().actionGet()
                                                           .getState().getMetaData().indices();
        List<String> closeIdx=new ArrayList<String>();
        for(String idx : indexState.keySet()) {
            IndexMetaData idxM=indexState.get(idx);
View Full Code Here

   * @throws ElasticSearchException
   * @throws IOException
   */
    public  boolean putMapping(String indexName, String type, String mapping) throws ElasticSearchException, IOException{

      ListenableActionFuture<PutMappingResponse> lis = new ESClient().getClient().admin().indices().preparePutMapping().setIndices(indexName).setType(type).setSource(mapping).execute();
      return lis.actionGet().isAcknowledged();
    }
View Full Code Here

   * @return
   * @throws ElasticSearchException
   * @throws IOException
   */
    public  boolean putMapping(String indexName, String type, String mapping, String settings) throws ElasticSearchException, IOException{
      ListenableActionFuture<PutMappingResponse> lis = new ESClient().getClient().admin().indices().preparePutMapping().setIndices(indexName).setType(type).setSource(mapping).execute();
      return lis.actionGet().isAcknowledged();
    }
View Full Code Here

      ListenableActionFuture<PutMappingResponse> lis = new ESClient().getClient().admin().indices().preparePutMapping().setIndices(indexName).setType(type).setSource(mapping).execute();
      return lis.actionGet().isAcknowledged();
    }

    public  boolean setSettings(String indexName,   String settings) throws ElasticSearchException, IOException{
      new ESClient().getClient().admin().indices().prepareUpdateSettings().setSettings(settings).setIndices( indexName).execute().actionGet();
      return true;
    }
View Full Code Here

     * @throws ElasticSearchException
     * @throws IOException
     */
    public  String getMapping(String index, String type) throws ElasticSearchException, IOException{

      return new ESClient().getClient().admin().cluster().state(new ClusterStateRequest())
        .actionGet().getState().metaData().indices()
        .get(index).mapping(type).source().string();

    }
View Full Code Here

    public void setPermissionAPI(PermissionAPI permissionAPI) {
        this.permissionAPI = permissionAPI;
    }

    public void destroy() {
      new ESClient().shutDownNode();
        Logger.info(this, "dotCMS shutting down");


    }
View Full Code Here

  private LanguageAPI langAPI = APILocator.getLanguageAPI();

  private static final Contentlet cache404Content= new Contentlet();
  private static final String CACHE_404_CONTENTLET="CACHE_404_CONTENTLET";
  public ESContentFactoryImpl() {
    client = new ESClient();
    cache404Content.setInode(CACHE_404_CONTENTLET);
  }
View Full Code Here

  }

  @Override
  protected Contentlet findContentletByIdentifier(String identifier, Boolean live, Long languageId) throws DotDataException {
    try {
      Client client = new ESClient().getClient();

      StringWriter sw= new StringWriter();
      sw.append(" +identifier:" + identifier);
      sw.append(" +languageid:" + languageId);
      sw.append(" +deleted:false");
View Full Code Here

TOP

Related Classes of com.dotcms.content.elasticsearch.util.ESClient

Copyright © 2018 www.massapicom. 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.