Examples of TermlistRequest


Examples of org.xbib.elasticsearch.action.termlist.TermlistRequest

        controller.registerHandler(GET, "/{index}/_termlist", this);
        controller.registerHandler(GET, "/{index}/{field}/_termlist", this);
    }

    public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {
        TermlistRequest termlistRequest = new TermlistRequest(
                Strings.splitStringByCommaToArray(request.param("index")));
        termlistRequest.setField(request.param("field"));
        termlistRequest.setTerm(request.param("term"));
        termlistRequest.setFrom(request.paramAsInt("from", 0));
        termlistRequest.setSize(request.paramAsInt("size", 0));
        termlistRequest.setWithDocFreq(request.paramAsBoolean("docfreqs", false));
        termlistRequest.setWithTotalFreq(request.paramAsBoolean("totalfreqs", false));
        termlistRequest.sortByDocFreq(request.paramAsBoolean("sortbydocfreqs", false));
        termlistRequest.sortByTotalFreq(request.paramAsBoolean("sortbytotalfreqs", false));
        termlistRequest.sortByTerm(request.paramAsBoolean("sortbyterms", false));
        client.execute(TermlistAction.INSTANCE, termlistRequest, new RestBuilderListener<TermlistResponse>(channel) {
            @Override
            public RestResponse buildResponse(TermlistResponse response, XContentBuilder builder) throws Exception {
                builder.startObject();
                buildBroadcastShardsHeader(builder, response);
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.