Warm tip: This article is reproduced from serverfault.com, please click

How to update Field Name in Solr Collection?

发布于 2020-12-14 06:53:50

I have a solr indexed data as below. My requirement is to update the field name MATERIAL_DOCUMENT_YEAR which is actually a date to MATERIAL_DOCUMENT_DATE. The data is in Millions, which will take more time to re-index.

Is there any way from Solr UI to update the field name, without re-indexing the whole data?

{
  "responseHeader":{
    "zkConnected":true,
    "status":0,
    "QTime":39,
    "params":{
      "q":"SOLR_DATA",
      "_":"1607925693065"}},
  "response":{"numFound":129500000,"start":0,"maxScore":5.632038,"docs":[
      {
        "PLANT":["HYD"],
        "STOCK_TYPE":[""],
        "Table_Name":["TBL_MATERIAL_DOC_DISPLAY"],
        "MATERIAL_DOCUMENT_YEAR":["20140312"],
        "MATERIAL_DESCRIPTION":["T-SHIRT-XXL"],
        "MATERIAL_DOCUMENT_NUMBER":["12345678"],
        "MOVEMENT_TYPE":["123"],
        "COST_CENTER":[""],
Questioner
Pranav
Viewed
0
Abhijit Bashetti 2020-12-17 10:08:41

There is no way to rename the field without re-indexing and modifying the the schema.xml May be you can add another field with correct name. once it is added for all the fields then you can remove the earlier incorrect field.

Second option would be create another collection with correct field names. Once all the data is up to date in new collection then you can create an alias to it with earlier collection name.

Once done with all the above you can then remove the older index...