Package org.apache.lucene.analysis

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


   * @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


  public void testCreationWithBlackList() throws Exception {
    TokenFilterFactory factory = tokenFilterFactory("Type",
        "types", "stoptypes-1.txt, stoptypes-2.txt",
        "enablePositionIncrements", "true");
    NumericTokenStream input = new NumericTokenStream();
    input.setIntValue(123);
    factory.create(input);
  }
View Full Code Here

  public void testCreationWithWhiteList() throws Exception {
    TokenFilterFactory factory = tokenFilterFactory("Type",
        "types", "stoptypes-1.txt, stoptypes-2.txt",
        "enablePositionIncrements", "true",
        "useWhitelist", "true");
    NumericTokenStream input = new NumericTokenStream();
    input.setIntValue(123);
    factory.create(input);
  }
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 long value,
                                final int precisionStep) {
    super(true);
    this.value = value;

    TokenStream stream = new NumericTokenStream(precisionStep)
        .setLongValue(value);

    try {
      stream.reset();
      while (stream.incrementToken()) {
View Full Code Here

    }

    public static class NumericIpTokenizer extends NumericTokenizer {

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

*
*/
public class NumericDateTokenizer extends NumericTokenizer {

    public NumericDateTokenizer(int precisionStep, char[] buffer, DateTimeFormatter dateTimeFormatter) throws IOException {
        super(new NumericTokenStream(precisionStep), buffer, dateTimeFormatter);
    }
View Full Code Here

*
*/
public class NumericLongTokenizer extends NumericTokenizer {

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

*
*/
public class NumericIntegerTokenizer extends NumericTokenizer {

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

*
*/
public class NumericDoubleTokenizer extends NumericTokenizer {

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

TOP

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

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.