Package com.dotcms.repackage.org.elasticsearch.client

Examples of com.dotcms.repackage.org.elasticsearch.client.Client.prepareBulk()


      Runnable indexAction=new Runnable() {
            public void run() {
                try {
                    Client client=new ESClient().getClient();
                    BulkRequestBuilder req = (bulk==null) ? client.prepareBulk() : bulk;

                    // http://jira.dotmarketing.net/browse/DOTCMS-6886
                    // check for related content to reindex
                    List<Contentlet> contentToIndex=new ArrayList<Contentlet>();
                    contentToIndex.add(content);
View Full Code Here


     Runnable indexRunner = new Runnable() {
              public void run() {
                try {
                    String id=content.getIdentifier()+"_"+content.getLanguageId();
                    Client client=new ESClient().getClient();
                    BulkRequestBuilder bulk=client.prepareBulk();
                    IndiciesInfo info=APILocator.getIndiciesAPI().loadIndicies();

                    bulk.add(client.prepareDelete(info.live, "content", id));
                    if(info.reindex_live!=null)
                        bulk.add(client.prepareDelete(info.reindex_live, "content", id));
View Full Code Here

          while (br.ready())
            jsons.add(br.readLine());

        if (jsons.size() > 0) {
            try {
                BulkRequestBuilder req = client.prepareBulk();
                for (String raw : jsons) {
                  int delimidx=raw.indexOf(JSON_RECORD_DELIMITER);
                  if(delimidx>0) {
                    String id = raw.substring(0, delimidx);
                    String json = raw.substring(delimidx + JSON_RECORD_DELIMITER.length(), raw.length());
View Full Code Here

      List<Contentlet> cons = capi.findByStructure(struct.getInode(), APILocator.getUserAPI().getSystemUser(), false, limit, offset);
      if (cons.size() == 0) {
        break;
      }
      Client client = new ESClient().getClient();
      BulkRequestBuilder bulkRequest = client.prepareBulk();
      for (Contentlet c : cons) {

        //bulkRequest.add(client.prepareIndex(ESIndexAPI.ES_INDEX_NAME, type, c.getInode()).setSource(
        //    new ESMappingAPIImpl().toJson(c)));
View Full Code Here

                }
          }
          else if(!remoteQ.isEmpty()) {
              wait=false;
              Client client=new ESClient().getClient();
            BulkRequestBuilder bulk=client.prepareBulk();
            final ArrayList<IndexJournal<String>> recordsToDelete=new ArrayList<IndexJournal<String>>();
            while(!remoteQ.isEmpty()) {
                  IndexJournal<String> idx = remoteQ.removeFirst();
                  writeDocumentToIndex(bulk,idx);
                    recordsToDelete.add(idx);
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.