Example usage for org.apache.lucene.util CharsRefBuilder chars

List of usage examples for org.apache.lucene.util CharsRefBuilder chars

Introduction

In this page you can find the example usage for org.apache.lucene.util CharsRefBuilder chars.

Prototype

public char[] chars() 

Source Link

Document

Return a reference to the chars of this builder.

Usage

From source file:org.apache.solr.schema.EnumFieldType.java

License:Apache License

@Override
public CharsRef indexedToReadable(BytesRef input, CharsRefBuilder output) {
    final Integer intValue = NumericUtils.sortableBytesToInt(input.bytes, 0);
    final String stringValue = enumMapping.intValueToStringValue(intValue);
    output.grow(stringValue.length());//from ww  w .  ja  v a 2 s. c om
    output.setLength(stringValue.length());
    stringValue.getChars(0, output.length(), output.chars(), 0);
    return output.get();
}

From source file:org.apache.solr.schema.PointField.java

License:Apache License

@Override
public CharsRef indexedToReadable(BytesRef indexedForm, CharsRefBuilder charsRef) {
    final String value = indexedToReadable(indexedForm);
    charsRef.grow(value.length());/*  w  w  w. ja  v a2  s .c o m*/
    charsRef.setLength(value.length());
    value.getChars(0, charsRef.length(), charsRef.chars(), 0);
    return charsRef.get();
}

From source file:org.codelibs.elasticsearch.search.suggest.phrase.NoisyChannelSpellChecker.java

License:Apache License

public TokenStream tokenStream(Analyzer analyzer, BytesRef query, CharsRefBuilder spare, String field)
        throws IOException {
    spare.copyUTF8Bytes(query);//  www . j  a  va  2 s.  co m
    return analyzer.tokenStream(field, new FastCharArrayReader(spare.chars(), 0, spare.length()));
}