lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aleksander M. Stensby" <>
Subject Re: question
Date Thu, 29 Jun 2006 12:48:23 GMT
If your database table looks like this:

ID - Content - Subject - Author

you get the fields from you db and assumably store them in some bean, or  
directly in strings like this;
String id, content, subject, author.

you can create a lucene document in this fashion:

final Document doc = new Document();

doc.add(new Field("id", id, Store.YES, Index.UN_TOKENIZED));
doc.add(new Field("content", content, Store.NO, Index.TOKENIZED));
... and so on

Store.* and Index.* choices depend on your need.

then store the document to you index using


Of course it is a bit dirty to name the fields in the code and you could  
for instance declare the field-names

public static final String SIGNATUREURI = "signatureuri";

Hope this helps. If you read a bit in the wiki, you will find a nice deal  
of pointers there aswell.

On Thu, 29 Jun 2006 14:40:05 +0200, <> wrote:

> hi martin,
> thing is that i am new to lucene and
> i am not sure how to use it
> the cnnection through jdbc and select stmt. are all done
> i just want to know that how can i create lucene document per
> row? if u provide some pseudo code kind of thing..
> as in demo the indexing is done on files
> amit kumar
> ==========
> This e-mail may contain privileged and confidential information which is  
> the property of Persistent Systems Pvt. Ltd. It is intended only for the  
> use of the individual or entity to which it is addressed. If you are not  
> the intended recipient, you are not authorized to read, retain, copy,  
> print, distribute or use this message. If you have received this  
> communication in error, please notify the sender and delete all copies  
> of this message. Persistent Systems Pvt. Ltd. does not accept any  
> liability for virus infected mails.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Aleksander M. Stensby
Software Developer
Integrasco A/S
Tlf.: +47 41 22 82 72

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message