2015-07-05 40 views
1

我刚刚在Ubuntu 14.04上通过Makefile安装了PyLucene 4.9(也试过用4.8),一切运行正常,除了我缺少org.apache.lucene.benchmark中的模块。PyLucene org.apache.lucene.benchmark is missing

的PyLucene文件说,它的存在:PyLucene Documentation

但是,当我打开的IPython和标签通过“从org.apache.lucene。”我只从自动完成获得这些结果:

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 

所以我假设我的安装出了问题,但我无法弄清楚。有没有人遇到过这种问题,可能会有帮助?

回答

0

好的,我可以自己弄清楚。 如果您想使用的基准模块,你必须通过以下方式编辑Makefile:

1.Find的罐子部分,项目是这样的:

JARS+=$(ANALYZERS_JAR)   # many language analyzers 

JARS+=$(SPATIAL)之前删除评论现在添加一行:

JARS+=$(BENCHMARK_JAR)   # benchmark module` 

2.Find的JAR路径部分,其中的项目看起来像

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

以下行添加到本节:

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

3.Find的ANT-部分,其中的文字是这样的:

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

在本节的末尾添加以下文字:

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

下面4.Right到JCCFLAGS?=添加--classpath "./lucene-java-4.9.0/lucene/spatial/lib/spatial4j-0.4.$

5.在GENERATE部分添加下面的排除项(如果你需要这些模块在Python中工作,你可能需要下载额外的.jar文件并将它们添加到jcc classpath中,我不需要它们来完成我的任务“:

--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 \ 

一切都应该现在的工作

相关问题