Creating a core with automatic resource generation 

An existing CQL table is required to create a core with automatic resource generation. Options are available to generate resources automatically.

The prerequisite for creating a core with automatic resource generation is an existing CQL table. DSE Search automatically generates default solrconfig.xml and schema.xml files that are based on the table metadata. After you generate the resources, you can make configuration changes in the solrconfig.xml file.

You can generate resources automatically, using an HTTP POST request or a dsetool command and the generateResources option.

The following list describes the options for generating resources automatically.
Option Settings Default Description of default setting
coreOptions path to a YAML file not applicable Path to a YAML file that provides options for generating the solrconfig and schema.
deleteAll= true or false false Setting reindex=true and deleteAll=true re-indexes data in place or re-indexes in full. Accepting the defaults reloads the core and no re-indexing occurs. Setting reindex=true and deleteAll=false re-indexes data and keeps the existing Lucene index. During the uploading process, user searches yield inaccurate results.
distributed= true or false true
  • true distributes an index to nodes in the local data center.
  • false re-indexes the Solr data on one node. The false setting is used in certain recovery and upgrade procedures.
generateResources= true or false true Generates the schema and solrconfig. Cannot be used with schema= or solrconfig=.
reindex= true or false false Deletes any existing Lucene index and indexes the data for the first time, or re-indexes the data.
schema= <path> n/a Path of the schema file used for creating the core. Cannot be specified when generateResources=true.
solrconfig= <path> n/a Path of the solrconfig file used for creating the core. Cannot be specified when generateResources=true.

dsetool syntax

The dsetool syntax for generating resources automatically and creating the Solr core is:

$ dsetool create_core <keyspace>.<table> [<option> ...]
$ dsetool create_core keyspace.table generateResources=true [option ...]

By default, when you automatically generate resources, existing data is not re-indexed. You can check and customize the resources before indexing.

See dsetool create_core for details on command options.

To override the default and re-index existing data, use the reindex=true option:

$ dsetool create_core nhanes_ks.nhanes generateResources=true reindex=true


$ curl "http://localhost:8983/solr/admin/cores?action=CREATE&name=nhanes_ks.nhanes&generateResources=true&reindex=true"

DataStax Enterprise uses type mapping to generate the CQL-based core and resources. To generate resources automatically, the CQL table can consist of keys and columns of any CQL data type. However, decimal and varint are indexed as strings. Lucene does not support the precision required by these numeric types. Range and sorting queries do not work as expected if a table uses these types.

Note: If one or more nodes fail to create the core in distributed operations, an error message indicates a list of the failing node or nodes. Distributed operations fail if the core creation or core reload fails on one of the nodes. To solve the problem, follow the resolution steps in the error message. For example, if a core creation or core reload succeeds in all nodes except one, an error message suggests a core reload to solve the issue. The error message includes the failing node or nodes.