Package com.dotcms.content.elasticsearch.business.IndiciesAPI

Examples of com.dotcms.content.elasticsearch.business.IndiciesAPI.IndiciesInfo


    public void fullReindexAbort() {
        try {
            if(!isInFullReindex()) return;

            IndiciesInfo info=APILocator.getIndiciesAPI().loadIndicies();

            final String rew=info.reindex_working;
            final String rel=info.reindex_live;

            IndiciesInfo newinfo=new IndiciesInfo();
            newinfo.working=info.working;
            newinfo.live=info.live;
            APILocator.getIndiciesAPI().point(newinfo);

            iapi.moveIndexBackToCluster(rew);
View Full Code Here


        return indexes;
    }

    public void activateIndex(String indexName) throws DotDataException {
        IndiciesInfo info=APILocator.getIndiciesAPI().loadIndicies();
        IndiciesInfo newinfo=new IndiciesInfo();
        newinfo.working=info.working;
        newinfo.live=info.live;
        newinfo.reindex_working=info.reindex_working;
        newinfo.reindex_live=info.reindex_live;
        newinfo.site_search=info.site_search;
View Full Code Here

        }
        APILocator.getIndiciesAPI().point(newinfo);
    }

    public void deactivateIndex(String indexName) throws DotDataException, IOException {
        IndiciesInfo info=APILocator.getIndiciesAPI().loadIndicies();
        IndiciesInfo newinfo=new IndiciesInfo();
        newinfo.working=info.working;
        newinfo.live=info.live;
        newinfo.reindex_working=info.reindex_working;
        newinfo.reindex_live=info.reindex_live;
        newinfo.site_search=info.site_search;
View Full Code Here



    public synchronized List<String> getCurrentIndex() throws DotDataException {
        List<String> newIdx = new ArrayList<String>();
        IndiciesInfo info=APILocator.getIndiciesAPI().loadIndicies();
        newIdx.add(info.working);
        newIdx.add(info.live);
        return newIdx;
    }
View Full Code Here

        return newIdx;
    }

    public synchronized List<String> getNewIndex() throws DotDataException {
        List<String> newIdx = new ArrayList<String>();
        IndiciesInfo info=APILocator.getIndiciesAPI().loadIndicies();
        if(info.reindex_working!=null)
            newIdx.add(info.reindex_working);
        if(info.reindex_live!=null)
            newIdx.add(info.reindex_live);
        return newIdx;
View Full Code Here

            return two.compareTo(one);
        }
    }

    public String getActiveIndexName(String type) throws DotDataException {
        IndiciesInfo info=APILocator.getIndiciesAPI().loadIndicies();
        if(type.equalsIgnoreCase(ES_WORKING_INDEX_NAME)) {
           return info.working;
        }
        else if(type.equalsIgnoreCase(ES_LIVE_INDEX_NAME)) {
           return info.live;
View Full Code Here

    public IndiciesInfo loadIndicies() throws DotDataException {
        return loadIndicies(DbConnectionFactory.getConnection());
    }
   
    public IndiciesInfo loadIndicies(Connection conn) throws DotDataException {
        IndiciesInfo info=cache.get();
        if(info==null) {
          //build it once
          synchronized (this.getClass()) {
            if(conn == null){
              conn = DbConnectionFactory.getConnection();
            }
            info=cache.get();
            if(info==null) {
                info=new IndiciesInfo();
                DotConnect dc = new DotConnect();
                dc.setSQL("SELECT index_name,index_type FROM indicies");
                List<Map<String,Object>> results=dc.loadResults(conn);
                for(Map<String,Object> rr : results) {
                    String name=(String)rr.get("index_name");
View Full Code Here

        }
       
    }
   
    public synchronized static String currentIndexPath() throws DotDataException {
        IndiciesInfo info=APILocator.getIndiciesAPI().loadIndicies();
        return "["+info.working+","+info.live+"]";
    }
View Full Code Here

        IndiciesInfo info=APILocator.getIndiciesAPI().loadIndicies();
        return "["+info.working+","+info.live+"]";
    }
   
    public synchronized static String getNewIndexPath() throws DotDataException {
        IndiciesInfo info=APILocator.getIndiciesAPI().loadIndicies();
        return "["+info.reindex_working+","+info.reindex_live+"]";
    }
View Full Code Here

      sw.append(" +languageid:" + languageId);
      sw.append(" +deleted:false");

      SearchRequestBuilder request = createRequest(client, sw.toString());

      IndiciesInfo info=APILocator.getIndiciesAPI().loadIndicies();
      SearchResponse response = request.setIndices((live ? info.live : info.working))
              .addFields("inode","identifier").execute().actionGet();
      SearchHits hits = response.getHits();
      Contentlet contentlet = find(hits.getAt(0).field("inode").getValue().toString());
      return contentlet;
View Full Code Here

TOP

Related Classes of com.dotcms.content.elasticsearch.business.IndiciesAPI.IndiciesInfo

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.