Re: Error of the code

2010-05-14 Thread manjula wijewickrema
Hi Ian, Thanx for your reply. vector.size() returns the total number of indexed terms in the index. However I was able to run the program and get the results finally with your help. Thanks a lot. Manjula On Thu, May 13, 2010 at 6:52 PM, Ian Lea wrote: > What does vector.size() return? You don

Re: Error of the code

2010-05-13 Thread Ian Lea
What does vector.size() return? You don't appear to be doing anything with the String term in "for ( String term : vector.getTerms() )" - presumably you intend to. -- Ian. On Thu, May 13, 2010 at 1:16 PM, manjula wijewickrema wrote: > Dear Ian, > > Thanks a lot for your immediate reply. As you

Re: Error of the code

2010-05-13 Thread manjula wijewickrema
Dear Ian, Thanks a lot for your immediate reply. As you have mentioned I replaced the lines as follows. IndexReader ir=IndexReader.open(directory); TermFreqVector vector=ir.getTermFreqVector(0,"fieldname"); Now the error has been vanished and thanks for it. But I can't still see the results al

Re: Error of the code

2010-05-13 Thread Ian Lea
You need to replace this: TermFreqVector vector = IndexReader.getTermFreqVector(0, "fieldname" ); with IndexReader ir = whatever(...); TermFreqVector vector = ir.getTermFreqVector(0, "fieldname" ); And you'll need to move it to after the writer.close() call if you want it to see the doc you've

Error of the code

2010-05-13 Thread manjula wijewickrema
Dear All, I am trying to get the term frequencies (through TermFreqVector) of a document (using Lucene 2.9.1). In order to do that I have used the following code. But there is a compile time error in the code and I can't figure it out. Could somebody can guide me what's wrong with it. Compile time