Package org.apache.lucene.analysis

Examples of org.apache.lucene.analysis.NumericTokenStream$NumericAttributeFactory


   * @param index if the field should be indexed using {@link NumericTokenStream}
   */
  public NumericField(String name, int precisionStep, Field.Store store, boolean index) {
    super(name, store, index ? Field.Index.ANALYZED_NO_NORMS : Field.Index.NO, Field.TermVector.NO);
    setOmitTermFreqAndPositions(true);
    tokenStream = new NumericTokenStream(precisionStep);
  }
View Full Code Here


 
  protected final OffsetAttribute ofsAtt = addAttribute(OffsetAttribute.class);
  protected int startOfs, endOfs;

  static NumericTokenStream getNumericTokenStream(int precisionStep) {
    return new NumericTokenStream(precisionStep);
  }
View Full Code Here

    if (!isIndexed())
      return null;
    if (numericTS == null) {
      // lazy init the TokenStream as it is heavy to instantiate (attributes,...),
      // if not needed (stored field loading)
      numericTS = new NumericTokenStream(precisionStep);
      // initialize value in TokenStream
      if (fieldsData != null) {
        assert type != null;
        final Number val = (Number) fieldsData;
        switch (type) {
View Full Code Here

    final NumericType numericType = fieldType().numericType();
    if (numericType != null) {
      if (!(internalTokenStream instanceof NumericTokenStream)) {
        // lazy init the TokenStream as it is heavy to instantiate
        // (attributes,...) if not needed (stored field loading)
        internalTokenStream = new NumericTokenStream(type.numericPrecisionStep());
      }
      final NumericTokenStream nts = (NumericTokenStream) internalTokenStream;
      // initialize value in TokenStream
      final Number val = (Number) fieldsData;
      switch (numericType) {
      case INT:
        nts.setIntValue(val.intValue());
        break;
      case LONG:
        nts.setLongValue(val.longValue());
        break;
      case FLOAT:
        nts.setFloatValue(val.floatValue());
        break;
      case DOUBLE:
        nts.setDoubleValue(val.doubleValue());
        break;
      default:
        throw new AssertionError("Should never get here");
      }
      return internalTokenStream;
View Full Code Here

    }

    public static class NumericIpTokenizer extends NumericTokenizer {

        public NumericIpTokenizer(Reader reader, int precisionStep) throws IOException {
            super(reader, new NumericTokenStream(precisionStep), null);
        }
View Full Code Here

        public NumericIpTokenizer(Reader reader, int precisionStep) throws IOException {
            super(reader, new NumericTokenStream(precisionStep), null);
        }

        public NumericIpTokenizer(Reader reader, int precisionStep, char[] buffer) throws IOException {
            super(reader, new NumericTokenStream(precisionStep), buffer, null);
        }
View Full Code Here

* @author kimchy (shay.banon)
*/
public class NumericLongTokenizer extends NumericTokenizer {

    public NumericLongTokenizer(Reader reader, int precisionStep) throws IOException {
        super(reader, new NumericTokenStream(precisionStep), null);
    }
View Full Code Here

    public NumericLongTokenizer(Reader reader, int precisionStep) throws IOException {
        super(reader, new NumericTokenStream(precisionStep), null);
    }

    public NumericLongTokenizer(Reader reader, int precisionStep, char[] buffer) throws IOException {
        super(reader, new NumericTokenStream(precisionStep), buffer, null);
    }
View Full Code Here

* @author kimchy (shay.banon)
*/
public class NumericIntegerTokenizer extends NumericTokenizer {

    public NumericIntegerTokenizer(Reader reader, int precisionStep) throws IOException {
        super(reader, new NumericTokenStream(precisionStep), null);
    }
View Full Code Here

    public NumericIntegerTokenizer(Reader reader, int precisionStep) throws IOException {
        super(reader, new NumericTokenStream(precisionStep), null);
    }

    public NumericIntegerTokenizer(Reader reader, int precisionStep, char[] buffer) throws IOException {
        super(reader, new NumericTokenStream(precisionStep), buffer, null);
    }
View Full Code Here

TOP

Related Classes of org.apache.lucene.analysis.NumericTokenStream$NumericAttributeFactory

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.