Does Solr have an API to read schema.xml?

Qing Zhang picture Qing Zhang · Aug 30, 2011 · Viewed 7.2k times · Source

Is there any Solr API to read the Solr schema.xml?

The reason I need it is that Solr faceting is not backwards compatible. If the index doesn't define field A, but the program tries to generate facets for field A, all the facets will fail. Therefore I need to check in the runtime what fields we have in the index, and generate the facets dynamically.

Answer

Edna picture Edna · Sep 18, 2013

Since Solr 4.2 the Schema REST API allows you to get the schema with :

http://localhost:8983/solr/schema

or with a core name :

http://localhost:8983/solr/mycorename/schema

Since Solr 4.4 you may also modify your schema.

more details on the Solr Wiki page