Search code examples
indexingsolrluceneapache-zookeepersolrcloud

Modifying fields(index) in solrcloud after loading data


solr - solr-8.9.0, java version "11.0.12" 2021-07-20 LTS I am using external zookeeper ensemble with 3 apache zookeeper instance (apache-zookeeper-3.6.1-bin.tar.gz) Solr cloud have been setup on 2 different machines (means 2 solr nodes on different machines) with 3 zookeeper instances.

Successfully uploaded configs to zookeepre using following command.

./server/scripts/cloud-scripts/zkcli.sh -zkhost <Node1 IP>:2181,<Node2 IP>:2181,<Node3 IP>:2181 -cmd upconfig -confname renametoyourname_configs -confdir solr8.9.0/server/solr/configsets/<renametoyourname_configs>/conf

Finally i have created the collections

http://<Node1 IP>:8983/solr/admin/collections?action=CREATE&name=<myCollection>&numShards=10&replicationFactor=1&maxShardsPerNode=5&collection.configName= renametoyourname_configs

After that i have loaded multiple .csv files in solr one by one using following command

curl "http://localhost:8983/solr/$solrCollection/update?commit=true" --data-binary @/home/data/solrcloud/files/testDir/xaf.tmp -H 'Content-type:application/csv'

All .csv filess have 100 million rows. Each .csv file contains 12 columns, in which firstColumn,secondColumn have been defined with index as true while uploading configs to zookeeper.

To do this i have modified managed-schema(present at /solr-8.9.0/server/solr/configsets/_default/conf/managed-schema) before uploading 'renametoyourname_configs' to zookeeper.

 <field name="FirstColumn" type="text_general" multiValued="false" indexed="true" stored="true"/>
 <field name="SecondColumn" type="plong" multiValued="false" indexed="true" stored="true"/>
 <field name="ThirdColumn" type="text_general" multiValued="false" indexed="false" stored="true"/>
 <field name="FourthColumn" type="text_general" multiValued="false" indexed="false" stored="true"/>
 ...so on

Now after loading 100milion rows in solr, I want to create index on ThirdColumn also. How can i do that?


Solution

  • You will have to again index the data. There is no shortcut to this.