Examples of percolate()


Examples of org.elasticsearch.action.admin.indices.stats.IndicesStatsRequest.percolate()

            indicesStatsRequest.refresh(metrics.contains("refresh"));
            indicesStatsRequest.flush(metrics.contains("flush"));
            indicesStatsRequest.warmer(metrics.contains("warmer"));
            indicesStatsRequest.filterCache(metrics.contains("filter_cache"));
            indicesStatsRequest.idCache(metrics.contains("id_cache"));
            indicesStatsRequest.percolate(metrics.contains("percolate"));
            indicesStatsRequest.segments(metrics.contains("segments"));
            indicesStatsRequest.fieldData(metrics.contains("fielddata"));
            indicesStatsRequest.completion(metrics.contains("completion"));
            indicesStatsRequest.suggest(metrics.contains("suggest"));
            indicesStatsRequest.queryCache(metrics.contains("query_cache"));
View Full Code Here

Examples of org.elasticsearch.action.index.IndexRequest.percolate()

        // TODO: this caused issues, do we need it?
        // indexRequest.version(RestActions.parseVersion(request));
        // indexRequest.versionType(VersionType.fromString(request.param("version_type"),
        // indexRequest.versionType()));

        indexRequest.percolate(request.param("percolate", null));
        indexRequest.opType(IndexRequest.OpType.INDEX);

        // TODO: force creation of index, do we need it?
        // indexRequest.create(true);
View Full Code Here

Examples of org.elasticsearch.action.index.IndexRequest.percolate()

                    if (op.parsedDoc().mappersAdded()) {
                        updateMappingOnMaster(indexRequest);
                    }

                    // if we are going to percolate, then we need to keep this op for the postPrimary operation
                    if (Strings.hasLength(indexRequest.percolate())) {
                        if (ops == null) {
                            ops = new Engine.IndexingOperation[request.items().length];
                        }
                        ops[i] = op;
                    }
View Full Code Here

Examples of org.elasticsearch.action.index.IndexRequest.percolate()

            if (op == null) {
                continue; // failed / no matches requested
            }
            if (itemRequest.request() instanceof IndexRequest) {
                IndexRequest indexRequest = (IndexRequest) itemRequest.request();
                if (!Strings.hasLength(indexRequest.percolate())) {
                    continue;
                }
                try {
                    PercolatorExecutor.Response percolate = indexService.percolateService().percolate(new PercolatorExecutor.DocAndSourceQueryRequest(op.parsedDoc(), indexRequest.percolate()));
                    ((IndexResponse) itemResponse.response()).matches(percolate.matches());
View Full Code Here

Examples of org.elasticsearch.action.index.IndexRequest.percolate()

                IndexRequest indexRequest = (IndexRequest) itemRequest.request();
                if (!Strings.hasLength(indexRequest.percolate())) {
                    continue;
                }
                try {
                    PercolatorExecutor.Response percolate = indexService.percolateService().percolate(new PercolatorExecutor.DocAndSourceQueryRequest(op.parsedDoc(), indexRequest.percolate()));
                    ((IndexResponse) itemResponse.response()).matches(percolate.matches());
                } catch (Exception e) {
                    logger.warn("failed to percolate [{}]", e, itemRequest.request());
                }
            }
View Full Code Here

Examples of org.elasticsearch.action.index.IndexRequest.percolate()

        indexRequest.source(request.contentByteArray(), request.contentByteArrayOffset(), request.contentLength(), request.contentUnsafe());
        indexRequest.timeout(request.paramAsTime("timeout", IndexRequest.DEFAULT_TIMEOUT));
        indexRequest.refresh(request.paramAsBoolean("refresh", indexRequest.refresh()));
        indexRequest.version(RestActions.parseVersion(request));
        indexRequest.versionType(VersionType.fromString(request.param("version_type"), indexRequest.versionType()));
        indexRequest.percolate(request.param("percolate", null));
        String sOpType = request.param("op_type");
        if (sOpType != null) {
            if ("index".equals(sOpType)) {
                indexRequest.opType(IndexRequest.OpType.INDEX);
            } else if ("create".equals(sOpType)) {
View Full Code Here

Examples of org.elasticsearch.action.index.IndexRequest.percolate()

    // TODO: this caused issues, do we need it?
    // indexRequest.version(RestActions.parseVersion(request));
    // indexRequest.versionType(VersionType.fromString(request.param("version_type"),
    // indexRequest.versionType()));

    indexRequest.percolate(request.param("percolate", null));
    indexRequest.opType(IndexRequest.OpType.INDEX);

    // TODO: force creation of index, do we need it?
    // indexRequest.create(true);
View Full Code Here

Examples of org.elasticsearch.index.percolator.PercolatorExecutor.percolate()

                .field("field2", "value")
                .field("field3", "the quick brown fox jumped over the lazy dog")
                .endObject().endObject();
        final byte[] source = doc.copiedBytes();

        PercolatorExecutor.Response percolate = percolatorExecutor.percolate(new PercolatorExecutor.SourceRequest("type1", source));

        for (int i = 0; i < NUMBER_OF_QUERIES; i++) {
            percolatorExecutor.addQuery("test" + i, termQuery("field3", "quick"));
        }
View Full Code Here

Examples of org.elasticsearch.index.percolator.PercolatorExecutor.percolate()

        System.out.println("Warming Up (1000)");
        StopWatch stopWatch = new StopWatch().start();
        System.out.println("Running " + 1000);
        for (long i = 0; i < 1000; i++) {
            percolate = percolatorExecutor.percolate(new PercolatorExecutor.SourceRequest("type1", source));
        }
        System.out.println("[Warmup] Percolated in " + stopWatch.stop().totalTime() + " TP Millis " + (NUMBER_OF_ITERATIONS / stopWatch.totalTime().millisFrac()));

        System.out.println("Percolating using " + NUMBER_OF_THREADS + " threads with " + NUMBER_OF_ITERATIONS + " iterations, and " + NUMBER_OF_QUERIES + " queries");
        final CountDownLatch latch = new CountDownLatch(NUMBER_OF_THREADS);
View Full Code Here

Examples of org.elasticsearch.index.percolator.PercolatorExecutor.percolate()

        Thread[] threads = new Thread[NUMBER_OF_THREADS];
        for (int i = 0; i < threads.length; i++) {
            threads[i] = new Thread(new Runnable() {
                @Override public void run() {
                    for (long i = 0; i < NUMBER_OF_ITERATIONS; i++) {
                        PercolatorExecutor.Response percolate = percolatorExecutor.percolate(new PercolatorExecutor.SourceRequest("type1", source));
                    }
                    latch.countDown();
                }
            });
        }
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.