You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by The Flight Captain <ja...@flightcentre.com> on 2009/01/08 06:40:58 UTC

Re: Using Lucene index in Solr

Do I have to set the datasource that my index references?

My data is stored in a database, I want Solr to look up the data in that
database using my existing index. At the moment, I have set the <dataDir>
element in my solrconfig to point at my existing index, and checked the
schema on my existing index using Luke but I can't get any results when
searching in Solr.

My index was created using hibernate-search. 

How I can retrieve my data in Solr, using the existing Lucene index? I think
I need to set the database connection details somewhere, just not sure
where. I have set up a dataImport handler, but I don't want that to
overwrite my exising index.


yonik wrote:
> 
> On 6/21/06, Tricia Williams <pg...@student.cs.uwaterloo.ca> wrote:
>>    I was wondering if there are any major differences in building an
>> index
>> using Lucene and Solr.  If there is no substantial differences, how would
>> one
>> go about using an existing index created using Lucene in Solr?
> 
> You can definitely do that for the majority of indicies w/o writing
> any code... you just need to make sure the schema matches what is in
> the index (make the analyzers for the field types compatible, etc).
> 
> If you have access to the source code that built the index, start
> there.  If you don't then open up the index with Luke to see what you
> can find out.
> 
> -Yonik
> 
> 

-- 
View this message in context: http://www.nabble.com/Using-Lucene-index-in-Solr-tp4983079p21346212.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Using Lucene index in Solr

Posted by Chris Hostetter <ho...@fucit.org>.
: My data is stored in a database, I want Solr to look up the data in that
: database using my existing index. At the moment, I have set the <dataDir>

you seem to be confusing two issues....

: element in my solrconfig to point at my existing index, and checked the
: schema on my existing index using Luke but I can't get any results when
: searching in Solr.
: 
: My index was created using hibernate-search. 

...if you have an existing index, and you want to search in Solr, you have 
to create a schema.xml file that tells solr what the fields are that you 
have and what datatypes to treat them as -- in particular what analysers 
to use when querying them.

if hibernate-search built your index, you'll need to look at how it was 
configured to build the index to figure some of this out (i'm not familiar 
with hibernate-search so i can't help you there) ... the 
LUkeRequestHandler can help you spot check the raw index if you need to 
(ie: "oh, look all of hte terms are lowercased so i guess i would use a 
LowerCaseFilterFactory")

: How I can retrieve my data in Solr, using the existing Lucene index? I think
: I need to set the database connection details somewhere, just not sure
: where. I have set up a dataImport handler, but I don't want that to
: overwrite my exising index.

If you are given solr an existing index, it doens't care what database it 
was built from -- just what analsysis rules were used when it was built.  
the only thing in solr that cares about databases is the DataImportHandler 
which you could use to update your idex as new data gets added to your 
database if you want -- but first you have to create a schema.xml that 
makes sense for your index.

Alternately: create the schema.xml that you *want* to have, abandom your 
existing index and use DataImportHandler to build a new index and keep it 
up to date.


-Hoss