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

Charles Smith commented on SOLR-5772:
-------------------------------------

I have seen the same issue myself as I started to make use of nested documents. 
The only way to ensure uniqueness (when updating) is to always have a 
sub-document even if this does not reflect your data. 

This is especially inconvenient since the "empty" child document must have an 
id field since it is a required field.

I also found this unanswered StackOverflow post that shows another user seeing 
this bug:

http://stackoverflow.com/questions/23881343/index-nested-document-cause-unique-key-duplication

> duplicate documents between solr "block join" documents and "normal" document
> -----------------------------------------------------------------------------
>
>                 Key: SOLR-5772
>                 URL: https://issues.apache.org/jira/browse/SOLR-5772
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 4.5.1, 4.6.1
>            Reporter: Xiang Xiao
>              Labels: blockjoin
>
> if i first upload this document to solr:
> {code:xml}
>     <?xml version="1.0"?>
> <add>
>   <doc boost="1.0">
>     <field name="id">file1</field>
>     <field name="size_i">100</field>
>   </doc>
> </add>
> {code}
> and then this one:
> {code:xml}
> <?xml version="1.0"?>
> <add>
>   <doc boost="1.0">
>     <field name="id">dir1</field>
>     <doc boost="1.0">
>       <field name="id">file1</field>
>       <field name="size_i">400</field>
>     </doc>
>   </doc>
> </add>
> {code}
> i will get two file documents with the same id
> http://localhost:8983/solr/select?q=*:*&fq=id:file1
> in the config file, i have 
> {code:xml}
> <field name="id" type="string" indexed="true" stored="true" required="true" 
> multiValued="false" />
> <dynamicField name="*_i"  type="int"    indexed="true"  stored="true"/>
> <uniqueKey>id</uniqueKey>
> {code}
> i would expect the first file document to be overridden by the block join 
> document.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to