You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Siamak Kolahi <sk...@amquant.com> on 2013/06/13 21:55:47 UTC
Update multiple documents in one query
Hi folks,
I am trying to update multiple fields (assume q=id:*) and add a filed to
all of them. Is this possible?
If yes, what would be the syntax?
I am using the json update interface - /update/json ...
Thanks,
Siamak
Re: Update multiple documents in one query
Posted by Jack Krupansky <ja...@basetechnology.com>.
I haven't heard any mention of it, but it seems like a reasonable
enhancement.
There have been cases where people want to do things like add a new value to
every document.
I'll have to check into how easy it is to perform a query from an update
processor.
-- Jack Krupansky
-----Original Message-----
From: Siamak Kolahi
Sent: Thursday, June 13, 2013 4:48 PM
To: solr-user@lucene.apache.org
Subject: Re: Update multiple documents in one query
Thanks Jack.
I currently have written down a script which does that - effectively
retrieving all those documents and updating them one by one, atomically.
But I was hoping Solr does a more efficient implementation internally.
Is there any thinking about implementing such feature in future?
Siamak
On Thu, Jun 13, 2013 at 4:21 PM, Jack Krupansky
<ja...@basetechnology.com>wrote:
> That is not a feature available in Solr.
>
> You can update a full document or do a partial update of a single document
> based on its unique key, and you can update a batch of documents using
> those two techniques.
>
> You probably could implement custom code to do it.
>
> Maybe even using a script update processor.
>
> Or, just do it all in client code.
>
> The latter would probably be the most straight forward.
>
> A script update processor might actually be semi-reasonable as well, but
> you're going to have to get down and dirty to do it.
>
> -- Jack Krupansky
>
> -----Original Message----- From: Siamak Kolahi
> Sent: Thursday, June 13, 2013 3:55 PM
> To: solr-user@lucene.apache.org
> Subject: Update multiple documents in one query
>
>
> Hi folks,
>
> I am trying to update multiple fields (assume q=id:*) and add a filed to
> all of them. Is this possible?
> If yes, what would be the syntax?
>
> I am using the json update interface - /update/json ...
>
> Thanks,
> Siamak
>
Re: Update multiple documents in one query
Posted by Siamak Kolahi <sk...@amquant.com>.
Thanks Jack.
I currently have written down a script which does that - effectively
retrieving all those documents and updating them one by one, atomically.
But I was hoping Solr does a more efficient implementation internally.
Is there any thinking about implementing such feature in future?
Siamak
On Thu, Jun 13, 2013 at 4:21 PM, Jack Krupansky <ja...@basetechnology.com>wrote:
> That is not a feature available in Solr.
>
> You can update a full document or do a partial update of a single document
> based on its unique key, and you can update a batch of documents using
> those two techniques.
>
> You probably could implement custom code to do it.
>
> Maybe even using a script update processor.
>
> Or, just do it all in client code.
>
> The latter would probably be the most straight forward.
>
> A script update processor might actually be semi-reasonable as well, but
> you're going to have to get down and dirty to do it.
>
> -- Jack Krupansky
>
> -----Original Message----- From: Siamak Kolahi
> Sent: Thursday, June 13, 2013 3:55 PM
> To: solr-user@lucene.apache.org
> Subject: Update multiple documents in one query
>
>
> Hi folks,
>
> I am trying to update multiple fields (assume q=id:*) and add a filed to
> all of them. Is this possible?
> If yes, what would be the syntax?
>
> I am using the json update interface - /update/json ...
>
> Thanks,
> Siamak
>
Re: Update multiple documents in one query
Posted by Jack Krupansky <ja...@basetechnology.com>.
That is not a feature available in Solr.
You can update a full document or do a partial update of a single document
based on its unique key, and you can update a batch of documents using those
two techniques.
You probably could implement custom code to do it.
Maybe even using a script update processor.
Or, just do it all in client code.
The latter would probably be the most straight forward.
A script update processor might actually be semi-reasonable as well, but
you're going to have to get down and dirty to do it.
-- Jack Krupansky
-----Original Message-----
From: Siamak Kolahi
Sent: Thursday, June 13, 2013 3:55 PM
To: solr-user@lucene.apache.org
Subject: Update multiple documents in one query
Hi folks,
I am trying to update multiple fields (assume q=id:*) and add a filed to
all of them. Is this possible?
If yes, what would be the syntax?
I am using the json update interface - /update/json ...
Thanks,
Siamak