lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: The indexer
Date Tue, 20 Jul 2004 14:31:07 GMT
On Jul 20, 2004, at 10:07 AM, Ian McDonnell wrote:
>> As for indexing data from mysql - there have been lots of discussions
>> of that recently, so check the archives.  Basically you read the data,
>> and index it with Lucene's API.  And you are responsible for keeping 
>> it >in sync.
>
> The problem i am having is reading the data from the sql tables and 
> then using the indexer to store it. Has anybody indexed from a mysql 
> table before? If so, do i need to create some kind of JDBC query that 
> selects all the field values from the table and indexes them in a 
> lucene document that is stored on the server? If i do this, how can 
> this process be automated rather than manually running the program 
> everytime a new profile is added via the jsp form?

How you get the data from  your database is really up to you.  Some 
folks here may be able to offer some advice, but ultimately it is 
specific to your application and business process.

Once you have the data, via some query (again, this is up to you how 
you do it) you use Lucene's IndexWriter, create new Document's, add 
Field's to them, add the document to the writer, then close the writer. 
  That's all there is to indexing a document with Lucene.

As for automation - again this is up to your application but certainly 
you can interact with a Lucene index from your application so that it 
is not a manual separate indexing step.

> Erik, i'm not sure what you mean about keeping the db in sync. Are you 
> talking about stale or updated db entries?

You need to ensure that when data changes, the index is updated to 
reflect those changes.

	Erik


---------------------------------------------------------------------
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