如何解决Solr 不返回突出显示的结果
我使用的是 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","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
这不是你打算做的。您可以将网址括在引号 ("
) 中或转义符号:
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
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。