Package com.dotcms.repackage.org.elasticsearch.action.index

Examples of com.dotcms.repackage.org.elasticsearch.action.index.IndexRequest


            try {
                if(con.isWorking()) {
                    mapping=gson.toJson(mappingAPI.toMap(con));
                   
                    if(!reindexOnly)
                        req.add(new IndexRequest(info.working, "content", id)
                                    .source(mapping));
                    if(info.reindex_working!=null)
                        req.add(new IndexRequest(info.reindex_working, "content", id)
                                    .source(mapping));
                }
   
                if(con.isLive()) {
                    if(mapping==null)
                        mapping=gson.toJson(mappingAPI.toMap(con));
                   
                    if(!reindexOnly)
                        req.add(new IndexRequest(info.live, "content", id)
                                .source(mapping));
                    if(info.reindex_live!=null)
                        req.add(new IndexRequest(info.reindex_live, "content", id)
                                .source(mapping));
                }
            }
            catch(DotMappingException ex) {
                Logger.error(this, "Can't get a mapping for contentlet with id_lang:"+id+" Content data: "+con.getMap(), ex);
View Full Code Here


                  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());
                    if (id != null)
                        req.add(new IndexRequest(index, type, id).source(json));
                  }
              }
                if(req.numberOfActions()>0) {
                    req.execute().actionGet();
                    //client.admin().indices().flush(new FlushRequest(index)).actionGet();
View Full Code Here

TOP

Related Classes of com.dotcms.repackage.org.elasticsearch.action.index.IndexRequest

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.