[ 
https://issues.apache.org/jira/browse/SOLR-12373?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16481304#comment-16481304
 ] 

Hoss Man commented on SOLR-12373:
---------------------------------

Tomas: you've obviously thought about this a lot more then i have, but I have a 
few concerns about the solution you've presented here...
 * this approach seems kind of brittle if/when new fieldtypes are added?
 * one of the nice things about the existing tombstone documents, is that they 
will generally not match _most_ queries, because they would be absent all 
fields except the {{id, _version_, and $versionField}} fields ... with this 
change, tombstone docs could (silently) start matching queries unexpectedly via 
"sentinal values" that can't be changed w/o writing your own subclass.
 ** this will even break the existing behavior for existing 
{{DocBasedVersionConstraintsProcessorFactory}} users who already have 
{{required="true"}} fields in their schema, if they already use 
{{DefaultValueUpdateProcessorFactory}} instead of {{default="x"}} in their 
schema.

Here's my strawman counter proposal...
 * add a new {{tombstone-fields}} config option, which can be a nested 
{{<lst/>}} of field name->value mappings
 * on init, the factory should loop over all "required w/o default" fields in 
the schema, and log a WARN if any exist which are not mentioned by name in 
{{tombstone-fields}}
 ** shouldn't be a fatal error, because of the possibility that the user is 
using {{DefaultValueUpdateProcessorFactory}}
 * at request time, the default impl of {{createTombstoneDocument()}} should 
populate the tombstone document with the values from {{tombstone-fields}}

This would give users a little more flexibility on how to deal with what values 
go in the {{required="true"}} fields, and as an added bonus could be useful 
even for people who *don't* have {{required="true"}} fields in their schema as 
a way to add special marker field values to tombstone documents to help exclude 
them from common searches

WDYT?

> DocBasedVersionConstraintsProcessor doesn't work when schema has required 
> fields
> --------------------------------------------------------------------------------
>
>                 Key: SOLR-12373
>                 URL: https://issues.apache.org/jira/browse/SOLR-12373
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Tomás Fernández Löbbe
>            Assignee: Tomás Fernández Löbbe
>            Priority: Minor
>         Attachments: SOLR-12373.patch, SOLR-12373.patch
>
>
> DocBasedVersionConstraintsProcessor creates tombstones when processing a 
> delete by id. Those tombstones only have id (or whatever the unique key name 
> is) and version field(s), however, if the schema defines some required 
> fields, adding the tombstone will fail.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to