我在schema.xml中添加了一个新的排序字段,在SOLR配置中上传了DIHConfigFile.xml和schema.xml。
<field name="recommendationRank" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
在这之后,我确实运行了zkcli,重新启动了SOLR和zookeeper,并在SOLR中重新索引。
基于新字段的排序确实会给我返回的结果,但我在响应中看不到新字段本身。http://localhost:48100/solr/MainSystem1/select?indent=on&q=:&sort=recommendationRank_EN_US%20desc&wt=json
更新查询结果
{
"responseHeader":{
"zkConnected":true,
"status":0,
"QTime":11,
"params":{
"q":"recommendationRank_EN_US:2",
"indent":"on",
"wt":"json",
"debugQuery":"on",
"_":"1638448595617"}},
"response":{"numFound":0,"start":0,"docs":[]
},
"debug":{
"rawquerystring":"recommendationRank_EN_US:2",
"querystring":"recommendationRank_EN_US:2",
"parsedquery":"recommendationRank_EN_US:2",
"parsedquery_toString":"recommendationRank_EN_US:`bu0000u0000u0000u0002",
"explain":{},
"QParser":"LuceneQParser",
"timing":{
"time":11.0,
"prepare":{
"time":0.0,
"query":{
"time":0.0},
"facet":{
"time":0.0},
"facet_module":{
"time":0.0},
"mlt":{
"time":0.0},
"highlight":{
"time":0.0},
"stats":{
"time":0.0},
"expand":{
"time":0.0},
"terms":{
"time":0.0},
"debug":{
"time":0.0}},
"process":{
"time":9.0,
"query":{
"time":8.0},
"facet":{
"time":0.0},
"facet_module":{
"time":0.0},
"mlt":{
"time":0.0},
"highlight":{
"time":0.0},
"stats":{
"time":0.0},
"expand":{
"time":0.0},
"terms":{
"time":0.0},
"debug":{
"time":1.0}}}}}
显示的字段名为recommendationRank
,在查询中您有recommendationRank_EN_US
作为排序选项。那是复制字段吗?
我建议您做一个简单的查询,看看在重新索引文档后,文档是否正确地填充了新的字段值。
比如recommendationRank:xyz(根据源系统的索引逻辑,您会知道一些值(。
您是否可以将上述查询的输出与debugQuery=on
共享,以便进一步调试。
此外,我建议您为正在使用或计划用于sort/facet/pivot/stat/高亮显示等的字段启用docValue,以避免高字段缓存并提高查询性能。