thanx Eric, that was very helpfull

2010/2/12 Erik Hatcher <erik.hatc...@gmail.com>

> That would be the problem then, I believe.  Simply don't post a value to
> get the default value to work.
>
>        Erik
>
>
> On Feb 12, 2010, at 10:18 AM, nabil rabhi wrote:
>
>  yes, sometimes the document has postal_code with no values , i still post
>> it
>> to solr
>> 2010/2/12 Erik Hatcher <erik.hatc...@gmail.com>
>>
>>  When a document has no value, are you still sending a postal_code field
>>> in
>>> your post to Solr?  Seems like you are.
>>>
>>>      Erik
>>>
>>>
>>> On Feb 12, 2010, at 8:12 AM, nabil rabhi wrote:
>>>
>>> in the schema.xml I have fileds with int type and default value
>>>
>>>> exp:  <field name="postal_code" type="int" indexed="true" stored="true"
>>>> default="0"/>
>>>> but when a document has no value for the field "postal_code"
>>>> at indexing, I get the following error:
>>>>
>>>> Posting file Immo.xml to http://localhost:8983/solr/update/
>>>> <html>
>>>> <head>
>>>> <meta http-equiv="Content-Type" content="text/html;
>>>> charset=ISO-8859-1"/>
>>>> <title>Error 500 </title>
>>>> </head>
>>>> <body><h2>HTTP ERROR: 500</h2><pre>For input string: ""
>>>>
>>>> java.lang.NumberFormatException: For input string: ""
>>>>  at
>>>>
>>>>
>>>> java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
>>>>  at java.lang.Integer.parseInt(Integer.java:470)
>>>>  at java.lang.Integer.parseInt(Integer.java:499)
>>>>  at org.apache.solr.schema.TrieField.createField(TrieField.java:416)
>>>>  at org.apache.solr.schema.SchemaField.createField(SchemaField.java:94)
>>>>  at
>>>>
>>>>
>>>> org.apache.solr.update.DocumentBuilder.toDocument(DocumentBuilder.java:246)
>>>>  at
>>>>
>>>>
>>>> org.apache.solr.update.processor.RunUpdateProcessor.processAdd(RunUpdateProcessorFactory.java:60)
>>>>  at org.apache.solr.handler.XMLLoader.processUpdate(XMLLoader.java:139)
>>>>  at org.apache.solr.handler.XMLLoader.load(XMLLoader.java:69)
>>>>  at
>>>>
>>>>
>>>> org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:54)
>>>>  at
>>>>
>>>>
>>>> org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
>>>>  at org.apache.solr.core.SolrCore.execute(SolrCore.java:1316)
>>>>  at
>>>>
>>>>
>>>> org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:338)
>>>>  at
>>>>
>>>>
>>>> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:241)
>>>>  at
>>>>
>>>>
>>>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
>>>>  at
>>>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
>>>>  at
>>>>
>>>>
>>>> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
>>>>  at
>>>> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
>>>>  at
>>>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
>>>>  at
>>>> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
>>>>  at
>>>>
>>>>
>>>> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:211)
>>>>  at
>>>>
>>>>
>>>> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
>>>>  at
>>>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
>>>>  at org.mortbay.jetty.Server.handle(Server.java:285)
>>>>  at
>>>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:502)
>>>>  at
>>>>
>>>>
>>>> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:835)
>>>>  at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:641)
>>>>  at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:202)
>>>>  at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:378)
>>>>  at
>>>>
>>>>
>>>> org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:226)
>>>>  at
>>>>
>>>>
>>>> org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)
>>>> </pre>
>>>>
>>>> </body>
>>>> </html>
>>>>
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>> <response>
>>>> <lst name="responseHeader"><int name="status">0</int><int
>>>> name="QTime">4</int></lst>
>>>> </response>
>>>>
>>>> any help? thx
>>>>
>>>>
>>>
>>>
>

Reply via email to