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 FiMko <fi...@ya.ru> on 2018/02/25 21:10:09 UTC

Solr 7. Why UpdateRequestProcessorChain does not take any effect?

Hello,

Could you please help, for some reason my custom updateRequestProcessorChain
does not take any effect.
I am using Solr v.7.2.1 with two nodes.
I have the following schema:



In my solrconfig.xml I added:



I enabled TRACE logging for UpdateRequestProcessorChain,
CloneFieldUpdateProcessorFactory and DistributedUpdateProcessorFactory (but
still cannot see this in the logs).

After I add a new document like {"text_en":"test"}, the field
"text_en_exact" is never populated with this value by
CloneFieldUpdateProcessorFactory.

What am I doing wrong?



--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: Solr 7. Why UpdateRequestProcessorChain does not take any effect?

Posted by FiMko <fi...@ya.ru>.
Also in the logs I can see that my custom "mychain" processor is registered
on both nodes:






--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: Solr 7. Why UpdateRequestProcessorChain does not take any effect?

Posted by FiMko <fi...@ya.ru>.
Hi Shawn,

Adding the default="true" helped!

Why I keep this in the update chain because I'm doing some more
transformations later on:



Thanks a lot!



--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: Solr 7. Why UpdateRequestProcessorChain does not take any effect?

Posted by Shawn Heisey <ap...@elyograg.org>.
On 2/26/2018 5:57 AM, FiMko wrote:
> Can you say how to download schema in Solr 7 world? Because the schema.xml
> approach has been obsoleted.

The filename has changed in recent examples.  The file will be most
likely be called managed-schema, not schema.xml.  The file may included
a warning about manual edits.  This is because if you combine manual
edits with HTTP requests using the schema API, and don't do it
correctly, the http requests will cause your manual edits to be lost. 
If you're careful about how you manage your edits, that won't happen.

> BTW I have just commented out another chain
> "add-unknown-fields-to-the-schema", then restarted Solr.
> If I create a document updateRequestProcessorChain "mychain" is still not
> working - the value of "text_en" is not cloned into "text_en_exact".

If all you did was disable the add-unknown-fields-to-the-schema chain,
that doesn't enable your chain.

You have to do something to enable your chain.  One thing you can do is
set the default parameter to true in the chain's definition.

But I would recommend that you use the copyField directive in your
schema for this particular behavior, not an update chain.

Thanks,
Shawn


Re: Solr 7. Why UpdateRequestProcessorChain does not take any effect?

Posted by FiMko <fi...@ya.ru>.
Hi Shawn,

Appreciate your help!

Can you say how to download schema in Solr 7 world? Because the schema.xml
approach has been obsoleted.

BTW I have just commented out another chain
"add-unknown-fields-to-the-schema", then restarted Solr.
If I create a document updateRequestProcessorChain "mychain" is still not
working - the value of "text_en" is not cloned into "text_en_exact".

I can provide any additional information, just let me know what should I
mention here?



--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: Solr 7. Why UpdateRequestProcessorChain does not take any effect?

Posted by Shawn Heisey <ap...@elyograg.org>.
On 2/25/2018 2:10 PM, FiMko wrote:
> Could you please help, for some reason my custom updateRequestProcessorChain
> does not take any effect.
> I am using Solr v.7.2.1 with two nodes.
> I have the following schema:
>
>
>
> In my solrconfig.xml I added:
>
>
>
> I enabled TRACE logging for UpdateRequestProcessorChain,
> CloneFieldUpdateProcessorFactory and DistributedUpdateProcessorFactory (but
> still cannot see this in the logs).
>
> After I add a new document like {"text_en":"test"}, the field
> "text_en_exact" is never populated with this value by
> CloneFieldUpdateProcessorFactory.

The things you referenced did not make it to the mailing list.  What I 
have quoted above is exactly what made it to the mailing list.

By going to the Nabble forum (which is a mirror of the list) I was able 
to see the two things you referenced.  Nabble does not always send 
everything that its users include to the list.

The logs you mentioned in your second message aren't there, not even on 
Nabble.

The information you included as your schema is not useful. If we end up 
needing that information, and I'm not sure we will, then we need the 
actual schema contents, not information from the Schema tab in the admin UI.

The information from solrconfig.xml is just an update chain definition.  
Unless you *activate* that update chain, it will not take effect.  You 
can only have one update chain active, so if you're currently using the 
"add-unknown-fields" chain commonly found in examples, that will no 
longer be running once you activate this new one.

Why are you using an update chain to do what the schema can do natively 
with copyField?

Thanks,
Shawn