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.
The PyLucene documentation says it's there: PyLucene Documentation
But when i open up ipython and tab through "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:
1.Find the JARS section,the items look like this:
JARS+=$(ANALYZERS_JAR) # many language analyzers
remove the comment before JARS+=$(SPATIAL)
, now add the line:
JARS+=$(BENCHMARK_JAR) # benchmark module`
2.Find the JAR-path section where the items look like
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:
$(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.$
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":
--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