0

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.

  • Seems like there's a mismatch between where you've stored the files from opengrok and the path you've configured in Solr. /var/opengrok/data/index vs /var/opengrok/data/index/$projname. If opengrok expects things to run as multicore, you might want to enable that (I'm not familiar with opengrok). – MatsLindh Mar 30 '12 at 11:45
  • Maybe to clarify you can post the content of both directories. The index should be where the segments* file are. – javanna Mar 30 '12 at 11:48
  • Here's a file list: index index/premium index/premium/segments.gen index/premium/_m.cfs index/premium/segments_o index/trunk index/trunk/segments_2l index/trunk/segments.gen index/trunk/_2l.cfs index/vip index/vip/segments_2l index/vip/_2v.cfs index/vip/segments.gen – Vasil Kolev Mar 30 '12 at 16:24
  • @VasilKolev I guess the problem is due to the additional subirectories you have within the `index` directory (`premium`, `trunk` and `vip`). I think we are close...can you please update your question adding how you tell Solr to point to that dataDir? Do you have a solr.xml? How does it look like? – javanna Apr 02 '12 at 07:20

1 Answers1

1

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

joe
  • 11
  • 1