是否有用于 Lucene 的 HTML 分析器/标记器? [英] Is there a HTML analyzer/tokenizer for Lucene?

查看:18
本文介绍了是否有用于 Lucene 的 HTML 分析器/标记器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 Lucene 中从 html 中索引文本,实现此目的的最佳方法是什么?
在 Lucene 中是否有任何好的 Contrib 模块可以做到这一点?

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 ?

编辑
最后最终使用了 Jericho Parser.它不创建 DOM 并且易于使用.

EDIT
Finally ended up using Jericho Parser. It doesn't create DOM and is easy to use.

推荐答案

我假设您实际上并不想索引 HTML 标签.如果是这种情况,您可以首先使用 Apache Tika 从 HTML 中提取文本.然后就可以在 Lucene 中索引文本了.

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.

这篇关于是否有用于 Lucene 的 HTML 分析器/标记器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆