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 root23 <s....@gmail.com> on 2018/06/08 19:33:50 UTC

how to configure LastFieldValueUpdateProcessorFactory

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

Re: how to configure LastFieldValueUpdateProcessorFactory

Posted by Shawn Heisey <ap...@elyograg.org>.
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


Re: how to configure LastFieldValueUpdateProcessorFactory

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
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, <s....@gmail.com> 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
>