Apache Solr Schema API
Read and modify the schema of a collection
Read and modify the schema of a collection
openapi: 3.1.0
info:
title: Apache Solr HTTP Cluster Schema API
version: 9.x
description: 'A best-effort OpenAPI 3.1 description of selected endpoints from the Apache
Solr HTTP API, including the Collections (Cluster/Node Management), Schema,
and v2 cluster APIs. Solr''s full APIs are exposed as v1 (action-style query
parameters under `/solr/admin/*`) and v2 (resource-style paths under
`/api/*`). Authentication is optional but BasicAuth is supported when the
Solr `BasicAuthPlugin` is enabled.
'
contact:
name: Apache Solr
url: https://solr.apache.org/
license:
name: Apache-2.0
url: https://www.apache.org/licenses/LICENSE-2.0
servers:
- url: http://{host}:{port}
description: Default Solr server
variables:
host:
default: localhost
port:
default: '8983'
tags:
- name: Schema
description: Read and modify the schema of a collection
paths:
/solr/{collection}/schema:
parameters:
- name: collection
in: path
required: true
schema:
type: string
get:
tags:
- Schema
summary: Retrieve the entire schema of a collection
operationId: getSchema
parameters:
- name: wt
in: query
required: false
schema:
type: string
enum:
- json
- xml
- schema.xml
responses:
'200':
description: Schema document
content:
application/json:
schema:
type: object
post:
tags:
- Schema
summary: Execute schema modification commands
operationId: modifySchema
requestBody:
required: true
content:
application/json:
schema:
type: object
description: Schema modification commands (add-field, delete-field, replace-field, add-field-type, etc.)
responses:
'200':
description: Schema modified
/solr/{collection}/schema/fields:
parameters:
- name: collection
in: path
required: true
schema:
type: string
get:
tags:
- Schema
summary: List all fields
operationId: listFields
parameters:
- name: includeDynamic
in: query
required: false
schema:
type: boolean
- name: showDefaults
in: query
required: false
schema:
type: boolean
- name: fl
in: query
required: false
schema:
type: string
responses:
'200':
description: List of fields
content:
application/json:
schema:
type: object
/solr/{collection}/schema/fields/{fieldname}:
parameters:
- name: collection
in: path
required: true
schema:
type: string
- name: fieldname
in: path
required: true
schema:
type: string
get:
tags:
- Schema
summary: Retrieve a field definition
operationId: getField
responses:
'200':
description: Field definition
content:
application/json:
schema:
type: object
/solr/{collection}/schema/dynamicfields:
parameters:
- name: collection
in: path
required: true
schema:
type: string
get:
tags:
- Schema
summary: List dynamic field rules
operationId: listDynamicFields
responses:
'200':
description: Dynamic field rules
content:
application/json:
schema:
type: object
/solr/{collection}/schema/fieldtypes:
parameters:
- name: collection
in: path
required: true
schema:
type: string
get:
tags:
- Schema
summary: List field types
operationId: listFieldTypes
responses:
'200':
description: Field types
content:
application/json:
schema:
type: object
/solr/{collection}/schema/copyfields:
parameters:
- name: collection
in: path
required: true
schema:
type: string
get:
tags:
- Schema
summary: List copy field rules
operationId: listCopyFields
responses:
'200':
description: Copy field rules
content:
application/json:
schema:
type: object
/solr/{collection}/schema/uniquekey:
parameters:
- name: collection
in: path
required: true
schema:
type: string
get:
tags:
- Schema
summary: Get the unique key field name
operationId: getUniqueKey
responses:
'200':
description: Unique key field
content:
application/json:
schema:
type: object
components:
securitySchemes:
basicAuth:
type: http
scheme: basic
description: Enabled when Solr's BasicAuthPlugin is configured