Examples of reusableTokenStream()


Examples of org.apache.lucene.analysis.Analyzer.reusableTokenStream()

        // Use the analyzer to get all the tokens, and then build a TermQuery,
        // PhraseQuery, or nothing based on the term count

        TokenStream source = null;
        try {
          source = analyzer.reusableTokenStream(field, new StringReader(queryText));
          source.reset();
        } catch (IOException e) {
          throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, e)
        }
        ArrayList<Token> lst = new ArrayList<Token>();
View Full Code Here

Examples of org.apache.lucene.analysis.Analyzer.reusableTokenStream()

    if (!TokenizerChain.class.isInstance(analyzer)) {

      TokenStream tokenStream = null;
      try {
        tokenStream = analyzer.reusableTokenStream(context.getFieldName(), new StringReader(value));
        tokenStream.reset();
      } catch (IOException e) {
        throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, e);
      }
      NamedList<List<NamedList>> namedList = new NamedList<List<NamedList>>();
View Full Code Here

Examples of org.apache.lucene.analysis.Analyzer.reusableTokenStream()

    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < 5000; i++) {
      sb.append("我购买了道具和服装。");
    }
    Analyzer analyzer = new SmartChineseAnalyzer(TEST_VERSION_CURRENT);
    TokenStream stream = analyzer.reusableTokenStream("", new StringReader(sb.toString()));
    stream.reset();
    while (stream.incrementToken()) {
    }
  }
 
View Full Code Here

Examples of org.apache.lucene.analysis.Analyzer.reusableTokenStream()

    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < 5000; i++) {
      sb.append("我购买了道具和服装");
    }
    Analyzer analyzer = new SmartChineseAnalyzer(TEST_VERSION_CURRENT);
    TokenStream stream = analyzer.reusableTokenStream("", new StringReader(sb.toString()));
    stream.reset();
    while (stream.incrementToken()) {
    }
  }
 
View Full Code Here

Examples of org.apache.lucene.analysis.Analyzer.reusableTokenStream()

    public final TokenStream reusableTokenStream(String fieldName, Reader reader)
            throws IOException {
        if (indexingConfig != null) {
            Analyzer propertyAnalyzer = indexingConfig.getPropertyAnalyzer(fieldName);
            if (propertyAnalyzer != null) {
                return propertyAnalyzer.reusableTokenStream(fieldName, reader);
            }
        }
        return defaultAnalyzer.reusableTokenStream(fieldName, reader);
    }
}
View Full Code Here

Examples of org.apache.lucene.analysis.Analyzer.reusableTokenStream()

    public TokenStream reusableTokenStream(String fieldName, Reader reader)
            throws IOException {
        if (indexingConfig != null) {
            Analyzer propertyAnalyzer = indexingConfig.getPropertyAnalyzer(fieldName);
            if (propertyAnalyzer != null) {
                return propertyAnalyzer.reusableTokenStream(fieldName, reader);
            }
        }
        return defaultAnalyzer.reusableTokenStream(fieldName, reader);
    }
}
View Full Code Here

Examples of org.apache.lucene.analysis.Analyzer.reusableTokenStream()

          stringReader.init(stringValue);
          reader = stringReader;
        }
       
        // Tokenize field
        stream = analyzer.reusableTokenStream(field.name(), reader);
      }

      // reset the TokenStream to the first token
      stream.reset();
View Full Code Here

Examples of org.apache.lucene.analysis.Analyzer.reusableTokenStream()

          stringReader.init(stringValue);
          reader = stringReader;
        }
       
        // Tokenize field
        stream = analyzer.reusableTokenStream(field.name(), reader);
      }

      // reset the TokenStream to the first token
      stream.reset();
View Full Code Here

Examples of org.apache.lucene.analysis.Analyzer.reusableTokenStream()

    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < 5000; i++) {
      sb.append("我购买了道具和服装。");
    }
    Analyzer analyzer = new SmartChineseAnalyzer(TEST_VERSION_CURRENT);
    TokenStream stream = analyzer.reusableTokenStream("", new StringReader(sb.toString()));
    stream.reset();
    while (stream.incrementToken()) {
    }
  }
 
View Full Code Here

Examples of org.apache.lucene.analysis.Analyzer.reusableTokenStream()

    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < 5000; i++) {
      sb.append("我购买了道具和服装");
    }
    Analyzer analyzer = new SmartChineseAnalyzer(TEST_VERSION_CURRENT);
    TokenStream stream = analyzer.reusableTokenStream("", new StringReader(sb.toString()));
    stream.reset();
    while (stream.incrementToken()) {
    }
  }
 
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.