- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个动态文本字段 bar_*
在我的索引中,并希望 Solr 返回该字段的突出显示。所以我运行的是:
q=gold&hl=true&hl.fl=bar_*
hl.fl
添加更多字段它停止工作。例如。
q=gold&hl=true&hl.fl=bar_*,foo
bar_*
和 foo
字段在索引/架构中,这里没有错误。 q=gold&hl=true&hl.fl=bar_*&hl.fl=foo
或 q=gold&hl=true&hl.fl=bar_* foo
没有帮助。 hl.fl=*
.但这对性能不利。 最佳答案
我不知道使用的是什么版本,但似乎这是以前 Solr 版本的错误,我可以确认在 Solr 7.3 中它按预期工作。
curl -X GET \
'http://localhost:8983/solr/test/select?q=x_ggg:Test1%20OR%20bar_x:Test2&hl=true&hl.fl=%2A_ggg,foo,bar_%2A' \
-H 'cache-control: no-cache'
hl.fl=bar_*,foo,*_ggg
(使用
,
或空格作为分隔符)。
hl.fl
中删除星号时,这有助于避免长时间的调试。参数和按字段突出显示停止工作,因为该字段不再作为正则表达式处理。
org.apache.solr.highlight.SolrHighlighter#getHighlightFields
,
或空间:org.apache.solr.util.SolrPluginUtils#split
private final static Pattern splitList=Pattern.compile(",| ");
/** Split a value that may contain a comma, space of bar separated list. */
public static String[] split(String value){
return splitList.split(value.trim(), 0);
}
org.apache.solr.highlight.SolrHighlighter#expandWildcardsInHighlightFields
. hl.fl Specifies a list of fields to highlight. Accepts a comma- or space-delimited list of fields for which Solr should generate highlighted snippets.
A wildcard of * (asterisk) can be used to match field globs, such as text_* or even * to highlight on all fields where highlighting is possible. When using *, consider adding hl.requireFieldMatch=true.
When not defined, the defaults defined for the df query parameter will be used.
关于当存在动态字段时,Solr 突出显示不适用于多个字段 hl.fl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47690813/
有没有一种方法可以“标记”对象的属性,使它们在反射中“突出”? 例如: class A { int aa, b; string s1, s2; public int AA
我是一名优秀的程序员,十分优秀!