lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From geoff webb <geoff.w...@xrefer.com>
Subject Re: Database integration best practices ...
Date Wed, 27 Mar 2002 10:53:30 GMT
Peter Sojan wrote:
> I forgot one thing to ask:
> 
> I think I would end up in something:
> 
> SELECT * FROM atable WHERE id = 12 AND id = 23 AND id = 34 AND ....
> 

Either:

   SELECT * FROM atable WHERE id IN ( 12, 23, 34 ... )

OR

   SELECT * FROM atable WHERE id = 12 OR id = 23 OR id = 34 OR

Would be more what you want to achieve!

However this would be quite slow as you would have to do a search on the 
index
then retrieve data from the database. A nicer approach would be to store
summary data in the index itself and retrieve this from the index 
directly after performing a search. Only when a user selects an entry 
from this summary would you retrieve data from the database directly. In 
essence the search returns a summary of data from the index itself.

Flow of retrieving an entry would be:

  search index
     -> present results (from index)
        -> select desired result (from database)

You really don't want to be retrieving all columns from the database for 
all matches in a search as this puts unnecessary overhead on the entire 
system (unless of course you are batche processing ALL results of the 
search).

geoff


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


Mime
View raw message