dsetool create_core

Creates the search index table on the local node.

Supports DSE authentication with [-l username -p password].

The CQL command to create a search index is CREATE SEARCH INDEX.

Restriction: Command is supported only on nodes with DSE Search workloads.

Auto-generated schemas have default DocValues enabled. See Creating a search index with default values for details on docValues.

If one or more nodes fail to create the search index in distributed operations, an error message indicates the failing node or nodes. If it failed to create the search index immediately, issue the create again. If it failed to create on some nodes, issue a reload for those nodes to load the newly created search index.

Synopsis

dsetool create_core keyspace_name.table_name
[coreOptions=yamlFile | coreOptionsInline=key1:value1\#key2:value2\#...]
[distributed=(true|false)]
[(generateResources=(true|false)] | schema=path solrconfig=path)]
[recovery=(true|false)]
[reindex=(true|false)]
Syntax conventions
Syntax conventions Description

UPPERCASE

Literal keyword.

Lowercase

Not literal.

Italics

Variable value. Replace with a valid option or user-defined value.

[ ]

Optional. Square brackets ( [ ] ) surround optional command arguments. Do not type the square brackets.

( )

Group. Parentheses ( ( ) ) identify a group to choose from. Do not type the parentheses.

|

Or. A vertical bar ( | ) separates alternative elements. Type any one of the elements. Do not type the vertical bar.

...

Repeatable. An ellipsis ( ... ) indicates that you can repeat the syntax element as often as required.

'Literal string'

Single quotation ( ' ) marks must surround literal strings in CQL statements. Use single quotation marks to preserve upper case.

{ key:value }

Map collection. Braces ( { } ) enclose map collections or key value pairs. A colon separates the key and the value.

<datatype1,datatype2>

Set, list, map, or tuple. Angle brackets ( < > ) enclose data types in a set, list, map, or tuple. Separate the data types with a comma.

cql_statement;

End CQL statement. A semicolon ( ; ) terminates all CQL statements.

[ -- ]

Separate the command line options from the command arguments with two hyphens ( -- ). This syntax is useful when arguments might be mistaken for command line options.

' <schema> …​ </schema> '

Search CQL only: Single quotation marks ( ' ) surround an entire XML schema declaration.

@xml_entity='xml_entity_type'

Search CQL only: Identify the entity and literal value to overwrite the XML element in the schema and solrconfig files.

keyspace_name.table_name

Required. The keyspace and table names of the search index. Keyspace and table names are case-sensitive. Enclose names that contain uppercase in double quotation marks.

coreOptions=yamlFile

When generateResources=true, specify a customized YAML-formatted file of options. The contents of the file are the same options that can be specified with coreOptionsInline.

coreOptionsInline=key1:value1#key2:value2#…​

Use this key-value pair syntax key1:value1#key2:value2# to specify values for these settings:

  • auto_soft_commit_max_time:ms

  • default_query_field:field

  • distributed:( true | false )

  • enable_string_copy_fields:( true | false )

  • exclude_columns: col1, col2, col3, …​

  • generate_DocValues_for_fields:( * | field1, field2, …​)

  • generateResources:( true | false )

recovery=( true | false )

Whether to delete and recreate the search index if it is not able to load due to corruption. Valid values:

  • true - If search index is unable to load, recover the index by deleting and recreating it.

  • false - Default.

    No recovery.

reindex=( true | false )

Whether to reindex the data when search indexes are auto-generated with generateResources=true. Reindexing works on a datacenter (DC) level. Reindex only once per search-enabled DC. Repeat the reindex command on other data centers as required.

Valid values:

  • true - Default. Reindexes the data. Accepts reads and keeps the current search index while the new index is building.

  • false - Does not reindex the data. You can check and customize search index resources before indexing.

schema=path

Path of the UTF-8 encoded search index schema file. Cannot be specified when generateResources=true.

To ensure that non-indexed fields in the table are retrievable by queries, you must include those fields in the schema file. For more information, see Solr single-pass CQL queries.

solrconfig=path

Path of the UTF-8 encoded search index configuration file. Cannot be specified when generateResources=true.

Examples

Automatically generate search index for the health_data table in the demo keyspace:

dsetool create_core demo.health_data generateResources=true

Override the default and reindex existing data, specify the reindex=false option:

dsetool create_core demo.health_data generateResources=true reindex=false

The generateResources=true option generates resources only if resources do not exist in the solr_resources table.

Use options in a YAML-formatted file

To turn on live indexing, also known as real-time (RT) indexing, the contents of the rt.yaml are rt: true:

dsetool create_core udt_ks.users generateResources=true coreOptions=rt.yaml

Enable encryption with inline options

Specify the class for directoryFactory to solr.EncryptedFSDirectoryFactory:

dsetool create_core keyspace_name.table_name generateResources=true coreOptionsInline="directory_factory_class:solr.EncryptedFSDirectoryFactory"
dsetool create_core demo.health_data generateResources=true coreOptionsInline="directory_factory_class:solr.EncryptedFSDirectoryFactory"

Use options in a YAML-formatted file

dsetool create_core demo.health_data coreOptions="directory_factory_class:solr.EncryptedFSDirectoryFactory"

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com