Package org.elasticsearch.action.termvector

Examples of org.elasticsearch.action.termvector.TermVectorRequest


        return mltQuery;
    }

    private TermVectorRequest parseDocument(XContentParser parser) throws IOException {
        TermVectorRequest termVectorRequest = newTermVectorRequest();
        TermVectorRequest.parseRequest(termVectorRequest, parser);
        return termVectorRequest;
    }
View Full Code Here


            throw new ElasticsearchIllegalArgumentException("Content of 'like' parameter should either be a string or an object");
        }
    }

    private TermVectorRequest newTermVectorRequest() {
        return new TermVectorRequest()
                .positions(false)
                .offsets(false)
                .payloads(false)
                .fieldStatistics(false)
                .termStatistics(false);
View Full Code Here

    @Override
    public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) throws Exception {
        MultiTermVectorsRequest multiTermVectorsRequest = new MultiTermVectorsRequest();
        multiTermVectorsRequest.listenerThreaded(false);
        TermVectorRequest template = new TermVectorRequest();
        template.index(request.param("index"));
        template.type(request.param("type"));
        RestTermVectorAction.readURIParameters(template, request);
        multiTermVectorsRequest.ids(Strings.commaDelimitedListToStringArray(request.param("ids")));
        multiTermVectorsRequest.add(template, RestActions.getRestContent(request));

        client.multiTermVectors(multiTermVectorsRequest, new RestToXContentListener<MultiTermVectorsResponse>(channel));
View Full Code Here

        controller.registerHandler(POST, "/{index}/{type}/{id}/_termvector", this);
    }

    @Override
    public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) throws Exception {
        TermVectorRequest termVectorRequest = new TermVectorRequest(request.param("index"), request.param("type"), request.param("id"));
        XContentParser parser = null;
        if (request.hasContent()) {
            try {
                parser = XContentFactory.xContent(request.content()).createParser(request.content());
                TermVectorRequest.parseRequest(termVectorRequest, parser);
View Full Code Here

    @Test
    public void testTermVector() {
        String termVectorShardAction = TermVectorAction.NAME + "[s]";
        interceptTransportActions(termVectorShardAction);

        TermVectorRequest termVectorRequest = new TermVectorRequest(randomIndexOrAlias(), "type", "id");
        internalCluster().clientNodeClient().termVector(termVectorRequest).actionGet();

        clearInterceptedActions();
        assertSameIndices(termVectorRequest, termVectorShardAction);
    }
View Full Code Here

TOP

Related Classes of org.elasticsearch.action.termvector.TermVectorRequest

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.