Configsets API | Apache Solr Reference Guide 8.6.1 Apache Solr Reference Guide About This Guide Getting Started Solr Tutorial A Quick Overview Solr System Requirements Installing Solr Deployment and Operations Solr Control Script Reference Solr Configuration Files Taking Solr to Production Making and Restoring Backups Running Solr on HDFS SolrCloud on AWS EC2 Upgrading a Solr Cluster IndexUpgraderTool Solr Upgrade Notes Major Changes in Solr 8 Major Changes in Solr 7 Major Changes from Solr 5 to Solr 6 Using the Solr Administration User Interface Overview of the Solr Admin UI Logging Cloud Screens Collections / Core Admin Java Properties Thread Dump Suggestions Screen Collection-Specific Tools Analysis Screen Dataimport Screen Documents Screen Files Screen Query Screen Stream Screen Schema Browser Screen Core-Specific Tools Ping Plugins & Stats Screen Replication Screen Segments Info Documents, Fields, and Schema Design Overview of Documents, Fields, and Schema Design Solr Field Types Field Type Definitions and Properties Field Types Included with Solr Working with Currencies and Exchange Rates Working with Dates Working with Enum Fields Working with External Files and Processes Field Properties by Use Case Defining Fields Copying Fields Dynamic Fields Other Schema Elements Schema API Putting the Pieces Together DocValues Schemaless Mode Understanding Analyzers, Tokenizers, and Filters Analyzers About Tokenizers About Filters Tokenizers Filter Descriptions CharFilterFactories Language Analysis Phonetic Matching Running Your Analyzer Indexing and Basic Data Operations Introduction to Solr Indexing Post Tool Uploading Data with Index Handlers Transforming and Indexing Custom JSON Indexing Nested Child Documents Uploading Data with Solr Cell using Apache Tika Uploading Structured Data Store Data with the Data Import Handler Updating Parts of Documents Detecting Languages During Indexing De-Duplication Content Streams Reindexing Searching Overview of Searching in Solr Velocity Search UI Relevance Query Syntax and Parsing Common Query Parameters The Standard Query Parser The DisMax Query Parser The Extended DisMax (eDismax) Query Parser Function Queries Local Parameters in Queries Other Parsers JSON Request API JSON Query DSL JSON Facet API JSON Faceting Domain Changes Faceting BlockJoin Faceting Highlighting Spell Checking Query Re-Ranking Learning To Rank Transforming Result Documents Searching Nested Child Documents Suggester MoreLikeThis Pagination of Results Collapse and Expand Results Result Grouping Result Clustering Spatial Search The Terms Component The Term Vector Component The Stats Component The Query Elevation Component The Tagger Handler Response Writers Velocity Response Writer Near Real Time Searching RealTime Get Exporting Result Sets Parallel SQL Interface Solr JDBC - DbVisualizer Solr JDBC - SQuirreL SQL Solr JDBC - Apache Zeppelin Solr JDBC - Python/Jython Solr JDBC - R Analytics Component Analytics Expression Sources Analytics Mapping Functions Analytics Reduction Functions Streaming Expressions Stream Source Reference Stream Decorator Reference Stream Evaluator Reference Math Expressions Scalar Math Vector Math Variables Matrices and Matrix Math Streams and Vectorization Text Analysis and Term Vectors Statistics Probability Distributions Monte Carlo Simulations Time Series Linear Regression Interpolation, Derivatives and Integrals Curve Fitting Digital Signal Processing Machine Learning Computational Geometry Graph Traversal Stream Request Handler API SolrCloud Getting Started with SolrCloud How SolrCloud Works Shards and Indexing Data in SolrCloud Distributed Requests Aliases SolrCloud Resilience SolrCloud Recoveries and Write Tolerance SolrCloud Query Routing And Read Tolerance SolrCloud Configuration and Parameters Setting Up an External ZooKeeper Ensemble Using ZooKeeper to Manage Configuration Files Collections API Cluster and Node Managment Commands Collection Management Commands Collection Aliasing Shard Management Commands Replica Management Commands Parameter Reference Command Line Utilities SolrCloud with Legacy Configuration Files Configsets API Rule-based Replica Placement Cross Data Center Replication (CDCR) CDCR Architecture CDCR Configuration Cross Data Center Replication Operations CDCR API SolrCloud Autoscaling Overview of SolrCloud Autoscaling Autoscaling Policy and Preferences SolrCloud Autoscaling Triggers SolrCloud Autoscaling Trigger Actions SolrCloud Autoscaling Listeners SolrCloud Autoscaling Automatically Adding Replicas SolrCloud Autoscaling Fault Tolerance Autoscaling API Migrating Rule-Based Replica Rules to Autoscaling Policies Colocating Collections Legacy Scaling and Distribution Introduction to Scaling and Distribution Distributed Search with Index Sharding Index Replication Combining Distribution and Replication Merging Indexes Solr Plugins Lib Directories and Directives Package Management Package Manager Internals Adding Custom Plugins in SolrCloud Mode The Well-Configured Solr Instance Configuring solrconfig.xml DataDir and DirectoryFactory in SolrConfig Schema Factory Definition in SolrConfig IndexConfig in SolrConfig RequestHandlers and SearchComponents in SolrConfig InitParams in SolrConfig UpdateHandlers in SolrConfig Query Settings in SolrConfig RequestDispatcher in SolrConfig Update Request Processors Codec Factory Solr Cores and solr.xml Format of solr.xml Defining core.properties CoreAdmin API Configsets Resource Loading Configuration APIs Blob Store API Config API Request Parameters API Managed Resources Implicit RequestHandlers JVM Settings v2 API Monitoring Solr Metrics Reporting Metrics History MBean Request Handler Configuring Logging Using JMX with Solr Monitoring Solr with Prometheus and Grafana Performance Statistics Reference Distributed Solr Tracing Securing Solr Configuring Authentication, Authorization and Audit Logging Basic Authentication Plugin Hadoop Authentication Plugin Kerberos Authentication Plugin Rule-Based Authorization Plugins JWT Authentication Plugin Enabling SSL Audit Logging ZooKeeper Access Control Client APIs Introduction to Client APIs Choosing an Output Format Using SolrJ Using JavaScript Using Python Using Solr From Ruby Other Clients Further Assistance Solr Glossary Errata How to Contribute to Solr Documentation Solr 8.6 Solr Website Other Formats Archived PDFs Other Versions Online Solr Resources Solr Javadocs Lucene/Solr Source Code Solr Community Links Configsets API List Configsets Upload a Configset Create a Configset Delete a Configset The Configsets API enables you to upload new configsets to ZooKeeper, create, and delete configsets when Solr is running SolrCloud mode. Configsets are a collection of configuration files such as solrconfig.xml, synonyms.txt, the schema, language-specific files, DIH-related configuration, and other collection-level configuration files (everything that normally lives in the conf directory). Solr ships with two example configsets (_default and sample_techproducts_configs) which can be used when creating collections. Using the same concept, you can create your own configsets and make them available when creating collections. This API provides a way to upload configuration files to ZooKeeper and share the same set of configuration files between two or more collections. Once a configset has been uploaded to ZooKeeper, use the configset name when creating the collection with the Collections API and the collection will use your configuration files. Configsets do not have to be shared between collections if they are uploaded with this API, but this API makes it easier to do so if you wish. An alternative to uploading your configsets in advance would be to put the configuration files into a directory under server/solr/configsets and using the directory name as the -d parameter when using bin/solr create to create a collection. This API can only be used with Solr running in SolrCloud mode. If you are not running Solr in SolrCloud mode but would still like to use shared configurations, please see the section Configsets. The API works by passing commands to the configs endpoint. The path to the endpoint varies depending on the API being used: the v1 API uses solr/admin/configs, while the v2 API uses api/cluster/configs. Examples of both types are provided below. List Configsets The list command fetches the names of the configsets that are available for use during collection creation. V1 API With the v1 API, the list command must be capitalized as LIST: http://localhost:8983/solr/admin/configs?action=LIST&omitHeader=true V2 API With the v2 API, the list command is implied when there is no data sent with the request. http://localhost:8983/api/cluster/configs?omitHeader=true The output will look like: { "configSets": [ "_default", "techproducts", "gettingstarted" ] } Upload a Configset Upload a configset, which is sent as a zipped file. This functionality is enabled by default, but can be disabled via a runtime parameter -Dconfigset.upload.enabled=false. Disabling this feature is advisable if you want to expose Solr installation to untrusted users (even though you should never do that!). A configset is uploaded in a "trusted" mode if authentication is enabled and the upload operation is performed as an authenticated request. Without authentication, a configset is uploaded in an "untrusted" mode. Upon creation of a collection using an "untrusted" configset, the following functionality will not work: If specified in the configset, the DataImportHandler’s ScriptTransformer will not initialize. The XSLT transformer (tr parameter) cannot be used at request processing time. If specified in the configset, the StatelessScriptUpdateProcessor will not initialize. Collections won’t initialize if directives are used in the configset. (Note: Libraries added to Solr’s classpath don’t need the directive) If you use any of these parameters or features, you must have enabled security features in your Solr installation and you must upload the configset as an authenticated user. The upload command takes one parameter: name The configset to be created when the upload is complete. This parameter is required. The body of the request should be a zip file that contains the configset. The zip file must be created from within the conf directory (i.e., solrconfig.xml must be the top level entry in the zip file). Here is an example on how to create the zip file named "myconfig.zip" and upload it as a configset named "myConfigSet": $ (cd solr/server/solr/configsets/sample_techproducts_configs/conf && zip -r - *) > myconfigset.zip $ curl -X POST --header "Content-Type:application/octet-stream" --data-binary @myconfigset.zip "http://localhost:8983/solr/admin/configs?action=UPLOAD&name=myConfigSet" The same can be achieved using a Unix pipe with a single request as follows: $ (cd server/solr/configsets/sample_techproducts_configs/conf && zip -r - *) | curl -X POST --header "Content-Type:application/octet-stream" --data-binary @- "http://localhost:8983/solr/admin/configs?action=UPLOAD&name=myConfigSet" The UPLOAD command does not yet have a v2 equivalent API. Create a Configset The create command creates a new configset based on a configset that has been previously uploaded. If you have not yet uploaded any configsets, see the Upload a Configset command above. The following parameters are supported when creating a configset. name The configset to be created. This parameter is required. baseConfigSet The name of the configset to copy as a base. This defaults to _default configSetProp.property=value A configset property from the base configset to override in the copied configset. For example, to create a configset named "myConfigset" based on a previously defined "predefinedTemplate" configset, overriding the immutable property to false. V1 API With the v1 API, the create command must be capitalized as CREATE: http://localhost:8983/solr/admin/configs?action=CREATE&name=myConfigSet&baseConfigSet=predefinedTemplate&configSetProp.immutable=false&wt=xml&omitHeader=true V2 API With the v2 API, the create command is provided as part of the JSON data that contains the required parameters: curl -X POST -H 'Content-type: application/json' -d '{ "create":{ "name": "myConfigSet", "baseConfigSet": "predefinedTemplate", "configSetProp.immutable": "false"}}' http://localhost:8983/api/cluster/configs?omitHeader=true Output 0 323 Delete a Configset The delete command removes a configset. It does not remove any collections that were created with the configset. name The configset to be deleted. This parameter is required. To delete a configset named "myConfigSet": V1 API With the v1 API, the delete command must be capitalized as DELETE. The name of the configset to delete is provided with the name parameter: http://localhost:8983/solr/admin/configs?action=DELETE&name=myConfigSet&omitHeader=true V2 API With the v2 API, the delete command is provided as the request method, as in -X DELETE. The name of the configset to delete is provided as a path parameter: curl -X DELETE http://localhost:8983/api/cluster/configs/myConfigSet?omitHeader=true Output 0 170 SolrCloud with Legacy Configuration Files Rule-based Replica Placement ©2020 Apache Software Foundation. All rights reserved. Site Version: 8.6.1 Site last generated: 2020-08-14