Search code examples
solrapache-zookeepersolrcloudsolrnet

Want to add new search field in Solr Search


We are using Solr 5.2.1 with Zookeeper 3.4.6.

We would like to add an extra search field in the solr search schema, for that we have added filed in schema.xml however it is not reflecting to the solr index.

We have also tried below things - 1. Started Zookeeper as well as solr services. 2. Tried to reload the core

Could you please share what we need to do fix this issue?

Thank You in advance.

Bhagwat Mane


Solution

  • Thank You Pihentagyu,

    Short steps for above discussion -

    Considering :

    • You are running solr in cloud mode with Zookeeper
    • You are using schemaFactory as ManagedIndexSchemaFactory in the solrconfig.xml file

    Follow below steps to reflect changes made in schema.xml to zookeeper configuration -

    For Windows

    1. Execute - zkcli.bat -cmd upconfig -confdir "C:\path to solr directory\solr\configsets\asi_configs\conf" -confname PRODSEARCH -z 10.0.0.223:2181
    2. Then you need to clear managed-schema to reflect changes from schema.xml to managed-schema. To clear managed-schema execute - zkcli.bat -cmd clear -z 10.0.0.223:2181 /configs/PRODSEARCH/managed-schema
    3. Last step to restart Solr and Zookeeper services.

    Where

    • zkcli.bat - is present in "solr\server\scripts\cloud-scripts"
    • PRODSEARCH - is name of config, you can get it from Solr Admin UI under Cloud\Tree\configs\confname

    Note : use zkcli.sh for linux.