Acquia Search powered by SearchStax does not support the upload of schema or configset files. To update Solr schema, you must use Solr Schema API.
Access to Schema API may be restricted to Premier or Premier Plus subscription tiers.
For advanced changes, use Solr Schema API by sending POST requests to the /schema/ endpoint with the authentication token of the account. For more information, visit Solr Schema API documentation.
Send these commands as JSON in a POST request to /schema/:
Command | Description |
|---|---|
| Adds a new field. |
| Deletes a field. |
| Replaces an existing field with a new configuration. |
| Adds a new dynamic field rule. |
| Deletes a dynamic field rule. |
| Replaces an existing dynamic field rule. |
| Adds a new field type. |
| Deletes a field type. |
| Replaces an existing field type. |
| Adds a new copy field rule. |
| Deletes a copy field rule. |
You can include multiple commands in a single POST request. The system handles them in the specified order.
All Schema API requests require an authorization token. Obtain the token from the Search API section on the SearchStax application dashboard. For additional information, refer to SearchStax Studio Search API.
Retrieve the current field type definition
To obtain the existing definition, run this curl command:
curl -H "Authorization: Token YOUR_AUTH_TOKEN" \
"https://YOUR_SEARCHSTAX_ENDPOINT/schema/fieldtypes/text_unstemmed_sv?wt=json"The command returns the full field type definition including analyzers and tokenizers:
{
"fieldType": {
"name": "text_unstemmed_sv",
"class": "solr.TextField",
"positionIncrementGap": "100",
"queryAnalyzer": {
"tokenizer": {
"class": "solr.WhitespaceTokenizerFactory"
}
}
}
}POST the updated definition
To change the tokenizer from WhitespaceTokenizerFactory to StandardTokenizerFactory, use the replace-field-type command to send the full updated field type definition:
curl -X POST \
-H "Authorization: Token YOUR_AUTH_TOKEN" \
"https://YOUR_SEARCHSTAX_ENDPOINT/schema" \
-d '{
"replace-field-type": {
"name": "text_unstemmed_sv",
"class": "solr.TextField",
"positionIncrementGap": "100",
"queryAnalyzer": {
"tokenizer": {
"class": "solr.StandardTokenizerFactory"
}
}
}
}'A successful response returns:
{
"responseHeader": {
"status": 0,
"QTime": 3565
}
}Run the GET request from step 1 again to ensure that the change is correct.
SearchStax provides a Python-based schema management tool that wraps the Schema API for common operations. Access the tool at: https://github.com/searchstax/searchstax-schema-management/.
This tool might not support all use cases. For example, to change tokenizers, you must use direct API calls.