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 jonarino <Jo...@verizonwireless.com> on 2009/07/10 20:40:51 UTC
Update Preprocessing
I am investigating the possibilities of preprocessing my data before it is
indexed. Specifically, I would like to add fields or modify field values
based on other fields in the XML I am injecting.
I am a little confused on where this is supposed to happen; whether as part
of the UpdateRequestProcessor or just a request handler. A little direction
would be great. Especially to know what classes to extend or what exactly is
required. Thanks.
--
View this message in context: http://www.nabble.com/Update-Preprocessing-tp24432669p24432669.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Update Preprocessing
Posted by Mark Miller <ma...@gmail.com>.
On Fri, Jul 10, 2009 at 6:40 PM, jonarino <Jonathan.Hill@verizonwireless.com
> wrote:
>
> I am investigating the possibilities of preprocessing my data before it is
> indexed. Specifically, I would like to add fields or modify field values
> based on other fields in the XML I am injecting.
> I am a little confused on where this is supposed to happen; whether as part
> of the UpdateRequestProcessor or just a request handler. A little direction
> would be great. Especially to know what classes to extend or what exactly
> is
> required. Thanks.
> --
> View this message in context:
> http://www.nabble.com/Update-Preprocessing-tp24432669p24432669.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>
Use an updateRequestProcessorChain - your custom UpdateRequestProcessor will
be able to inspect the documents fields and add/remove them. ie, in
solrconfig.xml:
<updateRequestProcessorChain name="updateChain">
<processor class="com.company.project.CustomUpdateRequestProcessor">
<processor class="solr.LogUpdateProcessorFactory">
<int name="maxNumToLog">10</int>
</processor>
<processor class="solr.RunUpdateProcessorFactory"/>
</updateRequestProcessorChain>
and then in a RequestHandler you can refer to your chain:
<lst name="defaults">
<str name="update.processor">updateChain</str>
--
--
- Mark
http://www.lucidimagination.com