[
https://issues.apache.org/jira/browse/SOLR-6003?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13980513#comment-13980513
]
Shawn Heisey commented on SOLR-6003:
------------------------------------
I have not looked at the code that generates the schema object from schema.xml,
so I'm not familiar with the actual object names or the methods. Here's an
extreme simplification of my idea with simple variable names and
objects/methods that probably do not correspond to what's really in the schema
object. When the schema object is created:
{code}
Set<String> atomicUpdateRequiredFields = new HashSet<>();
foreach (Field f : fields) {
if (! f.isCopyfieldDestination()) {
if (! f.isStored()) {
atomicUpdateRequiredFields.add(f.name());
}
}
}
{code}
When an Atomic Update request arrives, the update processor will retrieve
atomicUpdateRequiredFields (or whatever we call it). If the update does not
include all of those fields (or actions on any of those fields attempt to use
add/inc/remove instead of set/removeAll), we log a warning. The warning will
include the uniqueKey value and all field names that were bad/missing.
When the user goes to their log to find out why they are missing data, they'll
have log entries that clearly explain the problem. A configuration option
could be created that will fail such updates instead of logging a warning.
> JSON Update increment field with non-stored fields causes subtle problems
> -------------------------------------------------------------------------
>
> Key: SOLR-6003
> URL: https://issues.apache.org/jira/browse/SOLR-6003
> Project: Solr
> Issue Type: Bug
> Components: update
> Affects Versions: 4.7.1
> Reporter: Kingston Duffie
>
> In our application we have large multi-field documents. We occasionally need
> to increment one of the numeric fields or add a value to a multi-value text
> field. This appears to work correctly using JSON update. But later we
> discovered that documents were disappearing from search results and
> eventually found the documentation that indicates that to use field
> modification you must store all fields of the document.
> Perhaps you will argue that you need to impose this restriction -- which I
> would hope could be overcome because of the cost of us having to store all
> fields. But in any case, it would be better for others if you could return
> an error if someone tries to update a field on documents with non-stored
> fields.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]