Apache Nutch to index only part of page content

血红的双手。 提交于 2019-12-03 21:42:55

Building your own ParsingFilter and IndexingFilter is easy. Nutch provides you with the DOM document, which you only need to traverse and search for your div. Then you simply add the new fields to your index and schema and your done.

There are some examples on how to do this:

http://wiki.apache.org/nutch/HowToMakeCustomSearch

http://sujitpal.blogspot.com/2009/07/nutch-custom-plugin-to-parse-and-add.html

Good luck

By default the content is flat after parsing. So I don't think you can do what you want, unless you can get extract your content at the indexing step ie once content has been flattened.

Instead of writing your own plugins, you can also use these custom plugins which can be configured to extract parts of pages:

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