0

I have an existing web application which uses lucene to create indexes. Now as per the requirement, I have to set up Solr which will serve as a search engine for many other web application inculding my web app. I do not want to create indexes within Solr. Hence, I need to tell Solr to read indexes from lucene instead of creating indexes within Solr and reading from its own.

As a beginner of Solr, first I used nutch to create indxes and then used those indxes within Solr. But I'm unaware how to make Solr understand to read indexes from lucene. I did not find any documentation around this. Kindly advice how to achive this.

Pakira
  • 1,951
  • 3
  • 25
  • 54

2 Answers2

0

It is not possible in any reliable way.

It's like saying you built an application in Ruby and now want to use Rails on top of existing database structure. Solr (as Rails) has it's own expectations naming and workflows around Lucene core and there is no migration path.

You can try using Luke to confirm the internal data structures differences between Lucene and Solr for yourself.

Alexandre Rafalovitch
  • 9,709
  • 1
  • 24
  • 27
  • Thanks for the cormimation, I was hopping that it can be doable because Solr has inbuilt Lucene, so Solr can be integrated to external Lucene system. – Pakira Jul 08 '14 at 05:04
  • I found this post: http://stackoverflow.com/questions/2715973/can-a-raw-lucene-index-be-loaded-by-solr where it says that it can be doable – Pakira Jul 08 '14 at 09:14
  • It says they managed to dumb Solr down that it boots with that information. Notice all types are Strings, etc. I am not clear why you would need Solr at that point. It's also Solr 1.4. There has been quite a bit of progress (and possibly divergence) since then. If you wanted to do this as a technical hack, I would encourage it. But for a real business reasons, I would strongly recommend going back and exploring other options. Possibly even just indexing from Lucene into Solr, but using Solr's interface. – Alexandre Rafalovitch Jul 09 '14 at 01:57
-1

I have never done that before but as Solr is built on Lucene, you can try these steps. dataDir is the main point here

I am assuming you deploying it in /usr/local so change accordingly, and have basing knowledge of solr configuration.

Download Solr and copy dist/apache-solr-x.x.x.war to tomcat/webapps
Copied example/solr/conf to /usr/local/solr/
Set solr.home to /usr/local/solr
In solrconfig.xml, change dataDir to /usr/local/solr/data (Solr looks for the index directory inside)
change schema.xml accordingly ie. you need to change fields, 
bitkot
  • 4,466
  • 2
  • 28
  • 39
  • I have given direct path of lucene index location in dataDir within solrconfig.xml but it does not return anything. I think i do not need to update fields details in schema.xml file because i'm using out of the box configuration to search text. – Pakira Jul 07 '14 at 08:05
  • You need to change the schema.xml because, you need to match it with your lucene document structure. – bitkot Jul 07 '14 at 10:41