Package org.apache.lucene.analysis.core

Examples of org.apache.lucene.analysis.core.StopAnalyzer


  private Query createLuceneQuery(String term, String value) {
    String searchQuery = term + ":" + value;
    QueryParser parser = new QueryParser(
        TestConstants.getTargetLuceneVersion(),
        term,
        new StopAnalyzer( TestConstants.getTargetLuceneVersion() )
    );
    Query luceneQuery;
    try {
      luceneQuery = parser.parse( searchQuery );
    }
View Full Code Here


    @Inject
    public StopAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, Environment env, @Assisted String name, @Assisted Settings settings) {
        super(index, indexSettings, name, settings);
        CharArraySet stopWords = Analysis.parseStopWords(env, settings, StopAnalyzer.ENGLISH_STOP_WORDS_SET);
        this.stopAnalyzer = new StopAnalyzer(stopWords);
        this.stopAnalyzer.setVersion(version);
    }
View Full Code Here

public final class LuceneUtil {

    //Remove os stopwords;
    public static List<String> tokenizeString(String linha) {
      
        Analyzer analyzer = new StopAnalyzer(Version.LUCENE_4_9);

        List<String> result = new ArrayList<>();

        try {
            TokenStream stream = analyzer.tokenStream(null, new StringReader(linha));
            stream.reset();
            while (stream.incrementToken()) {

                result.add(stream.getAttribute(CharTermAttribute.class).toString());
View Full Code Here

TOP

Related Classes of org.apache.lucene.analysis.core.StopAnalyzer

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.