-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
> 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
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());
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)
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