Package com.dotcms.content.elasticsearch.business

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


   * @throws DotSecurityException
   * @throws DotMappingException
   */
  public void migrateStructure(Structure struct) throws DotDataException, DotSecurityException, DotMappingException {
   
    new ESContentletIndexAPI().checkAndInitialiazeIndex();
   
   
    ContentletAPI capi = APILocator.getContentletAPI();

    String type = struct.getVelocityVarName();
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.ESContentletIndexAPI

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.