Examples of execute()


Examples of org.elasticsearch.client.action.bulk.BulkRequestBuilder.execute()

            BulkRequestBuilder request = client1.prepareBulk();
            for (int j = 0; j < BATCH; j++) {
                counter++;
                request.add(Requests.indexRequest("test").type("type1").id(Integer.toString(counter)).source(source(Integer.toString(counter), "test" + counter)));
            }
            BulkResponse response = request.execute().actionGet();
            if (response.hasFailures()) {
                System.err.println("failures...");
            }
            if (((i * BATCH) % 10000) == 0) {
                System.out.println("Indexed " + (i * BATCH) + " took " + stopWatch.stop().lastTaskTime());
View Full Code Here

Examples of org.elasticsearch.client.action.delete.DeleteRequestBuilder.execute()

    DeleteRequestBuilder drb = _elasticClient.prepareDelete(_sIndexName, _sIndexType, _id);
    if (null != sParentId) {
      drb.setRouting(sParentId);
    }
    drb.setConsistencyLevel(WriteConsistencyLevel.ONE);
    DeleteResponse dr = drb.execute().actionGet();
    return DeleteResponseUtils.isFound(dr);
   
  }//TESTED (including children)
   
  ///////////////////////////////////////////////////////////////////////////////////////
View Full Code Here

Examples of org.elasticsearch.client.action.get.GetRequestBuilder.execute()

  public Map<String, GetField> getDocument(String _id, String... sFields) {
    GetRequestBuilder grb = _elasticClient.prepareGet(_sIndexName, _sIndexType, _id);
    if (null != sFields) {
      grb.setFields(sFields);
    }
    GetResponse gr = grb.execute().actionGet();
    Map<String, GetField> fieldsMap = gr.getFields();
    if (null != fieldsMap) {
      if (fieldsMap.isEmpty()) {
        fieldsMap = null;
      }
View Full Code Here

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

         
        }
      }
      // insert the document into elasticsearch
      response.setSource(mp);
      response.execute();
     
  }

  @Override
  public void close() throws IOException {
View Full Code Here

Examples of org.elasticsearch.client.action.search.SearchRequestBuilder.execute()

                        builder.setFrom(size / 2);
                    }
                    String value = nextFieldValue();
                    builder.setQuery(termQuery("field", value));
                    searchCounter.incrementAndGet();
                    SearchResponse searchResponse = builder.execute().actionGet();
                    if (searchResponse.failedShards() > 0) {
                        logger.warn("failed search " + Arrays.toString(searchResponse.shardFailures()));
                    }
                    // verify that all come from the requested index
                    for (SearchHit hit : searchResponse.hits()) {
View Full Code Here

Examples of org.elfinder.servlets.commands.AbstractCommand.execute()

      }

      // prepare command and run
      AbstractCommand command = prepareCommand((String) requestParams.get("cmd"), request, response, config);
      try {
        command.execute();
      } catch (ConnectorException e) {
        logger.warn("command returned an error", e);
        putResponse("error", e.getMessage());
      }
View Full Code Here

Examples of org.encog.engine.opencl.EncogCLQueue.execute()

      queue.array2Buffer(this.tempDataArray, this.tempDataInBuffer);
      queue.array2Buffer(this.gradients, this.gradientInBuffer);
      queue.array2Buffer(this.paramArray, this.paramBuffer);

      // Execute the kernel
      queue.execute(this);
      queue.waitFinish();

      // Read the results
      queue.buffer2Array(this.errorBuffer, this.errors);
      queue.buffer2Array(this.weightOutArrayBuffer, this.weightOutArray);
View Full Code Here

Examples of org.encog.ml.bayesian.query.BayesianQuery.execute()

      q.setEventValue(event, parsedEvent.resolveValue(event));
    }
   
    q.locateEventTypes();
   
    q.execute();
    return q.getProbability();
  }

  /**
   * {@inheritDoc}
 
View Full Code Here

Examples of org.encog.ml.bayesian.query.enumerate.EnumerationQuery.execute()

      query.setEventValue(event, true);
      index++;
    }

    //query.setSampleSize(100000000);
    query.execute();
    return query.getProbability();   
  }
 
  public void test(String message) {
    double d = probabilitySpam(message);
View Full Code Here

Examples of org.encog.ml.bayesian.query.sample.SamplingQuery.execute()

    SamplingQuery query = new SamplingQuery(network);
    query.defineEventType(a, EventType.Evidence);
    query.defineEventType(b, EventType.Outcome);
    query.setEventValue(b, true);
    query.setEventValue(a, true);
    query.execute();
    testPercent(query.getProbability(),20);
  }
 
  public void testSampling2() {
    BayesianNetwork network = new BayesianNetwork();
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.