I am running Solr 5.3.0 and I have created a new core using the command bin/solr create -c collection1.
However, I noticed there is no schema.xml file anywhere for that core in the collection1/conf folder.
Do I need to create the schema.xml from scratch each time I create a new core?
What is the best way to do this? Copy the one from {SOLR_INSTALLATION}/server/solr/configsets\basic_configs\conf and modify the schema.xml to suit my needs?
Thanks
Solr 5.3 by default will create a managed schema without a schema.xml; you will then need to create everything you need in it via REST calls to Solr. You can read more about it here.
If you wanted to have the actual schema file you will need to create your collection like so:
bin/solr create -c collection1 -d {SOLR_INSTALLATION}/server/solr/configsets/basic_configs
You can learn more about the options to create a collection by doing:
bin/solr create_collection help
Solr 5 creates schema automatically for you and it is known as managed schema In case you need to specify your own schema then you can use the below curl command
curl -X POST -H 'Content-type:application/json' --data-binary '{"add-field": {"name":"order_count", "type":"int", "multiValued":false, "stored":true}}'
name : the name of your column or field
type : data type of field
Similarly you can run curl commands for all the fields
You can run this command after creating your solr collection using solr create -c command
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With