Re: termFreqVector is always null ?

2011-04-21 Thread Patrick Diviacco
Nevermind, I've solved by indexing the fields with with Field.TermVector.YES doc.add(new Field("tags", "foo bar", Store.NO, Index.ANALYZED, Field.TermVector.YES)); On 21 April 2011 10:57, Patrick Diviacco wrote: > Hi, > > for any document, the termFreqVector is always null. > I'm sure

RE: TermFreqVector

2007-07-20 Thread Chhabra, Kapil
http://lucene.apache.org/java/2_2_0/api/org/apache/lucene/search/Hits.ht ml#id(int) public final int id(int n) throws IOException Returns the id for the nth document in this set. Note that ids may change when the index changes, so you cannot rely on the id to be stable. kapilCh

Re: TermFreqVector

2007-07-19 Thread Akanksha Baid
hits.id() should work. karl wettin wrote: 19 jul 2007 kl. 22.58 skrev Kevin Chen: doc = hits.doc(0); TermFreqVector vector = reader.getTermFreqVector(docId, "field"); How do I get docId? If you use Hits, it is hits.doc() -

Re: TermFreqVector

2007-07-19 Thread karl wettin
19 jul 2007 kl. 22.58 skrev Kevin Chen: doc = hits.doc(0); TermFreqVector vector = reader.getTermFreqVector(docId, "field"); How do I get docId? If you use Hits, it is hits.doc() -- karl - To unsubscribe, e-mail: [EMAIL

Re: TermFreqVector and performance, index size

2006-04-27 Thread Daniel Naber
On Donnerstag 27 April 2006 14:32, Philippe Deslauriers (Beetext) wrote: > What are the OFFSETS and POSITIONS used for? Do I need it for > Highlighting? No, you can provide an analyzer to Highlight.getBestFragment() and it will re-analyze your text without the need for term vectors. Regards Da

Re: TermFreqVector

2005-11-18 Thread Anna Buczak
Grant, Thank you for the information. When I made the appropriate changes in my code, it worked as a charm. Anna Grant Ingersoll wrote: > Hi Anna, > > The sample I sent is from a modified version of the demo (line 87 in > HTMLDocument of the latest code) that I am preparing for my ApacheCon >

Re: TermFreqVector

2005-11-18 Thread Grant Ingersoll
Hi Anna, The sample I sent is from a modified version of the demo (line 87 in HTMLDocument of the latest code) that I am preparing for my ApacheCon talk (which will cover Term Vectors, amongst other things). At any rate, if you look at the Field constructor for 1.4.3: |*Field

Re: TermFreqVector

2005-11-18 Thread Grant Ingersoll
On the 1.9 code base, you construct a Term Vector by doing something like: Document doc = ... doc.add(new Field("contents", "some value", Field.Store.YES, Field.Index.TOKENIZED, Field.TermVector.WITH_POSITIONS_OFFSETS)); Check out the javadocs for field construction. Once you have done this,

Re: TermFreqVector

2005-11-17 Thread Chris Lamprecht
Can you post the code you're using to create the Document and adding it to the IndexWriter? You have to tell lucene to store term freq vectors (it isn't done by default). Also I'm not sure what you mean when you say your documents do not have fields. Do you have at least one field? -chris On