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

Hoss Man commented on SOLR-4468:
--------------------------------

Isaac: thank you for your patch, a few comments...

1) the patch would definitley need to be updated to include some tests before 
this feature could be considered for inclusion in Solr

2) skimming the patch, i'm not convinced it behalves in the way you describe -- 
 in particula consider what would happen if (in your example usage) a document 
existed in the index which did _not_ have any value in the 
"first_update_timestamp" field.  from what i can tell the patch as written 
isn't actually doing anything to distinguish between the case of "this is the 
first time adding this document (so accept the field value)" and "this is the 
first time someone has tried to set this value" ... although perhaps i'm just 
missunderstanding what you're goal is?

3) i'm not sure that the verb "create" fits with the other existing verbs that 
are available for atomic updates ... it seems like what we really want is 
something more along the lines of "setIfEmpty" or "setOnCreate" (depending on 
the intended behavior as mentioned above in #2)

4) it's not clear to me from skimming the patch if this will work with multiple 
values, would definitely need to see a test case verifying that both values 
were added in a situation like...

{code}
<doc>
  <field name="foo" update="create">ABC</field>
  <field name="foo" update="create">XYZ</field>
  ...
</doc>
</add>
{code}

----

I would also like to point out that (unless i'm missunderstanding) for the 
initial use case that seems to have motivated this issue (ie: "timestamp when 
doc was first indexed", where the field must be single valued to make sense) 
i'm pretty sure this goal is already achievable w/o any code changes if:

* the clients always specify {{update="add"}} on this particular field
* {{FirstFieldValueUpdateProcessorFactory}} is configured on for this field 
_after_ the {{DistributedUpdateProcessorFactory}}
                
> Add document but keep existing fields values
> --------------------------------------------
>
>                 Key: SOLR-4468
>                 URL: https://issues.apache.org/jira/browse/SOLR-4468
>             Project: Solr
>          Issue Type: Improvement
>          Components: update
>    Affects Versions: 4.1
>            Reporter: Isaac Hebsh
>              Labels: AtomicUpdate, timestamp
>             Fix For: 4.2
>
>         Attachments: SOLR-4468.patch
>
>
> The original need is a field that represents the (first) insertion time of 
> the document.
> It can be implemented as another value in the "update" optional attribute of 
> 'field' element, in AddUpdateCommand.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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

Reply via email to