You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Jamal H Tandina <jt...@yahoo.fr> on 2007/11/02 09:37:28 UTC
how to use Field.TermVector
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", httpd.getTiltle(), Field.Store.YES, Field.TermVector));
Thanks
---------------------------------
Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail
Re: how to use Field.TermVector
Posted by Grant Ingersoll <gs...@apache.org>.
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: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org