lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <erickerick...@gmail.com>
Subject Re: Combine data from index and db before sorting and pagination
Date Wed, 01 Sep 2010 23:29:26 GMT
The usual first choice when using Lucene to search database data is to
denormalize the db data into the index. Yes, it's redundant, but it's often
a better solution than trying to use both. Synchronization can be an issue,
but you have to deal with that anyway since you're indexing from the db
anyway.

 But you haven't given us any indication of how much data you're talking
about here. Without some such detail, it's really hard to make a
recommendation.

Best
Erick

On Wed, Sep 1, 2010 at 9:30 AM, Sertic Mirko, Bedag
<Mirko.Sertic@bedag.ch>wrote:

> The data from db is required for sorting, and one db entry matches to many
> index entries, so storing it in the index would be redundant. Also there
> would be the challenge to keep index and db in sync. Any ideas?
>
> Mirko
>
> -----Urspr√ľngliche Nachricht-----
> Von: Ian Lea [mailto:ian.lea@gmail.com]
> Gesendet: Mittwoch, 1. September 2010 15:17
> An: java-user@lucene.apache.org
> Betreff: Re: Combine data from index and db before sorting and pagination
>
> If the sorting and pagination doesn't require data from the database,
> just do db lookups for the hits on a page, page by page as required.
> But if the db data is required I'd suggest storing it in the index.
>
>
> --
> Ian.
>
> On Wed, Sep 1, 2010 at 1:43 PM, Sertic Mirko, Bedag
> <Mirko.Sertic@bedag.ch> wrote:
> > Hi
> >
> >
> >
> > I need to implement sorting and pagination of lucene search results.
> > This is quite easy, but I have to combine Data from the index with data
> > from a database. The index has the fulltext data plus a unique
> > identifier for a record from the database. The database stores
> > additional data. Fulltext search is only done on the index. I need to
> > combine the search results from the index and the additional data from
> > the database before sorting and pagination.
> >
> >
> >
> > Is the IndexReader.document() Method the right place to enrich the data
> > from the index with data from the db? How should I implement this
> > functionality with lucene?
> >
> >
> >
> > Thanks in advance
> >
> > Mirko
> >
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message