[英]What is the proper Stormcrawler settings to capture a meta tag into an index?
對於以下元標記中的信息, crawler-conf.yaml
(以及其他地方,如果需要)中的正確設置是什么:
<meta name="college" content="artdesign"/>
正確地捕獲到字段名稱為“學院”或“種子”的索引中?
我看到可能需要設置以下設置,但是嘗試了各種設置,但似乎無法捕獲數據。
在crawler-conf.yaml
:
# lists the metadata to persist to storage
# these are not transfered to the outlinks
metadata.persist:
- _redirTo
- error.cause
- error.source
- isSitemap
- isFeed
- college
- seed
不確定“持久存儲”是否意味着要進入索引?
crawler-conf.yaml
的另一個選項是:
# configuration for the classes extending AbstractIndexerBolt
indexer.md.mapping:
- parse.title=title
- parse.keywords=keywords
- parse.description=description
- domain=domain
- college=college
- college=seed
我之前曾問過一個事實,即一段時間以來,“ seed”的某些值似乎正在傳播到所獲取的沒有元標記的文檔中。 該設置為:
# metadata to transfer to the outlinks
# used by Fetcher for redirections, sitemapparser, etc...
# these are also persisted for the parent document (see below)
# metadata.transfer:
# - seed
因此,正如標題中所述,我的問題是我如何在crawler-conf.yaml
(或任何其他配置)中配置這些選項,以可靠地從該問題頂部列出的meta標記中捕獲數據,而無需傳播它可以獲取沒有該meta標簽的文檔?
這是我整理的。 上面引用的代碼中'parse.title'中引用的'parse'是對src/main/resources/parsefilters.json
頂級類下的一個自定義條目的引用(edit:meta標簽的鍵,然后由其檢索)。 src/main/resources/parsefilters.json
文件。 我去那里並添加了一個
"parse.college": "//META[@name=\\"college\\"]/@content"
排在那里,但仍在頂級班級中。
然后,我indexer.md.mapping
下的大學的引用更改為讀取- parse.college=college
並重新構建了- parse.college=college
器並運行了它。 然后,它開始正確地抓取<meta name="college" content="artdesign"/>
標記並將其發送到索引中的college
字段。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.