Creating a core with automatic resource generation
An existing CQL table is required to create a core with automatic resource generation. Several options are available to generate resources automatically.
Option | Settings | Default | Description of Default Setting |
---|---|---|---|
schema= | <path> | n/a | Path of the schema file used for creating the core, not necessary when generateResources=true |
solrconfig= | <path> | n/a | Path of the solrconfig file used for creating the core, not necessary when generateResources=true |
generateResources= | true or false | true | Generates the schema and solrconfig. |
distributed= | true or false | true | Distributes an index to nodes in the cluster. False re-indexes the Solr data on one node. The false setting is used in certain recovery and upgrade procedures. |
recovery= | true or false | false | Used in upgrade situations. |
reindex= | true or false | false | Deletes any existing Lucene index and indexes the data for the first time, or re-indexes the data. |
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. |
coreOptions | path to a YAML file | not applicable | Path to a YAML file that provides options for generating the solrconfig and schema. |
The dsetool syntax for generating resources automatically and creating the Solr core is:
$ dsetool create_core <keyspace>.<table> [<option> ...]
$ dsetool create_core nhanes_ks.nhanes generateResources=true
or
$ curl "http://localhost:8983/solr/admin/cores?action=CREATE&name=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.
To override the default and reindex existing data, use the reindex=true option:
$ dsetool create_core nhanes_ks.nhanes generateResources=true reindex=true
or
$ curl "http://localhost:8983/solr/admin/cores?action=CREATE&name=nhanes_ks.nhanes&generateResources=true&reindex=true"
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.