Package com.dotcms.content.elasticsearch.business

Examples of com.dotcms.content.elasticsearch.business.ContentletIndexAPI


    }
    }

    public void optimizeIndices() {
      validateUser();
        ContentletIndexAPI api=APILocator.getContentletIndexAPI();
        List<String> indices=api.listDotCMSIndices();
        api.optimize(indices);
    }
View Full Code Here


   
    response.getWriter().println(ESIndexResource.indexDocumentCount(indexName));
  }

  public void getNotActiveIndexNames(HttpServletRequest request, HttpServletResponse response) throws IOException {
    ContentletIndexAPI idxApi = APILocator.getContentletIndexAPI();
    List<String> indices = idxApi.listDotCMSIndices();
    List<String> inactives = new ArrayList<String>();

    for (String index : indices) {
      try {
        if(APILocator.getESIndexAPI().getIndexStatus(index) == ESIndexAPI.Status.INACTIVE) {
View Full Code Here

  public void getReindexThreadStatus(HttpServletRequest request, HttpServletResponse response) throws IOException {
    response.getWriter().println(ReindexThread.getInstance().isWorking()?"active":"stopped");
  }

  public void indexList(HttpServletRequest request, HttpServletResponse response) throws IOException {
        ContentletIndexAPI idxApi = APILocator.getContentletIndexAPI();
        response.getWriter().println(idxApi.listDotCMSIndices());       
    }
View Full Code Here

  @SuppressWarnings("unchecked")
  @Override
  void resetChildrenPermissionReferences(Structure structure) throws DotDataException {
      ContentletAPI contAPI = APILocator.getContentletAPI();
      ContentletIndexAPI indexAPI=new ESContentletIndexAPI();

      DotConnect dc = new DotConnect();
    dc.setSQL(deleteContentReferencesByStructureSQL);
    dc.addParam(structure.getPermissionId());
    dc.loadResult();

    final int limit=500;
    int offset=0;
    List<Contentlet> contentlets;
    do {
      String query="structurename:"+structure.getVelocityVarName();
      try {
          contentlets=contAPI.search(query, limit, offset, "identifier", APILocator.getUserAPI().getSystemUser(), false);
            } catch (DotSecurityException e) {
                throw new RuntimeException(e);
            }

      BulkRequestBuilder bulk=new ESClient().getClient().prepareBulk();
      for(Contentlet cont : contentlets) {
          permissionCache.remove(cont.getPermissionId());
          indexAPI.addContentToIndex(cont, false, true, true, bulk);
      }
      if(bulk.numberOfActions()>0)
          bulk.execute().actionGet();

      offset=offset+limit;
View Full Code Here

TOP

Related Classes of com.dotcms.content.elasticsearch.business.ContentletIndexAPI

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.