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 Jack Park <ja...@topicquests.org> on 2013/03/12 06:56:45 UTC

Re: Custom update handler? Some progress, new issue

Further progress now hampered by configuring an update log. When I
follow instructions found around the web, I get this:

SEVERE: Unable to create core: collection1
caused by
Caused by: java.lang.NullPointerException
        at org.apache.solr.common.params.SolrParams.toSolrParams(SolrParams.java:295)

Now, the updateLog is configured thus:

 <requestHandler name="/update/partial"
                  class="solr.BinaryUpdateRequestHandler">
       <lst name="defaults">
         <str name="update.chain">partial</str>
       </lst>
    <updateLog class="solr.FSUpdateLog">
      <str name="dir">${solr.data.dir:}</str>
    </updateLog>
 </requestHandler>

I think the issue lies with "solr.data.dir"
The wikis just say to drop that into the request handler chain,
without any explanation of where "solr.data.dir" comes from.

In any case, I might have successfully settled on how to choose which
update chain, but now I am deep into the bowels of update logs.

What am I missing?

Many thanks
Jack


On Mon, Mar 11, 2013 at 9:45 PM, Jack Park <ja...@topicquests.org> wrote:
> Many thanks.
> Let me record here what I have tried.
> I have viewed:
> http://wiki.apache.org/solr/UpdateXmlMessages
>
> and this github project which is suggestive:
> https://github.com/industria/solrprocessors
>
>
> I now have two UpdateRequestChains:
>
> <updateRequestProcessorChain name="harvest" default="true">
>       <processor class="solr.RunUpdateProcessorFactory"/>
>       <processor
> class="org.apache.solr.update.TopicQuestsDocumentProcessFactory">
>         <str name="inputField">hello</str>
>       </processor>
>       <processor class="solr.LogUpdateProcessorFactory"/>
>  </updateRequestProcessorChain>
>
> and the new one (which is "harvest" without the
> TopicQuestsDocumentProcessFactory):
>
> <updateRequestProcessorChain name="partial" default="false">
>       <processor class="solr.RunUpdateProcessorFactory"/>
>       <processor class="solr.LogUpdateProcessorFactory"/>
> </updateRequestProcessorChain>
>
> Before I added "partial"
>   <requestHandler name="/update"
>                   class="solr.XmlUpdateRequestHandler">
> ...
>
> "harvest" always ran using http://localhost:8983/solr as the base URL.
>
> A goal was to use "harvest" only for "updates" and use "partial" for
> partial updates.
>
> I am now feeding partial with this code:
>
>                                 UpdateRequest ur = new UpdateRequest();
>                                 ur.add(document);
>                                 ur.setCommitWithin(1000);
>                                 UpdateResponse response = ur.process(updateServer);
> where updateServer is a second SolrJ server set to
> http://localhost:8983/solr/update
>
> But, what is now happening, after I made this addition:
>
>   <requestHandler name="/update"
>                   class="solr.XmlUpdateRequestHandler">
>        <lst name="defaults">
>          <str name="update.chain">partial</str>
>        </lst>
>   </requestHandler>
>
> dropping "partial" into /update where nothing was there before,
>
> Now, just "partial" is running from the base URL and "harvest" is
> never called, which means that I never see partial updates to validate
> that part of the code.
>
> At issue is this:
>
> I have two "update" pathways:
> One for when I am adding new documents
> One for which I am performing partial updates
>
> May I ask how I can configure my system to use "harvest" for new
> documents and "partial" for when partial updates are sent in?
>
> Many thanks
> Jack
>
>
> On Mon, Mar 11, 2013 at 12:23 AM, Upayavira <uv...@odoko.co.uk> wrote:
>> You need to refer to your chain in a RequestHandler config. Search for
>> /update, duplicate that, and change the chain it points to.
>>
>> Upayavira
>>
>> On Mon, Mar 11, 2013, at 05:22 AM, Jack Park wrote:
>>> With 4.1, not in cloud configuration, I have a custom response handler
>>> chain which injects an additional handler for studying the documents
>>> as they come in. But, when I do partial updates on those documents, I
>>> don't want them to be studied again, so I created another version of
>>> the same chain, but without my added feature. I named it "/partial".
>>>
>>> When I create an instance of SolrJ for the url <server>/solr/partial,
>>> I get back this error message:
>>>
>>> Server at http://localhost:8983/solr/partial returned non ok
>>> status:404, message:Not Found
>>> {locator=2146fd50-fac9-47d5-85c0-47aaeafe177f,
>>> tuples={set=99edfffe-b65c-4b5e-9436-67085ce49c9c}}
>>>
>>> Here is the configuration for that:
>>>
>>> <updateRequestProcessorChain name="/partial" default="false">
>>>       <processor class="solr.RunUpdateProcessorFactory"/>
>>>       <processor class="solr.LogUpdateProcessorFactory"/>
>>> </updateRequestProcessorChain>
>>>
>>> The normal handler chain is this:
>>>
>>> <updateRequestProcessorChain name="harvest" default="true">
>>>       <processor class="solr.RunUpdateProcessorFactory"/>
>>>       <processor
>>> class="org.apache.solr.update.TopicQuestsDocumentProcessFactory">
>>>         <str name="inputField">hello</str>
>>>       </processor>
>>>       <processor class="solr.LogUpdateProcessorFactory"/>
>>> </updateRequestProcessorChain>
>>>
>>> which runs on a SolrJ set for  http://localhost:8983/solr/
>>>
>>> What might I be missing?
>>>
>>> Many thanks
>>> Jack