lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mikhail Khludnev <mkhlud...@griddynamics.com>
Subject Re: Duplicate Document IDs when updateing parent document with child document
Date Wed, 09 Mar 2016 13:37:58 GMT
Hello Sebastian,

Mixing standalone docs and blocks doesn't work. There are a plenty of
issues open.

On Wed, Mar 9, 2016 at 3:02 PM, Sebastian Riemer <s.riemer@littera.eu>
wrote:

> Hi,
>
> to actually describe my problem in short, instead of just linking to the
> test applicaton, using SolrJ I do the following:
>
> 1) Create a new document as a parent and commit
>         SolrInputDocument parentDoc = new SolrInputDocument();
>         parentDoc.addField("id", "parent_1");
>         parentDoc.addField("name_s", "Sarah Connor");
>         parentDoc.addField("blockJoinId", "1");
>         solrClient.add(parentDoc);
>         solrClient.commit();
>
> 2) Create a new document with the same unique-id as in 1) with a child
> document appended
>         SolrInputDocument parentDocUpdateing = new SolrInputDocument();
>         parentDocUpdateing.addField("id", "parent_1");
>         parentDocUpdateing.addField("name_s", "Sarah Connor");
>         parentDocUpdateing.addField("blockJoinId", "1");
>
>         SolrInputDocument childDoc = new SolrInputDocument();
>         childDoc.addField("id", "child_1");
>         childDoc.addField("name_s", "John Connor");
>         childDoc.addField("blockJoinId", "1");
>
>         parentDocUpdateing.addChildDocument(childDoc);
>         solrClient.add(parentDocUpdateing);
>         solrClient.commit();
>
> 3) Results in 2 Documents with id="parent_1" in solr index
>
> Is this normal behaviour? I thought the existing document should be
> updated instead of generating a new document with same id.
>
> For a full working test application please see orginal message.
>
> Best regards,
> Sebastian
>
> -----Ursprüngliche Nachricht-----
> Von: Sebastian Riemer [mailto:s.riemer@littera.eu]
> Gesendet: Dienstag, 8. März 2016 20:05
> An: solr-user@lucene.apache.org
> Betreff: Duplicate Document IDs when updateing parent document with child
> document
>
> Hi,
>
> I have created a simple Java application which illustrates this issue.
>
> I am using Solr-Version 5.5.0 and SolrJ.
>
> Here is a link to the github repository:
> https://github.com/sebastianriemer/SolrDuplicateTest
>
> The issue I am facing is also described by another person on
> stackoverflow:
> http://stackoverflow.com/questions/34253178/solr-doesnt-overwrite-duplicated-uniquekey-entries
>
> I would love if any of you could run the test at your place and give me
> feedback.
>
> If you have any questions do not hesitate to write me.
>
> Many thanks in advance and best regards,
>
> Sebastian Riemer
>
>
>
>


-- 
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics

<http://www.griddynamics.com>
<mkhludnev@griddynamics.com>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message