避免将HTML标记索引为搜索关键字

时间:2015-05-14 04:31:58

标签: java html lucene

我在HTML文档中索引关键字,但我不想索引HTML标记。

例如:

<div>  <!-- this is html code -->
<span>You are welcome</span>  <!-- simple message for searching -->
<div>
<h1>Testing text</h1>  <!-- second message -->
</div>
</div>

预期关键字:

keywords:You

如何避免HTML标记成为关键字?

1 个答案:

答案 0 :(得分:0)

我认为您需要解析HTML并提取每个标记的内部文本。

相关问题