aspose file tools
The moose likes Other Open Source Projects and the fly likes how to get the search words in result hits in Lucene. Help please!!! Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Reply Bookmark "how to get the search words in result hits in Lucene. Help please!!!" Watch "how to get the search words in result hits in Lucene. Help please!!!" New topic
Author

how to get the search words in result hits in Lucene. Help please!!!

jonathan ford
Greenhorn

Joined: Feb 16, 2008
Posts: 4
For example:
search term = "java OR struts OR development OR spring OR framework"

I can use Searcher.search() to get the result hits. and I can use hits.doc() to retrieve document information.

here is my question: for each document in result hits, How I can know which words in search term just match the words in the result document? i.e. I get a document, which content contains the words: spring and framework, that's the reason this document got hit. is there possible to get these two words "spring" and "framework" in programmatic way.

any suggestions and clues will be much appreciated!!!
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: how to get the search words in result hits in Lucene. Help please!!!
 
Similar Threads
Highlight the words in files( doc, excel, pdf etc) using java
I have a question on User Interface!
what is the difference between J2SE and J2EE
print results of wildcard search in Lucene
Bean Validation Framework