lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Samuru Jackson" <>
Subject Get list with found words for a hit?
Date Mon, 27 Feb 2006 11:50:11 GMT

Is there a way to retrieve a List of the matching words for a Hit?

For example I create a query like this one:

"Paris London -Stockholm"

Now I get a Hit object with a couple of results back where I can iterate
over the documents:

for (int i = 0; i < hits.length(); i++) {
                Document doc = hits.doc(i);

How do I know which words have been found in a document? In one it could be
Paris, in another it could be London or both!

I would need this information in order to highlight those words if I display
the search results to the user.



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message