Hi Andy, Thanks for the example, i tried it and it works like a charm :) I will explore more of Lucene on my own.
Amit On 7/10/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
You can reference org.apache.lucene.document.Field class. It should be similar as: ontactDocument.add(new Field("name", contact.getName(),Field.Store.YES, Field.Index.TOKENIZED)); Andy -----Original Message----- From: Amit [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 10, 2007 6:00 PM To: java-user@lucene.apache.org Subject: Re: Cannot get Field.Text to work Hi Otis, Thanks for the reply. I didn't know that as all the examples on Lucene still use the old approach. I had a look at the API and it does not seem to provide any new methods as a substitute for Field.Text. Can you give a small example just how to add name-value pair to the document. Thanks Amit On 7/10/07, Otis Gospodnetic <[EMAIL PROTECTED]> wrote: > > Amit, > > Field.Text method is long gone from Lucene. I think that was in version > 1.4.3 of Lucene, maybe 1.9*, but we are in 2.* now. > The place to look at the new Field API is here: > > http://lucene.apache.org/java/2_2_0/api/org/apache/lucene/document/Field .html > > Otis > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . > Simpy -- http://www.simpy.com/ - Tag - Search - Share > > ----- Original Message ---- > From: Amit <[EMAIL PROTECTED]> > To: java-user@lucene.apache.org > Sent: Monday, July 9, 2007 10:41:27 PM > Subject: Cannot get Field.Text to work > > Hi > > I am new to Lucene and trying out the example code. But when I try to > insert > values using Field.Text the compiler does not recognize the Text as a > method > of Field. The code looks like this > > contactDocument.add(Field.Text("name", contact.getName())); > > I wanted to know if the version 2.2 does not have this method anymore, or > do > I have to access it in another way. > Any help appreciated. > > > Regards, > > Amit > > > > > > <a href="http://www.spreadfirefox.com/?q=affiliates&id=111787&t=1">Get > Firefox!</a> > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]