how to configure LastFieldValueUpdateProcessorFactory

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

how to configure LastFieldValueUpdateProcessorFactory

root23
HI all,
I am trying to configure LastFieldValueUpdateProcessorFactory for my
multivalued fields so that i only take the last value.

I did the following in my solrconfig file.

<requestHandler name="/update"
                  class="solr.UpdateRequestHandler">
   
        <processor class="solr.LastFieldValueUpdateProcessorFactory">
                <str name="fieldName">transcation_type</str>
        </processor>
  </requestHandler>

I reloaded the core but got an error

<lst name="responseHeader">
<int name="status">500</int>
<int name="QTime">12492</int>
</lst><lst name="error">
<lst name="metadata">
<str name="error-class">org.apache.solr.common.SolrException</str>
<str name="root-error-class">java.lang.NullPointerException</str>

Can someone point to me what i am missing? i read the documentation but
couldn't fully understand how to configure this ?




--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
Reply | Threaded
Open this post in threaded view
|

Re: how to configure LastFieldValueUpdateProcessorFactory

Alexandre Rafalovitch
You cannot put a URP directly into the request handler. You need to define
it outside and refer to it. Check the shipped examples for more guidance.

Regards,
   Alex

On Fri, Jun 8, 2018, 22:00 root23, <[hidden email]> wrote:

> HI all,
> I am trying to configure LastFieldValueUpdateProcessorFactory for my
> multivalued fields so that i only take the last value.
>
> I did the following in my solrconfig file.
>
> <requestHandler name="/update"
>                   class="solr.UpdateRequestHandler">
>
>         <processor class="solr.LastFieldValueUpdateProcessorFactory">
>                 <str name="fieldName">transcation_type</str>
>         </processor>
>   </requestHandler>
>
> I reloaded the core but got an error
>
> <lst name="responseHeader">
> <int name="status">500</int>
> <int name="QTime">12492</int>
> </lst><lst name="error">
> <lst name="metadata">
> <str name="error-class">org.apache.solr.common.SolrException</str>
> <str name="root-error-class">java.lang.NullPointerException</str>
>
> Can someone point to me what i am missing? i read the documentation but
> couldn't fully understand how to configure this ?
>
>
>
>
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
>
Reply | Threaded
Open this post in threaded view
|

Re: how to configure LastFieldValueUpdateProcessorFactory

Shawn Heisey-2
In reply to this post by root23
On 6/8/2018 1:33 PM, root23 wrote:
> Can someone point to me what i am missing? i read the documentation but
> couldn't fully understand how to configure this ?

I think that this is the config you'll need:

<updateRequestProcessorChain name="lastfieldvalue">
  <processor class="solr.LastFieldValueUpdateProcessorFactory">
    <str name="fieldName">transaction_type</str>
  </processor>
  <processor class="solr.LogUpdateProcessorFactory" />
  <processor class="solr.DistributedUpdateProcessorFactory" />
  <processor class="solr.RunUpdateProcessorFactory" />
</updateRequestProcessorChain>

<requestHandler name="/update" class="solr.UpdateRequestHandler">
  <lst name="defaults">
    <str name="update.chain">lastfieldvalue</str>
  </lst>
</requestHandler>

There are a couple of different ways to make an update chain the default
instead of specifying it in the handler definition.

Thanks,
Shawn