问题
I wanted to index text from html, in Lucene, what is the best way to achieve this ?
Is there any good Contrib module that can do this in Lucene ?
EDIT
Finally ended up using Jericho Parser. It doesn't create DOM and is easy to use.
回答1:
I'm assuming that you don't actually want to index the HTML tags. If that's the case, you can first extract text from HTML using Apache Tika. Then you can index the text in Lucene.
回答2:
I would recommend using Jsoup HTML parser to extract the text and then use Lucene. It worked well for me.
回答3:
You might also want to take a look at /Lucene-3.0.3/src/demo which has an HTML parser example.
来源:https://stackoverflow.com/questions/5271810/is-there-a-html-analyzer-tokenizer-for-lucene