Mastering Schema API
Schema API is the one-stop shop for most operations on your schema. It provides a REST-like HTTP API for doing all these operations.
You can read, write, or delete dynamic fields, fields, copy field rules, and field types.
Note
Do not manually write any changes into the managed-schema
file yourself. This will work only as long as you don't use Schema API. If you use Schema API by mistake, all your changes might be overwritten. So, it is highly recommend that you leave your managed-schema
file alone.
The response of the API call is of either JSON or XML format.
Assuming that you are using the gettingstarted
collection, the base address of API will be http://localhost:8983/solr/gettingstarted
.
Note
Always reindex once you use Schema API for modifications. Only then will the changes that you have applied to the schema be reflected for existing documents that are already indexed.
Schema API in detail
Let's see some of the important schema endpoints. We will do all the examples...