簡體   English   中英

Solr 不返回突出顯示的結果

[英]Solr not returning highlighted results

I am using nutch 1.15 and solr 7.3, and I followed search highlight as per doc - 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 日志中沒有收到任何錯誤。

您沒有運行您認為正在運行的命令 - &向 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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM