DataStax Help Center

Solr dynamic fields are not deleted on update if table is created from Solr HTTP API

Summary

If a table is created from the Solr http api, then this could affect the way dynamic fields act in the resulting table

Symptoms

Taking a table of with fields of "key", "col1", and "pwk_" where the latter is a dynamic field. If the table is created with the solr HTTP API (i.e. you push the solrconfig.xml and the schema.xml to create the table), and then apply two subsequent data updates as follows:

update 1 = "key1", "value1", "pwk_1", "111"

update 2 = "key1", "value2". "pwk_2", "222"

The result will show the following content (see the value in bold which is still present):

key="key1", col1="value2", pwk_1="111", pwk_2="222"

However the expected result would be

key="key1", col1="value2", pwk_2="222"

Cause

Adding the table using the solr http api (using the solrconfig.xml and schema.xml), results in a thrift table not a cql table. So the resulting table will appear like so in cqlsh:

Thrift table (created when adding solrconfig.xml and schema.xml)

CREATE TABLE mykeyspace (
key text PRIMARY KEY,
"_docBoost" text,
"_dynFld" text,
col1 text,
solr_query text
);

Instead of:

CREATE TABLE mykeyspace (
key text,
col1 text,
pwk_ map<text, text>,
PRIMARY KEY ((key))
) ;

Solution

Tables should be created in cqlsh (or with the driver) first.

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk