Get Solr Schema in json

533 views Asked by At

I was wondering if it's possible to get the full schema or just the fields the schema defines in json format? Obviously I could scrape the page the schema is on

/solr/#/collection1/schema

Do a transformation and create my own json but if solr has a method built in :)

Thanks in advance

1

There are 1 answers

1
javanna On BEST ANSWER

You cannot get the schema.xml directly in JSON format but you can get the raw file from Solr instead of haveing to scrape the solr admin page that shows it. You can use this url, where collection1 is the name of your core:

http://localhost:8080/solr/collection1/admin/file?file=schema.xml&contentType=text/xml;charset=utf-8