-
Notifications
You must be signed in to change notification settings - Fork 535
Description
I'm seeing an exception in the Solr log when I attempt to execute a DeleteValue via the Java Riak-Client. I am using:
JRuby 1.7.16.1
Riak-Client Java 2.0.0
Basic example:
Let's say the Solr index schema.xml has a required field.
field name="favorite_color" type="string" indexed="true" stored="true" multiValued="true" required="true"
I create a 'record' with the required field and save it successfully. No exception is produced in the Solr log. I am able to retrieve the user's favorite color from the 'record'. Assume 'uid' is the key.
user = User.new(uid: 'johnsmith', favorite_color: 'brown')
user.save
true
Now, for whatever reason, I want to delete the user. I construct a DeleteValue::Builder and pass it the location of the 'record'. I execute it.
key = 'johnsmith'
location = Location.new(Namespace.new('some_bucket_type_name', 'some_bucket'), key)
dv = DeleteValue::Builder.new(location).build
client.execute(dv)
The delete is successful. However, the following exception is produced in the Solr log:
2015-08-17 13:17:13,542 [ERROR] @SolrException.java:109 org.apache.solr.common.SolrException: [doc=1 * some_bucket_type_name * some_bucket * johnsmith * 9] missing required field: favorite_color
If the record is valid, and saves/indexes with no exceptions thrown about required fields, why am I getting a missing required field exception when I attempt to delete it?