lucene-java-user mailing list archives

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

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);
                doc.get("whatever");
}

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.

Thanks!

Samuru

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