Hey Rhys,

Short Answer: Try using "set": null and not "set": "null".

Explanation: Although I empty fields via XML, I can see a similar problem
in your query that is actually telling the value to be a string "null" and
not the type null. See:

{ "id": "601000", "agent": {"set": "null"} ...

This commands Solr to index "null" to agent field that has fieldType of int
and that's why NumberFormatException. I could not index null by this either:

<field name="cat_id" update="add">null</field>

and would get the same error.

This is the command that I use now:

<field name="cat_id" update="set" null="true" />

Notice the attribute null="true". You should be doing the similar thing via
json. Upon googling
<https://subscription.packtpub.com/book/big_data_and_business_intelligence/9781782164845/1/ch01lvl1sec20/atomic-updates-intermediate>,
I think this should work:

{ "id": "601000", "agent": {"set": null} ...

Notice the no quotes enclosing around null.

On Sat, 14 Dec 2019 at 01:17, rhys J <rhyssha...@gmail.com> wrote:

> When I do the following update:
>
> curl http://localhost:8983/solr/dbtr/update?commit=true -d '[{ "id":
> "601000", "agen
> t": {"set": "null"},"assign_id": {"set": "320"},"client_group": {"set":
> "null"},"credit_class": {"se
> t": "null"},"credit_hold": {"set": "null"},"credit_hold_date": {"set":
> "null"},"credit_limit": {"set
> ": "null"},"credit_terms": {"set": "null"},"currency": {"set":
> "null"},"data_signature": {"set": "nu
> ll"},"debtor_id": {"set": "601000"},"dl1": {"set": "25611"},"dl2": {"set":
> "null"},"do_not_call": {"
> set": "null"},"do_not_call_date": {"set": "null"},"do_not_report": {"set":
> "null"},"in_aris_date": {
> "set": "2016-09-01 00:00:00"},"name1": {"set": "60 Grit Studios"},"name2":
> {"set": "null"},"next_con
> tact_date": {"set": "2018-12-24 00:00:00"},"parent_customer_number":
> {"set": "null"},"potential_bad_debt": {"set": "null"},"priority_followup":
> {"set": "null"},"reference_no": {"set": "25611"},"report_as": {"set":
> "null"},"report_status": {"set": "null"},"risk": {"set":
> "null"},"rms_acct_id": {"set": "null"},"salesperson": {"set":
> "null"},"ssn1": {"set": "null"},"ssn2": {"set": "null"},"status_code":
> {"set": "172"},"status_date": {"set": "2018-10-30 00:00:00"},"timestamp":
> {"set": "null"},"tz_offset": {"set": "null"},"warning_item_no": {"set":
> "null"},"watch_list": {"set": "null"},"watch_list_date": {"set":
> "null"},}]'
>
> I get the following error:
>
>  "error":{
>     "msg":"For input string: \"null\"",
>     "trace":"java.lang.NumberFormatException: For input string:
> \"null\"\n\tat java.base/jdk.interna
>
> l.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054)\n\tat
> java.base/jdk.internal.
> math.FloatingDecimal.parseFloat(FloatingDecimal.java:122)\n\tat
> java.base/java.lang.Float.parseFloat
> (Float.java:461)\n\tat
>
> org.apache.solr.schema.IntPointField.toNativeType(IntPointField.java:54)\n\ta
> t
>
> org.apache.solr.update.processor.AtomicUpdateDocumentMerger.getNativeFieldValue(AtomicUpdateDocume
> ntMerger.java:563)\n\tat
> org.apache.solr.update.processor.AtomicUpdateDocumentMerger.doSet(AtomicUpd
> ateDocumentMerger.java:436)\n\tat
> org.apache.solr.update.processor.AtomicUpdateDocumentMerger.merge(
> AtomicUpdateDocumentMerger.java:112)\n\tat
> org.apache.solr.update.processor.DistributedUpdateProcess
> or.getUpdatedDocument(DistributedUpdateProcessor.java:704)\n\tat
> org.apache.solr.update.processor.Di
>
> stributedUpdateProcessor.doVersionAdd(DistributedUpdateProcessor.java:372)\n\tat
> org.apache.solr.upd
>
> ate.processor.DistributedUpdateProcessor.lambda$versionAdd$0(DistributedUpdateProcessor.java:337)\n\
> tat
>
> org.apache.solr.update.VersionBucket.runWithLock(VersionBucket.java:50)\n\tat
> org.apache.solr.up
>
> date.processor.DistributedUpdateProcessor.versionAdd(DistributedUpdateProcessor.java:337)\n\tat
> org.
>
> apache.solr.update.processor.DistributedUpdateProcessor.processAdd(DistributedUpdateProcessor.java:2
> 23)\n\tat
>
> org.apache.solr.update.processor.LogUpdateProcessorFactory$LogUpdateProcessor.processAdd(L
> ogUpdateProcessorFactory.java:103)\n\tat
>
> org.apache.solr.update.processor.UpdateRequestProcessor.processAdd(UpdateRequestProcessor.java:55)\n\tat
>
> org.apache.solr.update.processor.AddSchemaFieldsUpdateProcessorFactory$AddSchemaFieldsUpdateProcessor.processAdd(AddSchemaFieldsUpdateProcessorFactory.java:475)\n\tat
>
> org.apache.solr.update.processor.UpdateRequestProcessor.processAdd(UpdateRequestProcessor.java:55)\n\tat
>
> org.apache.solr.update.processor.FieldMutatingUpdateProcessor.processAdd(FieldMutatingUpdateProcessor.java:118)\n\tat
>
> org.apache.solr.update.processor.UpdateRequestProcessor.processAdd(UpdateRequestProcessor.java:55)\n\tat
>
> org.apache.solr.update.processor.FieldMutatingUpdateProcessor.processAdd(FieldMutatingUpdateProcessor.java:118)\n\tat
>
> org.apache.solr.update.processor.UpdateRequestProcessor.processAdd(UpdateRequestProcessor.java:55)\n\tat
>
> org.apache.solr.update.processor.FieldMutatingUpdateProcessor.processAdd(FieldMutatingUpdateProcessor.java:118)\n\tat
>
> org.apache.solr.update.processor.UpdateRequestProcessor.processAdd(UpdateRequestProcessor.java:55)\n\tat
>
> org.apache.solr.update.processor.FieldMutatingUpdateProcessor.processAdd(FieldMutatingUpdateProcessor.java:118)\n\tat
>
> org.apache.solr.update.processor.UpdateRequestProcessor.processAdd(UpdateRequestProcessor.java:55)\n\tat
>
> org.apache.solr.update.processor.FieldNameMutatingUpdateProcessorFactory$1.processAdd(FieldNameMutatingUpdateProcessorFactory.java:75)\n\tat
>
> org.apache.solr.update.processor.UpdateRequestProcessor.processAdd(UpdateRequestProcessor.java:55)\n\tat
>
> org.apache.solr.update.processor.AbstractDefaultValueUpdateProcessorFactory$DefaultValueUpdateProcessor.processAdd(AbstractDefaultValueUpdateProcessorFactory.java:92)\n\tat
>
> org.apache.solr.handler.loader.JsonLoader$SingleThreadedJsonLoader.handleAdds(JsonLoader.java:507)\n\tat
>
> org.apache.solr.handler.loader.JsonLoader$SingleThreadedJsonLoader.processUpdate(JsonLoader.java:145)\n\tat
>
> org.apache.solr.handler.loader.JsonLoader$SingleThreadedJsonLoader.load(JsonLoader.java:121)\n\tat
> org.apache.solr.handler.loader.JsonLoader.load(JsonLoader.java:84)\n\tat
>
> org.apache.solr.handler.UpdateRequestHandler$1.load(UpdateRequestHandler.java:97)\n\tat
>
> org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:68)\n\tat
>
> org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:199)\n\tat
> org.apache.solr.core.SolrCore.execute(SolrCore.java:2578)\n\tat
> org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:780)\n\tat
> org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:566)\n\tat
>
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:423)\n\tat
>
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:350)\n\tat
>
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1602)\n\tat
>
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:540)\n\tat
>
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)\n\tat
>
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)\n\tat
>
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)\n\tat
>
> org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)\n\tat
>
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1711)\n\tat
>
> org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)\n\tat
>
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1347)\n\tat
>
> org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)\n\tat
>
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480)\n\tat
>
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1678)\n\tat
>
> org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)\n\tat
>
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1249)\n\tat
>
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)\n\tat
>
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:220)\n\tat
>
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:152)\n\tat
>
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)\n\tat
>
> org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:335)\n\tat
>
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)\n\tat
> org.eclipse.jetty.server.Server.handle(Server.java:505)\n\tat
> org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:370)\n\tat
>
> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:267)\n\tat
> org.eclipse.jetty.io
> .AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)\n\tat
> org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)\n\tat
> org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)\n\tat
>
> org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)\n\tat
>
> org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)\n\tat
>
> org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)\n\tat
>
> org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)\n\tat
>
> org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)\n\tat
>
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:781)\n\tat
>
> org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:917)\n\tat
> java.base/java.lang.Thread.run(Thread.java:835)\n",
>     "code":500}}
>
> ___
>
> Near as I can tell, it's complaining about the null value?
>
> I did this, because of the instructions I found here:
>
> https://lucene.apache.org/solr/guide/6_6/updating-parts-of-documents.html
>
> Where it says if you want to remove a value from the index, use 'null' to
> take care of empty strings?
>
> Has anyone seen this problem?
>
> Thanks,
>
> Rhys
>


-- 
-- 
Regards,

*Paras Lehana* [65871]
Development Engineer, Auto-Suggest,
IndiaMART Intermesh Ltd.

8th Floor, Tower A, Advant-Navis Business Park, Sector 142,
Noida, UP, IN - 201303

Mob.: +91-9560911996
Work: 01203916600 | Extn:  *8173*

-- 
*
*

 <https://www.facebook.com/IndiaMART/videos/578196442936091/>

Reply via email to