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 Yunee Lee <yu...@infor.com> on 2018/06/20 18:35:12 UTC

Solr Upgrade DateField to TrieDateField

 Hi, 
Hi,
I have  two questions.

1. solr index on verion 4.6.0 and there are multiple date fields as the type DateField in schema.xml
When I upgraded to version 5.2.1 with new data type Trie* for integer, float, string and date.
Only date fields are not upgraded properly with  the following error.
    "trace": "java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Date\n\tat org.apache.solr.schema.TrieDateField.toObject(TrieDateField.java:337)\n\tat org.apache.solr.schema.TrieDateField.toObject(TrieDateField.java:102)\n\tat org.apache.solr.schema.TrieField.write(TrieField.java:256)\n\tat org.apache.solr.response.TextResponseWriter.writeVal(TextResponseWriter.java:131)\n\tat org.apache.solr.response.JSONWriter.writeSolrDocument(JSONResponseWriter.java:356)\n\tat org.apache.solr.response.TextResponseWriter.writeDocuments(TextResponseWriter.java:263)\n\tat org.apache.solr.response.TextResponseWriter.writeVal(TextResponseWriter.java:173)\n\tat org.apache.solr.response.JSONWriter.writeNamedListAsMapWithDups(JSONResponseWriter.java:184)\n\tat org.apache.solr.response.JSONWriter.writeNamedList(JSONResponseWriter.java:300)\n\tat org.apache.solr.response.JSONWriter.writeResponse(JSONResponseWriter.java:96)\n\tat org.apache.solr.response.JSONResponseWriter.write(JSONResponseWriter.java:61)\n\tat org.apache.solr.response.QueryResponseWriterUtil.writeQueryResponse(QueryResponseWriterUtil.java:53)\n\tat org.apache.solr.servlet.HttpSolrCall.writeResponse(HttpSolrCall.java:727)\n\tat org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:459)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:227)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:196)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)\n\tat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)\n\tat org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)\n\tat org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)\n\tat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)\n\tat org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)\n\tat org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)\n\tat org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)\n\tat org.eclipse.jetty.server.Server.handle(Server.java:497)\n\tat org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)\n\tat org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)\n\tat org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)\n\tat java.lang.Thread.run(Thread.java:745)\n",
    "code": 500

2. I also ran the Index upgrader then the core is Not registering correctly with 
"msg": "java.lang.String cannot be cast to java.util.Date"

Is there any solutions with config changes without reindexing entire documents? 



Re: Solr Upgrade DateField to TrieDateField

Posted by Shawn Heisey <ap...@elyograg.org>.
On 6/20/2018 12:35 PM, Yunee Lee wrote:
> I have  two questions.
>
> 1. solr index on verion 4.6.0 and there are multiple date fields as the type DateField in schema.xml
> When I upgraded to version 5.2.1 with new data type Trie* for integer, float, string and date.
> Only date fields are not upgraded properly with  the following error.
>     "trace": "java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Date\n\tat 

<snip>

> 2. I also ran the Index upgrader then the core is Not registering correctly with 
> "msg": "java.lang.String cannot be cast to java.util.Date"
>
> Is there any solutions with config changes without reindexing entire documents?

If you change the type on ANY field, you have to reindex, and it's
typically best to build the entire index again from scratch.  There are
no tricks to avoid reindexing when changing your schema.

https://wiki.apache.org/solr/HowToReindex

Here's a four year old thread from this mailing list that might be relevant:

http://lucene.472066.n3.nabble.com/Trouble-with-TrieDateFields-td4143082.html

Thanks,
Shawn