Search code examples
ruby-on-railssolrsunspot-rails

Error adding field 'created_at_d' for input string for datetime field in solr with sunspot_rails


There are a few questions related to this in stackoverflow but I could not find the answer that work for me, I'm using the last version of solr and for the docs I guess that I don't need a schema.xml and all the solutions told me that I need to add configurations in that file. What I'm missing? This is the error:

"msg":"ERROR: [doc=Announcement 1] Error adding field 'created_at_d'='2018-07-21T00:00:00Z' msg=For input string: \"2018-07-21T00:00:00Z\""


Solution

  • The answer is (in my case at least), that there was an error with the datetime tipe in the solr schema, (you can change it in the web interface), was that the type _d points to double, no to datetime, you can change this and the error will be gone.