Use the CQL shell command DESCRIBE SEARCH INDEX to view the pending
and active search index. Use the RELOAD SEARCH INDEX command to apply
changes to the active configuration.
Restriction: Command available only on DSE Search nodes.
Running search index management commands on large datasets can take longer than
the CQLSH default timeout of 10 minutes. Increase the CQLSH
client timeout as required.
Synopsis
ALTER SEARCH INDEX CONFIG ON [keyspace_name.]table_name
( ADD element_path [ attribute_list ] WITH $$ json_map $$
| SET element_identifier = 'value'
| SET shortcut = value
| DROP element_identifier
| DROP shortcut ) ;
Table 1. Legend
Syntax conventions
Description
UPPERCASE
Literal keyword.
Lowercase
Not literal.
Italics
Variable value. Replace with a 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
Identifies the table of the search index; keyspace name is required when the
table is not in the active keyspace.
element_path
Identifies the XML path to the setting. Separate child elements using a
period. For
example:
types.fieldTypes
attribute_list
A comma-separated list of attributes value pairs enclosed in braces using
the following
syntax:
Identifies the XML path to the setting. To locate an element with specific
attribute, use the following syntax.
element_name[@attribute_name='value']
shortcut
Shortcuts to configuration element values using
SET:
autoCommitTime Default value is 10000.
defaultQueryField Name of the field. Default
not set.
Note: Use SET to add. Use DROP to remove.
directoryFactory Can be used as an alternative
to the directoryFactoryClass option. The options are:
'standard'
'encrypted'
filterCacheLowWaterMark Default is 1024.
filterCacheHighWaterMark Default is 2048.
directoryFactoryClass Specifies the
fully-qualified name of the directory factory. Use in place of
the directoryFactory option for directory factories other than
the standard or encrypted directory factory.
mergeMaxThreadCount Must configure with
mergeMaxMergeCount. The default is the number of tpc_cores as configured in
cassandra.yaml.
mergeMaxMergeCount Must configure with
mergeMaxThreadCount. The default calculated value is:
ALTER SEARCH INDEX CONFIG
ON cycling.comments
ADD requestHandler[@name='/elevate',@class='solr.SearchHandler', @startup='lazy']
WITH $$ {"defaults":[{"echoParams":"explicit"}],"last-components":["elevator"]} $$;
Reload the search
index:
RELOAD SEARCH INDEX
ON cycling.comments;
which adds the requestHandler element to the
config:
To extend TieredMergePolicy to support automatic removal of
deletes:
ALTER SEARCH INDEX CONFIG
ON cycling.comments
SET indexConfig.mergePolicyFactory[@class='org.apache.solr.index.AutoExpungeDeletesTieredMergePolicyFactory'].bool[@name='mergeSingleSegments'] = true;
ALTER SEARCH INDEX CONFIG
ON cycling.comments
SET indexConfig.mergePolicyFactory[@class='org.apache.solr.index.AutoExpungeDeletesTieredMergePolicyFactory'].int[@name='maxMergedSegmentMB'] = 1005;
ALTER SEARCH INDEX CONFIG
ON cycling.comments
SET indexConfig.mergePolicyFactory[@class='org.apache.solr.index.AutoExpungeDeletesTieredMergePolicyFactory'].int[@name='forceMergeDeletesPctAllowed'] = 25;