2015-07-05 39 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 \ 

一切都應該現在的工作

相關問題