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 Roxana Danger <ro...@reedonline.co.uk> on 2015/10/26 15:58:06 UTC

using a custom update for all documents

Hello everyone,
Is there a way to update all the documents in the solr index using a custom
update processor?
Thank you,
Roxana

Re: using a custom update for all documents

Posted by Chris Hostetter <ho...@fucit.org>.
: You've been asked a couple of times by several people to explain your
: business needs (level higher than Solr itself). As it is, you are
: slowly getting deeper and deeper into Solr's internals, where there
: might be an easier question if we know what you are trying to achieve.
: 
: It is your choice of course, but it might be easier to step back to
: reconfirm what you are trying to actually achieve beyond the Solr
: technicalities.

+1

to answer your specific question...

>> Subject : Re: using a custom update for all documents

..you can configure any <updateRequestProcessorChain> as default="true" 
and it will be used regardless of wether it is specified by name in the 
update request using the update.chain param...

https://lucene.apache.org/solr/5_3_1/solr-core/org/apache/solr/update/processor/UpdateRequestProcessorChain.html


But again, i reierate Alexandre's higher level concern...

https://people.apache.org/~hossman/#xyproblem
XY Problem

Your question appears to be an "XY Problem" ... that is: you are dealing
with "X", you are assuming "Y" will help you, and you are asking about "Y"
without giving more details about the "X" so that we can understand the
full issue.  Perhaps the best solution doesn't involve "Y" at all?
See Also: http://www.perlmonks.org/index.pl?node_id=542341



-Hoss
http://www.lucidworks.com/

Re: using a custom update for all documents

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
Roxana,

You've been asked a couple of times by several people to explain your
business needs (level higher than Solr itself). As it is, you are
slowly getting deeper and deeper into Solr's internals, where there
might be an easier question if we know what you are trying to achieve.

It is your choice of course, but it might be easier to step back to
reconfirm what you are trying to actually achieve beyond the Solr
technicalities.

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


On 26 October 2015 at 11:29, Roxana Danger
<ro...@reedonline.co.uk> wrote:
> Thank you very much, Upayavira.
>
> I am indexing my documents with a DIH, but I need to use my custom update
> processor after the commit, not in the update.chain.
> Do update processors only work while adding new documents?
>
> In this case, I have tried two alternatives:
> 1) using the onImportEnd event. However I need to restart solr to see my
> current updates. Is there any way to inform solr that it needs to reload
> the searcher?
> 2) re-importing the indexed documents using SolrEntityProcessor and adding
> my custom chain processor. Which is the best approach?
>
> Best,
> Roxana
>
>
> On 26 October 2015 at 15:06, Upayavira <uv...@odoko.co.uk> wrote:
>
>>
>>
>> On Mon, Oct 26, 2015, at 02:58 PM, Roxana Danger wrote:
>> > Hello everyone,
>> > Is there a way to update all the documents in the solr index using a
>> > custom
>> > update processor?
>>
>>
>> You want to re-index all documents?
>>
>> If so, that's not really how update processors work. They trigger when a
>> new document is posted. You would need, somehow, to post every document
>> again in order to trigger the update processor's ability to do its work.
>>
>> Upayavira
>>
>
>
>
> --
> Roxana Danger | Data Scientist Dragon Court, 27-29 Macklin Street, London,
> WC2B 5LX Tel: 020 7067 4568 [image: reed.co.uk] <http://www.reed.co.uk/> The
> UK's #1 job site. <http://www.reed.co.uk/> [image: Follow us on Twitter]
> <https://twitter.com/reedcouk>
> <https://www.linkedin.com/company/reed.co.uk> [image:
> Like us on Facebook] <https://www.facebook.com/reedcouk/>
> <https://plus.google.com/u/0/+reedcouk/posts> It's time to Love Mondays »
> <http://www.reed.co.uk/lovemondays>

Re: using a custom update for all documents

Posted by Roxana Danger <ro...@reedonline.co.uk>.
Thank you very much, Upayavira.

I am indexing my documents with a DIH, but I need to use my custom update
processor after the commit, not in the update.chain.
Do update processors only work while adding new documents?

In this case, I have tried two alternatives:
1) using the onImportEnd event. However I need to restart solr to see my
current updates. Is there any way to inform solr that it needs to reload
the searcher?
2) re-importing the indexed documents using SolrEntityProcessor and adding
my custom chain processor. Which is the best approach?

Best,
Roxana


On 26 October 2015 at 15:06, Upayavira <uv...@odoko.co.uk> wrote:

>
>
> On Mon, Oct 26, 2015, at 02:58 PM, Roxana Danger wrote:
> > Hello everyone,
> > Is there a way to update all the documents in the solr index using a
> > custom
> > update processor?
>
>
> You want to re-index all documents?
>
> If so, that's not really how update processors work. They trigger when a
> new document is posted. You would need, somehow, to post every document
> again in order to trigger the update processor's ability to do its work.
>
> Upayavira
>



-- 
Roxana Danger | Data Scientist Dragon Court, 27-29 Macklin Street, London,
WC2B 5LX Tel: 020 7067 4568 [image: reed.co.uk] <http://www.reed.co.uk/> The
UK's #1 job site. <http://www.reed.co.uk/> [image: Follow us on Twitter]
<https://twitter.com/reedcouk>
<https://www.linkedin.com/company/reed.co.uk> [image:
Like us on Facebook] <https://www.facebook.com/reedcouk/>
<https://plus.google.com/u/0/+reedcouk/posts> It's time to Love Mondays »
<http://www.reed.co.uk/lovemondays>

Re: using a custom update for all documents

Posted by Upayavira <uv...@odoko.co.uk>.

On Mon, Oct 26, 2015, at 02:58 PM, Roxana Danger wrote:
> Hello everyone,
> Is there a way to update all the documents in the solr index using a
> custom
> update processor?


You want to re-index all documents?

If so, that's not really how update processors work. They trigger when a
new document is posted. You would need, somehow, to post every document
again in order to trigger the update processor's ability to do its work.

Upayavira