Simon
Simon

Reputation: 1117

Which schema.xml file edit in Solr?

I downloaded a Solr package from here: http://lucene.apache.org/solr/mirrors-solr-latest-redir.html

I want to create a new field in schema.xml file, but I don't know in which one - in downloaded folder there are 7 schema.xml files.

I edited all of this files, but nothing changed.

Where should I add a new field definition?

Upvotes: 2

Views: 1699

Answers (2)

Ajay K
Ajay K

Reputation: 446

Create a solr instance by running a command from the command prompt solr create -c test Here test is the collection name.Copy schema.xml and solrconfig.xml from techproducts project folder to conf folder of the test project.Now you can define your schema in the schema.xml.

Upvotes: 1

Václav Blažej
Václav Blažej

Reputation: 117

If you have standard distribution (http://lucene.apache.org/solr/mirrors-solr-latest-redir.html) you can find your cores at solr-5.2.1/server/solr

One problem you might face is that you don't have any cores defined yet. If that is a case copy solr-5.2.1\server\solr\configsets\basic_configs to solr-5.2.1\server\solr\my_new_core (rename folder) - congratz, you defined a new core.

Now run the server: run in command line solr-5.2.1\bin\solr with parameter start. Open in your browser: http://localhost:8983/solr/#/~cores/example_core and Add core with instanceDir = my_new_core. This initializes your core - makes it fully functional.

Now you can find solr-5.2.1\server\solr\example_core\conf\solrconfig.xml and configure it as you will. After changing solrconfig.xml remember to reload core at Core Admin.

Upvotes: 1

Related Questions