On Nov 2, 2007, at 4:37 AM, Jamal H Tandina wrote:

Hi

Iam having problem using Field.TermVector, i dont know how to use it. does some one have an exemple or an address, how to use the termVector in indexing an searching?


doc.add(new Field("title", "value", Field.Store.YES, Field.Index.TOKENIZED, Field.TermVector.YES);

You don't really need to use it during searching necessarily, but it can come in handy for highlighting and other purposes (clustering, relevance feedback, etc.)

On the reader side,
IndexReader.getTermFreqVector(int, String)

let's you retrieve them from disk.

Also, see my talk from ApacheCon 2005 at http://cnlp.org/ apachecon2005/ as there are a number of examples there (although I don't guarantee they compile against the latest version of Lucene, they should still be generally applicable)




doc.add(new Field("title", httpd.getTiltle(), Field.Store.YES, Field.TermVector));

Thanks


---------------------------------
Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail

--------------------------
Grant Ingersoll
http://lucene.grantingersoll.com

Lucene Boot Camp Training:
ApacheCon Atlanta, Nov. 12, 2007.  Sign up now!  http://www.apachecon.com

Lucene Helpful Hints:
http://wiki.apache.org/lucene-java/BasicsOfPerformance
http://wiki.apache.org/lucene-java/LuceneFAQ



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to