Configuring search index joins
DataStax Enterprise supports solr_query
joins on the partition key field (_partitionKey
).
By default, the solr_query
join functionality is enabled and DSE indexes the partitioning columns in this additional field.
This field, _partitionKey
, increases search index size.
Disabling joins can decrease the amount of disk space the search indexes uses.
Join settings in the schema
DESCRIBE ACTIVE SEARCH INDEX
displays the schema settings of a search index.
DSE hides the definition of the _partitionKey
when joins are enabled.
If the schema contains a field named _partitionKey
, support for joins is:
-
Enabled: attributes
docValues
andindexed
are set to true. For example:<field name="_partitionKey" **docValues="true"** **indexed="true"** stored="false" type="StrField"/>
-
Disabled: attributes
docValues
andindexed
are set to false. For example:<field **docValues="false"** **indexed="false"** multiValued="false" name="_partitionKey" omitNorms="true" **stored="false"** type="StrField"/>
If the schema contains no field definition for |
Prerequisite
This section uses the Term and phrase searches using the wikipedia demo.
Enable joins
To enable join on a search index that previously had join disabled, set the _partitionKey
, docValues
, and indexed
attributes to true
, reload the schema, and rebuild the index.
Rebuilding the search index on a large dataset might take longer than the default timeout for |
Procedure
-
Start cqlsh on a node that is running DSE Search.
-
Set the
docValues
andindexed
attributes totrue
:ALTER SEARCH INDEX SCHEMA ON wiki.solr SET field[@name='_partitionKey']@docValues='true'; ALTER SEARCH INDEX SCHEMA ON wiki.solr SET field[@name='_partitionKey']@indexed='true';
-
Reload the schema to make it active:
RELOAD SEARCH INDEX ON wiki.solr;
-
Reload the schema to make it active:
RELOAD SEARCH INDEX ON wiki.solr;
-
Rebuild the search index:
REBUILD SEARCH INDEX ON wiki.solr;
include:disablesJoins.adoc[leveloffset=+1]