Hi Martin,

I read after answering your email that you don’t want to use curl, that might 
be a problem. I might be wrong but I don’t think you can make an atomic update 
with a GET request having the params in the url. I think you need to make a 
POST request and embed [{"id":"docid","clicks":{“inc”:"1"}}] in the raw body 
hence using curl or any other app that allows you this like Postman. 

Best regards

Thierry

> On 19 Mar 2019, at 08:59, Martin Frank Hansen (MHQ) <m...@kmd.dk> wrote:
> 
> Hi Thierry,
> 
> Do you mean something like this?
> 
> http://localhost:8983/solr/.../update? 
> [{"id":"docid","clicks":{“inc”:"1"}}]commit=true
> 
> I do not get an error, but it does not increase the value of clicks 
> (unfortunately).
> 
> Best regards
> 
> Martin
> 
> 
> Internal - KMD A/S
> 
> -----Original Message-----
> From: THIERRY BOUCHENY <tibo...@wanadoo.fr>
> Sent: 19. marts 2019 09:51
> To: solr-user@lucene.apache.org
> Subject: Re: Update handler and atomic update
> 
> Hi Martin,
> 
> Have you tried doing a POST with some JSON or XML Body.
> 
> I would POST some json like the following
> 
> [{"id":"docid","clicks":{“inc”:"1"}}]
> 
> In an /update?commit=true
> 
> Best regards
> 
> Thierry
> 
> See documentation here 
> https://lucene.apache.org/solr/guide/6_6/updating-parts-of-documents.html
> 
>> On 19 Mar 2019, at 08:14, Martin Frank Hansen (MHQ) <m...@kmd.dk> wrote:
>> 
>> Hi,
>> 
>> Hope someone can help me, I am trying to make an incremental update for one 
>> document using the API, but cannot make it work. I have tried a lot of 
>> things and all I actually want is to increment the value of the field 
>> “clicks” by one.
>> 
>> I have something like this:
>> http://localhost:8983/solr/.../update?id:docid&inc:clicks=1&commit=true
>> 
>> in the schema.xml the field looks like this:
>> 
>> <field name="clicks" type="pint" indexed="false" stored="true" 
>> multiValued="false" docValues="true"/>
>> 
>> Please note that I do not wish to use curl for this operation.
>> 
>> Thanks in advance.
>> 
>> Best regards
>> 
>> Martin
>> 
>> 
>> Internal - KMD A/S
>> 
>> Beskyttelse af dine personlige oplysninger er vigtig for os. Her finder du 
>> KMD’s Privatlivspolitik<http://www.kmd.dk/Privatlivspolitik>, der fortæller, 
>> hvordan vi behandler oplysninger om dig.
>> 
>> Protection of your personal data is important to us. Here you can read KMD’s 
>> Privacy Policy<http://www.kmd.net/Privacy-Policy> outlining how we process 
>> your personal data.
>> 
>> Vi gør opmærksom på, at denne e-mail kan indeholde fortrolig information. 
>> Hvis du ved en fejltagelse modtager e-mailen, beder vi dig venligst 
>> informere afsender om fejlen ved at bruge svarfunktionen. Samtidig beder vi 
>> dig slette e-mailen i dit system uden at videresende eller kopiere den. 
>> Selvom e-mailen og ethvert vedhæftet bilag efter vores overbevisning er fri 
>> for virus og andre fejl, som kan påvirke computeren eller it-systemet, hvori 
>> den modtages og læses, åbnes den på modtagerens eget ansvar. Vi påtager os 
>> ikke noget ansvar for tab og skade, som er opstået i forbindelse med at 
>> modtage og bruge e-mailen.
>> 
>> Please note that this message may contain confidential information. If you 
>> have received this message by mistake, please inform the sender of the 
>> mistake by sending a reply, then delete the message from your system without 
>> making, distributing or retaining any copies of it. Although we believe that 
>> the message and any attachments are free from viruses and other errors that 
>> might affect the computer or it-system where it is received and read, the 
>> recipient opens the message at his or her own risk. We assume no 
>> responsibility for any loss or damage arising from the receipt or use of 
>> this message.

Reply via email to