lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexandre Rafalovitch <arafa...@gmail.com>
Subject Re: Atomic updates on multiple documents
Date Thu, 17 Sep 2015 19:08:38 GMT
You could probably do this as a RequestUpdateProcessor (a custom one)
that would take your submitted document, run a query and expand it to
a bunch of documents. So, do the ID mapping internally. But you would
need the ID/uniqueKeys.

Definitely nothing out of the box, that I can think of.

Regards,
   Alex.
----
Solr Analyzers, Tokenizers, Filters, URPs and even a newsletter:
http://www.solr-start.com/


On 17 September 2015 at 12:58, Alfonso Muñoz-Pomer Fuentes
<amunoz@ebi.ac.uk> wrote:
> We’re using SolrJ as well, but if I understood correctly I would need to
> have the uniqueKey values anyway, right? There’s no way to do what I want
> with one request. A simple outline is:
>
> 1. Get the uniqueKey values that match my query
> 2. Create a set of SolrInputDocument
> 3. Add the id and the additional data
> 4. Send the documents to Solr
>
> Thanks a lot for the help.
>
>
> On 17/09/2015 17:51, Alessandro Benedetti wrote:
>>
>> You need to do that programmatically.
>> Using SolrJ would be not so difficult to do that in few line of codes.
>> Be careful to the stored fields if you don't want to lose anything.
>>
>> Cheers
>>
>> 2015-09-17 17:48 GMT+01:00 Alfonso Muñoz-Pomer Fuentes <amunoz@ebi.ac.uk>:
>>
>>> You’re right, we’re not working with a uniqueKey and I wasn’t aware of
>>> that requirement.
>>>
>>> What I’d like is to update the documents without having to retrieve all
>>> of
>>> them (or their unique ids). Basically, there are some data that all
>>> documents that match a query will share; for the sake of the example, all
>>> Neal Stephenson’s books are going to be categorised sci-fi, so something
>>> like the request I specified before (in the same way that multiple
>>> documents can be deleted with just one request).
>>>
>>> If Solr doesn’t offer that “out of the box”, could I accomplish that with
>>> a plug-in?
>>>
>>> Thanks a lot for the info.
>>>
>>>
>>> On 17/09/2015 17:23, Shawn Heisey wrote:
>>>
>>>> On 9/17/2015 10:14 AM, Shawn Heisey wrote:
>>>>
>>>>> This assumes that the uniqueKey field is "id". Unless your uniqueKey
>>>>> field is "author_s" (which is highly unlikely), the JSON that you used
>>>>> will not work. Chances are that the request failed, that nothing
>>>>> happened.
>>>>>
>>>>
>>>> On my first reading, I did not catch that you said it added a new
>>>> document with the fields you specified, so my assumption that the
>>>> request failed was clearly wrong.
>>>>
>>>> I think this must mean that you have disabled (removed) the uniqueKey
>>>> setting in your schema -- adding a document that does not have the
>>>> uniqueKey field will fail.  I'm reasonably certain that you cannot do
>>>> atomic updates if you do not have a uniqueKey.
>>>>
>>>> I have just checked our documentation for Atomic Updates ... and the
>>>> uniqueKey requirement is NOT mentioned.  I think that's a documentation
>>>> bug.
>>>>
>>>> Thanks,
>>>> Shawn
>>>>
>>>>
>>> --
>>> Alfonso Muñoz-Pomer Fuentes
>>> Software Engineer @ Expression Atlas Team
>>> European Bioinformatics Institute (EMBL-EBI)
>>> European Molecular Biology Laboratory
>>> Tel:+ 44 (0) 1223 49 2633
>>> Skype: amunozpomer
>>>
>>
>>
>>
>
> --
> Alfonso Muñoz-Pomer Fuentes
> Software Engineer @ Expression Atlas Team
> European Bioinformatics Institute (EMBL-EBI)
> European Molecular Biology Laboratory
> Tel:+ 44 (0) 1223 49 2633
> Skype: amunozpomer

Mime
View raw message