Examples of prepareMultiGet()


Examples of org.elasticsearch.client.Client.prepareMultiGet()

                    Set<String> ids = Sets.newHashSet();
                    for (int i = 0; i < MGET_BATCH; i++) {
                        ids.add(Integer.toString(ThreadLocalRandom.current().nextInt(NUMBER_OF_DOCS)));
                    }
                    //System.out.println("---> mget for [" + ids.size() + "]");
                    MultiGetResponse response = client.prepareMultiGet().add("test", "type", ids).execute().actionGet();
                    int expected = ids.size();
                    int count = 0;
                    for (MultiGetItemResponse item : response) {
                        count++;
                        if (item.failed()) {
View Full Code Here

Examples of org.elasticsearch.client.Client.prepareMultiGet()

       
    // But Clint is definitley unique
    assertEquals(1L, client.prepareSearch("ldapserver0").setTypes("person").setQuery(QueryBuilders.fieldQuery("name", "clint")).execute().actionGet().getHits().totalHits());

    assertEquals(1L, client.prepareSearch("ldapserver0").setTypes("person").setQuery(QueryBuilders.queryString("woo")).execute().actionGet().getHits().totalHits());
    assertEquals(2, client.prepareMultiGet().add("ldapserver0", "person", "christopher").add("ldapserver0", "person", "john").execute().actionGet().getResponses().length);
    }
 
  @After
  public void tearDown(){
    node.close();
View Full Code Here

Examples of org.sonar.server.search.SearchClient.prepareMultiGet()

  public void with_profiling_basic() {
    Profiling profiling = new Profiling(new Settings().setProperty(Profiling.CONFIG_PROFILING_LEVEL, Profiling.Level.BASIC.name()));
    SearchClient searchClient = new SearchClient(new Settings(), profiling);

    try {
      MultiGetRequestBuilder request = searchClient.prepareMultiGet();
      request.add(new MultiGetRequest.Item(IndexDefinition.RULE.getIndexName(), IndexDefinition.RULE.getIndexType(), "ruleKey")
        .fetchSourceContext(FetchSourceContext.FETCH_SOURCE));
      request.get();

      // expected to fail because elasticsearch is not correctly configured, but that does not matter
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.