Examples of copyUTF8Bytes()


Examples of org.apache.lucene.util.CharsRefBuilder.copyUTF8Bytes()

            return "";
        }

        byte[] bytes = toBytes();
        final CharsRefBuilder ref = new CharsRefBuilder();
        ref.copyUTF8Bytes(bytes, offset, length);
        return ref.toString();
    }

    @Override
    public BytesRef toBytesRef() {
View Full Code Here

Examples of org.apache.lucene.util.CharsRefBuilder.copyUTF8Bytes()

        String strings = "";
        TermsEnum termsEnum = terms.iterator(null);
        CharsRefBuilder spare = new CharsRefBuilder();
        BytesRef text;
        while((text = termsEnum.next()) != null) {
            spare.copyUTF8Bytes(text);
            String term = spare.toString();
            strings += term;
        }
        return strings;
    }
View Full Code Here

Examples of org.apache.lucene.util.CharsRefBuilder.copyUTF8Bytes()

    public static ParsedScrollId parseScrollId(String scrollId) {
        CharsRefBuilder spare = new CharsRefBuilder();
        try {
            byte[] decode = Base64.decode(scrollId, Base64.URL_SAFE);
            spare.copyUTF8Bytes(decode, 0, decode.length);
        } catch (Exception e) {
            throw new ElasticsearchIllegalArgumentException("Failed to decode scrollId", e);
        }
        String[] elements = Strings.splitStringToArray(spare.get(), ';');
        if (elements.length < 2) {
View Full Code Here

Examples of org.apache.lucene.util.CharsRefBuilder.copyUTF8Bytes()

    private void addTermFrequencies(Map<String, Int> termFreqMap, Terms vector) throws IOException {
        final TermsEnum termsEnum = vector.iterator(null);
        final CharsRefBuilder spare = new CharsRefBuilder();
        BytesRef text;
        while((text = termsEnum.next()) != null) {
            spare.copyUTF8Bytes(text);
            final String term = spare.toString();
            if (isNoiseWord(term)) {
                continue;
            }
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.