【发布时间】:2021-07-09 18:45:44
【问题描述】:
几年来,我们一直在使用 StormCrawler 和 Elasticsearch 来索引我们自己的网站。我想知道我们是否可以调整搜索结果以使某些页面出现在结果的顶部?例如,特定的搜索关键字会将特定页面带到结果的顶部,而不是在列表的下方。 HTML 页面中的关键字元数据字段似乎是执行此操作的地方,但 Stormcrawler 似乎忽略了它以优先考虑结果?任何想法都表示赞赏。
谢谢。
编辑: 搜索在 Elasticsearch 的内容字段上:
http://elasticserver:9200/_search?q=content:covid
也许还可以查询关键字字段。
大部分使用标准内容视图:
curl $ESCREDENTIALS -s -XPUT $ESHOST/content -H 'Content-Type: application/json' -d
{
"settings": {
"index": {
"number_of_shards": 5,
"number_of_replicas": 0,
"refresh_interval": "60s"
}
},
"mappings": {
"_source": {
"enabled": true
},
"properties": {
"content": {
"type": "text",
"index": "true",
"store": true
},
"host": {
"type": "keyword",
"index": "true",
"store": true
},
"title": {
"type": "text",
"index": "true",
"store": true
},
"url": {
"type": "keyword",
"index": "false",
"store": true
},
"collections": {
"type": "keyword",
"index": "true",
"store": true
},
"last_modified": {
"type": "date",
"index": "false",
"store": true
},
"content_length": {
"type": "integer",
"index": "false",
"store": true
}
}
}
}'
【问题讨论】:
-
很高兴听到您正在使用 StormCrawler。您能否分享您用于内容索引的架构并举例说明您的 ES 查询是什么样的?
-
谢谢,Julien,在原始问题中添加了更多详细信息。
标签: elasticsearch stormcrawler