Package org.elasticsearch.action.index

Examples of org.elasticsearch.action.index.IndexRequestBuilder.execute()


      IndexRequestBuilder irb = client().prepareIndex(appid,
          so.getType(), so.getId()).setSource(data);
      if (ttl > 0) {
        irb.setTTL(ttl);
      }
      irb.execute().actionGet();
      logger.debug("Search.index() {}", so.getId());
    } catch (Exception e) {
      logger.warn(null, e);
    }
  }
View Full Code Here


                        .setSource(docBuilder);
                //log.info("Executing document insert into index");
                if(client == null) {
                    log.error("Hey, client is null");
                }
                irb.execute().actionGet();
            }

        } catch (RuntimeException re) {
            log.error("RunTimer in ESL:\n" + ExceptionUtils.getStackTrace(re));
            throw re;
View Full Code Here

                        .setSource(docBuilder);
                //log.info("Executing document insert into index");
                if(client == null) {
                    log.error("Hey, client is null");
                }
                irb.execute().actionGet();
            }

        } catch (RuntimeException re) {
            log.error("RunTimer in ESL:\n" + ExceptionUtils.getStackTrace(re));
            throw re;
View Full Code Here

      IndexRequestBuilder request = typeMapping.indexRequest(client, indexName, _object);
      if (request == null) {
        throw new Esi4JObjectFilteredException(typeMapping, _object);
      } else {
        return request.execute();
      }
    }
  }

  private static final class Get implements Esi4JOperation<ListenableActionFuture<GetResponse>> {
View Full Code Here

      IndexRequestBuilder irb = client().prepareIndex(appid,
          so.getType(), so.getId()).setSource(data);
      if (ttl > 0) {
        irb.setTTL(ttl);
      }
      irb.execute().actionGet();
      logger.debug("Search.index() {}", so.getId());
    } catch (Exception e) {
      logger.warn(null, e);
    }
  }
View Full Code Here

      IndexRequestBuilder irb = client().prepareIndex(appid,
          so.getType(), so.getId()).setSource(data);
      if (ttl > 0) {
        irb.setTTL(ttl);
      }
      irb.execute().actionGet();
      logger.debug("Search.index() {}", so.getId());
    } catch (Exception e) {
      logger.warn(null, e);
    }
  }
View Full Code Here

      IndexRequestBuilder irb = client().prepareIndex(appid, so.getType(), so.getId()).
          setSource(data).setRouting(so.getShardKey());
      if (ttl > 0) {
        irb.setTTL(ttl);
      }
      irb.execute().actionGet();
      logger.debug("Search.index() {}", so.getId());
    } catch (Exception e) {
      logger.warn(null, e);
    }
  }
View Full Code Here

    private void canIndexDocument(String index) {
        try {
            IndexRequestBuilder builder = client().prepareIndex(index, "zzz");
            builder.setSource("foo", "bar");
            IndexResponse r = builder.execute().actionGet();
            assertThat(r, notNullValue());
        } catch (ClusterBlockException e) {
            fail();
        }
    }
View Full Code Here

    private void canNotIndexDocument(String index) {
        try {
            IndexRequestBuilder builder = client().prepareIndex(index, "zzz");
            builder.setSource("foo", "bar");
            builder.execute().actionGet();
            fail();
        } catch (ClusterBlockException e) {
            // all is well
        }
    }
View Full Code Here

      IndexRequestBuilder irb = client().prepareIndex(appid,
          so.getType(), so.getId()).setSource(data);
      if (ttl > 0) {
        irb.setTTL(ttl);
      }
      irb.execute().actionGet();
      logger.debug("Search.index() {}", so.getId());
    } catch (Exception e) {
      logger.warn(null, e);
    }
  }
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.