lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yoni Amir (JIRA)" <>
Subject [jira] [Commented] (SOLR-3814) Partial document update silently breaks multi-valued constraint
Date Sun, 09 Sep 2012 18:19:07 GMT


Yoni Amir commented on SOLR-3814:

I think this happens because price_c is the destination of a copyField tag, but it is also
So on the first post one instance of this field is created.
On the second post (the first update) solr constructs a document with one price_c field. Then
it applies the copying and creates another such field, and it manages to save the document
without an error.

On the third post (the second update), when solr loads the document from the index, it detects
the error.

I'd expect the copy field to override previous values in this case.
However, if price_c was both multi-valued and stored, I don't know what would be the correct
behavior. I expect that typically it makes sense to delete the old values. However, it is
possible that some of the values were originally posted into that field, rather than copied
from other fields ...
> Partial document update silently breaks multi-valued constraint
> ---------------------------------------------------------------
>                 Key: SOLR-3814
>                 URL:
>             Project: Solr
>          Issue Type: Bug
>          Components: update
>    Affects Versions: 4.0-BETA
>         Environment: windows xp, java 6 or 7
>            Reporter: Yoni Amir
> 1) Download the tutorial, start solr, and post to it the file solr.xml as explained in
the tutorial.
> 2) query *:* and verify that you have one document in solr with id SOLR1000
> 3) copy the xml file and create a partial update command for that document. I used something
like this:
> <add>
> <doc>
>   <field name="id">SOLR1000</field>
>   <field name="manu" update="set">new value</field>
> </doc>
> </add>
> 4) Post this document to solr. It will succeed.
> 5) Query *:* again, and you will notice something strange. There is still one document,
but in the results the field price_c appears twice, even though it is not a multi-valued field.
> <result name="response" numFound="1" start="0">
>   <doc>
>     <str name="id">SOLR1000</str>
>     ...
>     <float name="price">0.0</float>
>     <arr name="price_c">
>       <str>0.0,USD</str>
>       <str>0,USD</str>
>     </arr>
>   </doc>
> </result>
> 6) change the value in the xml that you just sent (e.g. "new value2") and post it again
to solr. Now solr throws an exception:
> SEVERE: org.apache.solr.common.SolrException: ERROR: [doc=SOLR1000] multiple values encountered
for non multiValued field price_c
> : [0.0,USD, 0,USD]
>         at org.apache.solr.update.DocumentBuilder.toDocument(
>         at org.apache.solr.update.AddUpdateCommand.getLuceneDocument(
>         at org.apache.solr.update.DirectUpdateHandler2.addDoc(
>         at org.apache.solr.update.processor.RunUpdateProcessor.processAdd(
>         at org.apache.solr.update.processor.UpdateRequestProcessor.processAdd(
>         at org.apache.solr.update.processor.DistributedUpdateProcessor.doLocalAdd(
>         at org.apache.solr.update.processor.DistributedUpdateProcessor.versionAdd(
>         at org.apache.solr.update.processor.DistributedUpdateProcessor.processAdd(
>         at org.apache.solr.update.processor.LogUpdateProcessor.processAdd(
>         at org.apache.solr.handler.loader.XMLLoader.processUpdate(
>         at org.apache.solr.handler.loader.XMLLoader.load(
>         at org.apache.solr.handler.UpdateRequestHandler$1.load(
>         at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(
>         at org.apache.solr.handler.RequestHandlerBase.handleRequest(
>         at org.apache.solr.core.SolrCore.execute(
>         at org.apache.solr.servlet.SolrDispatchFilter.execute(
>         at org.apache.solr.servlet.SolrDispatchFilter.doFilter(
>         at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(
> I am trying to use the partial update feature in my current project, and this is a showstopper
for us right now.
> Thanks,
> Yoni

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:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message