0

我在 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:`\b\u0000\u0000\u0000\u0002",
    "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}}}}}
4

1 回答 1

1

显示的字段名称是recommendationRank,在您的查询中,您有recommendationRank_EN_US排序选项。那是一个复制字段吗?

我建议你做一个简单的查询,看看在重新索引你的文档后,文档是否正确地填充了新的字段值。

说推荐等级:xyz(根据您从源系统中的索引逻辑您将知道的一些值)。

您能否分享上述查询的输出以debugQuery=on进行进一步调试。

另外,我建议您为您正在使用或计划用于排序/分面/数据透视/统计/突出显示等的字段启用 docValue,以避免高字段缓存并提高查询性能。

于 2021-12-03T08:40:31.183 回答