lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul <p...@waite.net.nz>
Subject Re: Mixing database and lucene searches
Date Tue, 11 May 2004 03:20:56 GMT
Glen Stampoultzis wrote:

> Hi... I have a query screen where most of the fields search a regular
> database but one field searches for text in the body of the document.  You
> could say the database holds metadata about the documents.  Effectively
> this means I have two separate queries going on - a lucene query and a
> database query.  These results need to be combined.
>
> Anyone have any strategies for dealing with this?  I'm wondering whether
> it's better to replicate searchable fields in the lucene index.  This means
> being very careful that updates get done in two places so it is not ideal.

First index your docs with all fields that are queried on, and storing the
db key.For each query check the terms to see if the any non-metadata (Lucene)
query data has been submitted, If so, run a Lucene query, and build a
resultset of keys. If not, go straight to the database and do the same with a
standard db query.

The Lucene returns are then filled in with a database lookup for each doc
in the returned resultset to provide metadata.

Cheers,
Paul.

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message