AW: Terms & Postion from Hits ...

2005-04-12 Thread Patricio Galeas
-Ursprüngliche Nachricht- Von: Erik Hatcher [mailto:[EMAIL PROTECTED] Gesendet: Montag, 11. April 2005 15:05 An: java-user@lucene.apache.org Betreff: Re: Terms & Postion from Hits ... On Apr 10, 2005, at 11:52 AM, Patricio Galeas wrote: > Hello, > I am new with Lucene. I have following problem

Re: Terms & Postion from Hits ...

2005-04-11 Thread Maik Schreiber
> Now, I would like to obtain the List of all Terms (and their corresponding > position) from each document (hits.doc(i)). Try IndexReader.getTermFreqVector(), which will return an instance of TermPositionVector when the corresponding field has been indexed with storeTermVector==true. -- Maik Sc

Re: Terms & Postion from Hits ...

2005-04-11 Thread Andy Roberts
I've managed something like this from a slightly different perspective. IndexReader ir = new IndexReader(yourIndex); String searchTerm = "word"; TermPositions tp = ir.termPositions(new Term("contents", searchTerm); tp.next(); int termFreq = tp.freq(); System.out.print(currentTerm.text());

Re: Terms & Postion from Hits ...

2005-04-11 Thread Erik Hatcher
On Apr 10, 2005, at 11:52 AM, Patricio Galeas wrote: Hello, I am new with Lucene. I have following problem. When I execute a search I receive the list of document Hits. I get without problem the content of the documents too: for (int i = 0; i < hits.length(); i++) { Document doc = hits.doc(i)

Terms & Postion from Hits ...

2005-04-11 Thread Patricio Galeas
Hello, I am new with Lucene. I have following problem. When I execute a search I receive the list of document Hits. I get without problem the content of the documents too: for (int i = 0; i < hits.length(); i++) { Document doc = hits.doc(i); System.out.println(doc.get("content")); } N