Is there a HTML analyzer/tokenizer for Lucene?

Deadly 提交于 2019-12-20 10:57:23

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!