Vasil Kolev
Vasil Kolev

Reputation: 11

Using Solr to read OpenGrok's database and failing with "no segments* file found"

I need a simple way to read OpenGrok's DB from a php script to do some weird searches (as doing that in Java in OpenGrok itself isn't in my abilities). So I decided to use Solr as a way to query the Lucene DB directly from another language (probably PHP or C).

The problem is that when I point Solr to /var/opengrok/data, it bombs out with:

java.lang.RuntimeException: org.apache.lucene.index.IndexNotFoundException: no segments* file found in org.apache.lucene.store.MMapDirectory@/var/opengrok/data/index lockFactory=org.apache.lucene.store.NativeFSLockFactory@3a329572: files: [] at org.apache.solr.core.SolrCore.getSearcher(SolrCore.java:1103)

(etc, etc, the backtrace is about three screens long)

I tried to point it somewhere inside data with no luck. The structure looks like this:

/var/opengrok/data/index/$projname/segment* /var/opengrok/data/spelling...

and seems like whatever Solr is using is expecting the segment files directly in the index directory.

I checked to see if there's any version discrepancy, but OpenGrok 0.11 is using Lucene 3.0.2 and I've set Solr to LUCENE_30 as the database version.

Any pointers will be greatly appreciated, google didn't seem to be able to help with this.

Upvotes: 0

Views: 825

Answers (1)

joe
joe

Reputation: 11

opengroks web interface can consume any well formed search query (through url) and reply with xhtml results which are easily parse-able, so you're probably making it too complex to hack inside the lucene rather than using UI provided ...

Upvotes: 1

Related Questions