SOLR Query result not showing new field

361 Views Asked by At

I have added a new sort field in schema.xml, uploaded DIHConfigFile.xml and Schema.xml in SOLR config.

<field name="recommendationRank" type="string" indexed="true" stored="true" multiValued="false" required="false"/>

After this I did run zkcli, restarted SOLR and zookeeper both and also reindexing in solr.

Sorting based on the new field do give me the results back but i dont see the new field itself in the response. http://localhost:48100/solr/MainSystem1/select?indent=on&q=:&sort=recommendationRank_EN_US%20desc&wt=json

Update for query result

{
  "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}}}}}
1

There are 1 best solutions below

6
On

the field name shown is recommendationRank and in your query you have recommendationRank_EN_USas sort option . Is that a copy field ?

I suggest you do a simple query to see if the document is populated correctly with the new field value after reindexing your docs or not.

say recommendationRank:xyz (some value which you will know as per you indexing logic from the source system).

Can you share the output of the above query with debugQuery=on for further debugging.

Also, i would suggest you enable docValue for the fields which you are using or plan to use for sort/facet/pivot/stat/highlighting etc to avoid high field cache and improve the query performance.