【问题标题】:Solr result is not highlighting on a particular wordSolr 结果未突出显示特定单词
【发布时间】:2014-01-03 21:12:45
【问题描述】:

我们在我们的应用程序中使用 solr 作为搜索引擎。 为了突出显示,我们依赖于 solr 结果。

查询传递给 solr 以突出显示

hl.q=AddressLine1%3a(Puthanmadhom)+PartyNameBusiness%3a(Puthanmadhom)+AddressState%3a(All)+&q.op=OR&hl=true&hl.fl=*&hl.requireFieldMatch=true&hl.simple.pre=%3cb%3e&hl.simple.post=%3c%2fb%3e

这里的“Puthanmadhom”一词在 solr 结果中没有突出显示。但几乎所有其他词都可以正常工作。甚至“Puthanmad”也能正确突出显示。

欢迎任何可能的失败原因。

谢谢, 瓦伦

【问题讨论】:

  • 你是说这个查询有效吗? hl.q=AddressLine1%3a(Puthanmad)+PartyNameBusiness%3a(Puthanmad)+AddressState%3a(All)+&q.op=OR&hl=true&hl.fl=*&hl.requireFieldMatch=true&hl.simple.pre=%3cb%3e&hl .simple.post=%3c%2fb%3e
  • 没错。如果我删除“hom”,突出显示正在发生。

标签: solr


【解决方案1】:
hl.q=AddressLine1%3a(Puthanmadhom)+PartyNameBusiness%3a(Puthanmadhom)+AddressState%3a(All)+&q.op=OR&hl=true&hl.fl=*&hl.requireFieldMatch=true&hl.simple.pre=%3cb%3e&hl.simple.post=%3c%2fb%3e

此查询字符串在“...(All)+&q.op...”之后被一个额外的空格打破。更改为“...(All)&q.op...”,它应该可以工作。

【讨论】:

  • 删除了额外的“+”,结果仍然没有变化。
  • 我希望这些术语的标准 solr 查询也不会产生任何结果。这是真的吗?
猜你喜欢
  • 1970-01-01
  • 2016-01-19
  • 1970-01-01
  • 1970-01-01
  • 2012-10-30
  • 2019-06-24
  • 2015-01-10
  • 2014-03-08
  • 2021-05-12
相关资源
最近更新 更多