You're getting yourself very, very confused. And then you're using the
source code to confuse yourself even more! Sigh.
First, you wouldn't (shouldn't) use atomic update for "loading" batches of
documents. Atomic update is for selectively update a subset of the fields of
existing documents. If you want to update an entire document, just use
normal update.
So called "versions" are an internal detail of SolrCloud, it's just a
special field, _version_ - please ignore them, and please don't try to
modify them or in any way depend on them. They are there, yes. Otherwise
ignore them. Solr will take care of them.
Go back and take a look at the basic Solr tutorial, which has an example
using JSON. Just follow that example. If you need to do more than that, ask
simple questions before you go off with overly-complicated approaches (or
reading source code) when simple approaches are usually all that are needed.
See:
http://lucene.apache.org/solr/4_4_0/tutorial.html
If you do in fact run into an actual problem, try to repro the problem using
the standard Solr example shcema and config.
-- Jack Krupansky
-----Original Message-----
From: Bruno René Santos
Sent: Friday, August 09, 2013 11:43 AM
To: solr-user@lucene.apache.org
Subject: Re: JSON Update create different copies of the same document
Hi,
I think I found out what is really happening. When I try to do a atomic
update the document id is transformed into a BytesRef (indexedId variable)
on the org.apache.solr.update.AddUpdateCommand. But on line 726 of
the org.apache.solr.update.processor.DistributedUpdateProcessor (
SolrInputDocument oldDoc =
RealTimeGetComponent.getInputDocument(cmd.getReq().getCore(), id); ) the
oldDoc is null even for a document that i know it already exists on the
collection. Our Document ids are like PT_93369010_9999_4__2_en_PT
(strings). Also it seems that the processor only tries to find the first
match of the document, disregardinf its current latest version (unless the
document versions are laready sorted by their version?)... Anyone knows
what I am doing wrong? Or if this is a bug?
Regards
Bruno
On Fri, Aug 9, 2013 at 2:23 PM, Bruno René Santos
<brunor...@gmail.com>wrote:
Hi,
I just saw overwrite option on the backoffice. I am loading the documents
in 5000 document batches in JSON so I do not use this interface. How can I
use this overwrite = true option in my environment? Or how solr admin
interface translate this overwrite option into JSON update syntax?
Regards
Bruno
On Thu, Aug 8, 2013 at 3:22 PM, Jack Krupansky
<j...@basetechnology.com>wrote:
Either your <uniqueKey> field values are in fact unique for those
separate documents, or your have overwrite="false" on the input
documents.
-- Jack Krupansky
-----Original Message----- From: Bruno René Santos
Sent: Thursday, August 08, 2013 4:58 AM
To: solr-user@lucene.apache.org
Subject: JSON Update create different copies of the same document
Hello,
I thought that by adding a new document with the same id on Solr the
document already on Solr would be updated with the new info. But both
documents appear on the search results... How can I update a document?
Regards
Bruno Santos
--
Bruno René Santos
Lisboa - Portugal
--
Bruno René Santos
Lisboa - Portugal
--
Bruno René Santos
Lisboa - Portugal