【问题标题】:Prioritized search results?优先搜索结果?
【发布时间】: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


【解决方案1】:

stormcrawler 忽略它以优先处理结果

SC 不处理搜索,这完全由您以您认为合适的任何方式进行管理。 SC 填充 content 索引,然后您可以将其查询到您心中的内容。想使用关键字?当然,使用包含 keywords:* 查询的布尔查询来查询索引。

也许您使用 Kibana 来显示结果?它对于调试很有用,但大多数人倾向于使用他们自己的 UI 查询和显示来自 ES 的结果,并构建查询以包含他们拥有的所有字段。

【讨论】:

    猜你喜欢
    • 2019-05-21
    • 2013-11-28
    • 1970-01-01
    • 2013-04-25
    • 2011-01-31
    • 1970-01-01
    • 1970-01-01
    • 2020-05-05
    • 1970-01-01
    相关资源
    最近更新 更多