简体   繁体   English

PyLucene org.apache.lucene.benchmark丢失

[英]PyLucene org.apache.lucene.benchmark is missing

i just installed PyLucene 4.9 (and also tried with 4.8) via Makefile on Ubuntu 14.04, everything is running fine except that i am missing the modules in org.apache.lucene.benchmark. 我刚刚在Ubuntu 14.04上通过Makefile安装了PyLucene 4.9(并尝试了4.8),除了我在org.apache.lucene.benchmark中缺少模块之外,其他所有程序都运行良好。

The PyLucene documentation says it's there: PyLucene Documentation PyLucene文档说它在那里: PyLucene文档

But when i open up ipython and tab through "from org.apache.lucene." 但是当我打开ipython并通过“ from org.apache.lucene”选项卡时。 i only get these results from autocomplete: 我只从自动完成中得到以下结果:

In [3]: from org.apache.lucene.
org.apache.lucene.analysis     org.apache.lucene.queries
org.apache.lucene.codecs       org.apache.lucene.queryparser
org.apache.lucene.collation    org.apache.lucene.sandbox
org.apache.lucene.document     org.apache.lucene.search
org.apache.lucene.expressions  org.apache.lucene.store
org.apache.lucene.facet        org.apache.lucene.util
org.apache.lucene.index 

So i am assuming something went wrong with my installation but i cannot figure it out. 所以我假设我的安装出现问题,但我无法弄清楚。 Has anyone experienced this kind of problem and may be able to help? 有没有人遇到过此类问题,并且可以提供帮助?

Okay, i was able to figure it out by myself. 好的,我自己就能弄清楚。 If you want to use the benchmark module, you have to edit the Makefile in the following ways: 如果要使用基准测试模块,则必须通过以下方式编辑Makefile:

1.Find the JARS section,the items look like this: 1.找到“ JARS”部分,项目如下所示:

JARS+=$(ANALYZERS_JAR)          # many language analyzers 

remove the comment before JARS+=$(SPATIAL) , now add the line: 删除JARS+=$(SPATIAL)之前的注释,现在添加以下行:

JARS+=$(BENCHMARK_JAR)          # benchmark module`

2.Find the JAR-path section where the items look like 2.找到项目看起来像的JAR-path部分

LUCENE_JAR=$(LUCENE)/build/core/lucene-core-$(LUCENE_VER).jar  

add the following line to this section: 在此部分添加以下行:

BENCHMARK_JAR=$(LUCENE)/build/benchmark/lucene-benchmark-$(LUCENE_VER).jar

3.Find the ANT-section where the text looks like: 3.找到ANT部分,文本如下所示:

$(LUCENE_JAR): $(LUCENE)
        cd $(LUCENE); $(ANT) -Dversion=$(LUCENE_VER)

append the following text at the end of the section: 在本节末尾添加以下文本:

$(BENCHMARK_JAR): $(LUCENE_JAR)
        cd $(LUCENE)/benchmark; $(ANT) -Dversion=$(LUCENE_VER)  

4.Right below, to the JCCFLAGS?= add --classpath "./lucene-java-4.9.0/lucene/spatial/lib/spatial4j-0.4.$ 4.在下面,到JCCFLAGS?=添加--classpath "./lucene-java-4.9.0/lucene/spatial/lib/spatial4j-0.4.$

5.At the GENERATE section, add the following excludes(if you need these Modules to work with in Python you might have to download extra .jar files and add them to the jcc classpath, i didn't need them for my task": 5.在GENERATE部分,添加以下排除项(如果您需要在Python中使用这些模块,则可能需要下载额外的.jar文件并将其添加到jcc类路径中,我不需要它们来完成任务”:

--exclude org.apache.lucene.benchmark.byTask.utils.StreamUtils \
--exclude org.apache.lucene.benchmark.byTask.utils.LineDocSourceTest \
--exclude org.apache.lucene.benchmark.byTask.utils.WriteLineDocTaskTest \
--exclude org.apache.lucene.benchmark.byTask.feeds.LongToEnglishQueryMaker \ 
--exclude org.apache.lucene.benchmark.byTask.feeds.LongToEnglishContentSource \  

Everything should be working now 现在一切都应该正常工作

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

相关问题 通过调用org.apache.lucene.benchmark.byTask.feeds.TrecGov2Parser.parse获取NullPointerException - Get NullPointerException from calling org.apache.lucene.benchmark.byTask.feeds.TrecGov2Parser.parse NoSuchMethodError: org.apache.lucene.document.Field - NoSuchMethodError: org.apache.lucene.document.Field IllegalAccessError:org / apache / lucene / index / DirectoryReader - IllegalAccessError: org/apache/lucene/index/DirectoryReader 无法导入org.apache.lucene - Cannot import org.apache.lucene Lucene的org.apache.lucene.document.Field类的方法使用 - Methods usage of org.apache.lucene.document.Field class of Lucene org.apache.lucene.index.IndexNotFoundException:org.apache.lucene.store.RAMDirectory中找不到segments *文件 - org.apache.lucene.index.IndexNotFoundException: no segments* file found in org.apache.lucene.store.RAMDirectory 在Apache Lucene中导入org.apache.lucene.analysis.SimpleAnalyzer符号未找到错误 - import org.apache.lucene.analysis.SimpleAnalyzer symbol not found error in Apache lucene java.lang.NoClassDefFoundError:org / apache / lucene / search / FieldComparatorSource - java.lang.NoClassDefFoundError: org/apache/lucene/search/FieldComparatorSource java.lang.NoClassDefFoundError:org / apache / lucene / codecs / Codec - java.lang.NoClassDefFoundError: org/apache/lucene/codecs/Codec 无法访问 org.apache.lucene.search.TotalHits - Cannot access org.apache.lucene.search.TotalHits
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM