简体   繁体   English

lucene 4.0快照中缺少功能

[英]missing feature in lucene 4.0 snapshot

I'm trying to use lucene 4.0 snapshot version, however StandardAnalyzer is missing in this version :(. Anybody knows on how to replace this? 我正在尝试使用lucene 4.0快照版本,但是在此版本中缺少StandardAnalyzer :(。有人知道如何替换它吗?

In the sample code given in the Lucene Summary Lucene摘要中给出的示例代码中

the StandardAnalyzer is used, but no where to be found.. 使用StandardAnalyzer,但没有找到的地方..

thanks in advance. 提前致谢。

Looks like the StandardAnalyzer was moved under org.apache.lucene.modules.analysis.standard.* You can find the StandardAnalyzer in the SVN Trunk 看起来StandardAnalyzer在org.apache.lucene.modules.analysis.standard下移动。*你可以在SVN Trunk中找到StandardAnalyzer

The reason is here 原因在于此

Here is the Maven dependency: 这是Maven的依赖:

    <dependency>
        <groupId>org.apache.lucene</groupId>
        <artifactId>lucene-analyzers-common</artifactId>
        <version>4.0.0-BETA</version>
    </dependency>

Since 4.0, I see it here: lucene-4.0.0\\analysis\\common\\src\\java\\org\\apache\\lucene\\analysis\\standard In eclipse, create a separate project for analysis, and include in its build path the core project. 从4.0开始,我在这里看到:lucene-4.0.0 \\ analysis \\ common \\ src \\ java \\ org \\ apache \\ lucene \\ analysis \\ standard在eclipse中,创建一个单独的项目进行分析,并在其构建路径中包含核心项目。 You will find some red marks because of some foreign characters in foreign language packages, I have ignored them for now because I only wanted standard analyzer. 你会发现一些红色标记,因为外语包中有一些外国字符,我现在忽略了它们因为我只想要标准分析器。 Hope this helps and saves you a lot of man hours and some frustration. 希望这有助于为您节省大量的工时和一些挫败感。

You have found standard analyzer in andriy 's answer..and for indexwriter the syntax is different in lucene 4.0..you can get the idea from the link: 您已经在andriy的答案中找到了标准分析器。对于索引编写者,lucene 4.0中的语法不同。您可以从链接中获取想法:

http://lucene.apache.org/core/4_0_0-ALPHA/demo/src-html/org/apache/lucene/demo/IndexFiles.html http://lucene.apache.org/core/4_0_0-ALPHA/demo/src-html/org/apache/lucene/demo/IndexFiles.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM