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. 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:

dsetool syntax

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

dsetool create_core keyspace.table generateResources=true [option ...]

This command preserves the case of keyspace and table names. You must use the correct case for the keyspace and table names.

User credentials can be provided in several ways, see Providing credentials for authentication.

The following example shows the dsetool method of automatically generating resources for the nhanes_ks keyspace and nhanes table used in the Tutorial: Basics:
$ dsetool create_core nhanes_ks.nhanes generateResources=true

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

During reindexing, a series of criteria routes sub-queries to the nodes most capable of handling them. See Shard routing for distributed queries.

DataStax Enterprise uses the type mapping in Mapping of Solr types 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.