【问题标题】:Solr not returning highlighted resultsSolr 不返回突出显示的结果
【发布时间】:2021-05-12 10:01:54
【问题描述】:

我正在使用 nutch 1.15 和 solr 7.3,我按照文档 - https://lucene.apache.org/solr/guide/7_3/highlighting.html 跟踪搜索突出显示

对我来说,nutch solr 搜索的正常查询正在工作并且它正在返回结果: curl http://localhost:8983/solr/nutch/select?q=content:build&wt=json&rows=10000&start=0

通过搜索突出显示查询,我得到了相同的结果,但收到了警告。- hl.q=content:build: not found

带有高亮参数的查询如下 - curl http://localhost:8983/solr/nutch/select?q=content:build&hl=on&hl.q=content:build&wt=json&rows=10000&start=0

查看完整回复 -

$ curl http://localhost:8983/solr/nutch/select?q=content:build&hl=on&hl.q=content:build&wt=json&rows=10000&start=0
-sh: 8: hl.q=content:build: not found
[3]   Done(127)                  hl.q=content:build
[2]   Done                       curl http://localhost:8983/solr/nutch/select?q=content:build
$ {
  "responseHeader":{
    "status":0,
    "QTime":1,
    "params":{
      "q":"content:build"}},
  "response":{"numFound":2,"start":0,"docs":[
      {
        "digest":"ff0d20368525b3a0f14933eddb0809db",
        "boost":1.0151907,
        "id":"https://dummy_url",
        "title":"dummy title",
        "content":"dummy content",
        "_version_":1691148343590256640},
      {
        "digest":"4fd333469ed5d83ad08eaa7ef0b779c4",
        "boost":1.0151907,
        "id":"https://dummy_url1",
        "title":"dummy title1",
        "content":"dummy content1",
        "_version_":1691148343603888128}]
  }}

有人知道如何解决这个问题吗?我在 nutch 和 solr 日志中没有收到任何错误。

【问题讨论】:

    标签: solr web-crawler highlight nutch


    【解决方案1】:

    您没有运行您认为正在运行的命令 - & 向 shell 发出该命令应该在后台运行的信号,因此实际上发生的是您正在运行多个命令:

    curl http://localhost:8983/solr/nutch/select?q=content:build
    
    hl=on
    hl.q=content:build 
    wt=json
    rows=10000
    start=0
    

    这不是你打算做的。您可以将 URL 包含在引号 (") 中或转义 & 符号:

    curl "http://localhost:8983/solr/nutch/select?q=content:build&hl=on&hl.q=content:build&wt=json&rows=10000&start=0"
    
    # or
    
    curl http://localhost:8983/solr/nutch/select? q=content:build\&hl=on\&hl.q=content:build\&wt=json\&rows=10000\&start=0
    

    【讨论】:

      猜你喜欢
      • 2011-08-06
      • 1970-01-01
      • 1970-01-01
      • 2012-12-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多