Lucene 4.3:MultifieldQueryParser中缺少StopwordAnalyzerBase

时间:2013-05-17 13:36:25

标签: parsing lucene migration

您好我有以下依赖:

<dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-queryparser</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-analyzers-common</artifactId>
        </dependency>

所有这些都是4.3。

MultiFieldQueryParser.parse(Version.LUCENE_43,
                    searchCriteria.getSearchTerms(), searchCriteria
                            .getSearchFields(), new EnglishAnalyzer(
                            Version.LUCENE_43));

我收到错误说

org.apache.lucene.analysis.StopwordAnalayzerBase is indirectly referenced, however it does not exist. 

我检查了包裹,他们是org.apache.lucene.analysis.util.StopWordAnalyzerBase

我如何migrate?我需要dependency什么?

我的代码是l

1 个答案:

答案 0 :(得分:1)

看起来你在类路径的某个地方有EnglishAnalyzer的旧版本。

Lucene 4.3中的

EnglishAnalyzerStopWordAnalyzerBase包中扩展o.a.l.a.util

import org.apache.lucene.analysis.util.StopwordAnalyzerBase;
...
public final class EnglishAnalyzer extends StopwordAnalyzerBase {

事实上,这两个类都位于same jar