Package org.elasticsearch

Examples of org.elasticsearch.ElasticSearchIllegalArgumentException


    }

    @Override
    public void handleRequest(final RestRequest request, final RestChannel channel) throws IOException {
        if (!request.hasContent()) {
            throw new ElasticsearchIllegalArgumentException("Error: please provide a list of words to populate the dictionary with");
        }

        HebrewAnalyzer.setCustomWords(request.content().streamInput());

        XContentBuilder builder = channel.newBuilder().startObject();
View Full Code Here


        AnalysisService analysisService = injector.getInstance(AnalysisService.class);

        String[] sub = settings.getAsArray("sub_analyzers");
        ArrayList<Analyzer> subAnalyzers = new ArrayList<Analyzer>();
        if (sub == null) {
            throw new ElasticsearchIllegalArgumentException("Analyzer ["+name+"] analyzer of type ["+NAME+"], must have a \"sub_analyzers\" list property");
        }

        for (String subname : sub) {
            NamedAnalyzer analyzer = analysisService.analyzer(subname);
            if (analyzer == null) {
View Full Code Here

            } else if (type == TransportRequestOptions.Type.BULK) {
                return bulk[Math.abs(bulkCounter.incrementAndGet()) % bulk.length];
            } else if (type == TransportRequestOptions.Type.RECOVERY) {
                return recovery[Math.abs(recoveryCounter.incrementAndGet()) % recovery.length];
            } else {
                throw new ElasticsearchIllegalArgumentException("no type channel for [" + type + "]");
            }
        }
View Full Code Here

    }

    @Override
    public BytesReference slice(int from, int length) {
        if (from < 0 || (from + length) > this.length) {
            throw new ElasticsearchIllegalArgumentException("can't slice a buffer with length [" + this.length + "], with slice parameters from [" + from + "], length [" + length + "]");
        }
        return new BytesArray(bytes, offset + from, length);
    }
View Full Code Here

        if (httpMethod == HttpMethod.OPTIONS) {
            return Method.OPTIONS;
        }

        throw new ElasticsearchIllegalArgumentException("unsupported method " + httpMethod.getName());
    }
View Full Code Here

    }

    @Override
    public BytesReference slice(int from, int length) {
        if (from < 0 || (from + length) > length()) {
            throw new ElasticsearchIllegalArgumentException("can't slice a buffer with length [" + length() + "], with slice parameters from [" + from + "], length [" + length + "]");
        }

        return new PagedBytesReference(bigarrays, bytearray, offset + from, length);
    }
View Full Code Here

        this.connectionsPerNodeState = componentSettings.getAsInt("connections_per_node.high", settings.getAsInt("transport.connections_per_node.state", 1));
        this.connectionsPerNodePing = componentSettings.getAsInt("connections_per_node.ping", settings.getAsInt("transport.connections_per_node.ping", 1));

        // we want to have at least 1 for reg/state/ping
        if (this.connectionsPerNodeReg == 0) {
            throw new ElasticsearchIllegalArgumentException("can't set [connection_per_node.reg] to 0");
        }
        if (this.connectionsPerNodePing == 0) {
            throw new ElasticsearchIllegalArgumentException("can't set [connection_per_node.ping] to 0");
        }
        if (this.connectionsPerNodeState == 0) {
            throw new ElasticsearchIllegalArgumentException("can't set [connection_per_node.state] to 0");
        }

        this.maxCumulationBufferCapacity = componentSettings.getAsBytesSize("max_cumulation_buffer_capacity", null);
        this.maxCompositeBufferComponents = componentSettings.getAsInt("max_composite_buffer_components", -1);
View Full Code Here

                                             @Assisted String name, @Assisted Settings settings) {
        super(index, indexSettings, name, settings);
        try {
            analyzer = new RussianAnalyzer();
        } catch (IOException ex) {
            throw new ElasticsearchIllegalArgumentException("Unable to load Russian morphology analyzer", ex);
        }
    }
View Full Code Here

    public RussianMorphologyTokenFilterFactory(Index index, @IndexSettings Settings indexSettings, String name, Settings settings) {
        super(index, indexSettings, name, settings);
        try {
            luceneMorph = new RussianLuceneMorphology();
        } catch (IOException ex) {
            throw new ElasticsearchIllegalArgumentException("Unable to load Russian morphology analyzer", ex);
        }
    }
View Full Code Here

                                             @Assisted String name, @Assisted Settings settings) {
        super(index, indexSettings, name, settings);
        try {
            analyzer = new EnglishAnalyzer();
        } catch (IOException ex) {
            throw new ElasticsearchIllegalArgumentException("Unable to load English morphology analyzer", ex);
        }
    }
View Full Code Here

TOP

Related Classes of org.elasticsearch.ElasticSearchIllegalArgumentException

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.