lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: Terms & Postion from Hits ...
Date Mon, 11 Apr 2005 13:04:53 GMT

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);
>       System.out.println(doc.get("content"));
> }
> Now, I would like to obtain the List of all Terms (and their 
> corresponding
> position) from each document (hits.doc(i)).

Lucene 1.4.x contains a term vector feature (see the javadocs for 
Field) that you can enable.  This does not give you position 
information though.  In the latest codebase (obtained via Subversion) 
the term vector feature has been enhanced to allow (optionally) the 
capturing of term positions and then also term offsets.

I recommend you try out the latest codebase for these features.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message