Question

I use DSE 3.2.0. When I try to index in Solr a DateType column (system locale is GMT+3), I get following SOLR exception:

org.apache.solr.common.SolrException: org.apache.solr.common.SolrException: Invalid Date String:'2013-10-10 23:59:59+0300'
at com.datastax.bdp.cassandra.index.solr.CassandraDirectUpdateHandler2.deleteByQuery(CassandraDirectUpdateHandler2.java:230)
at com.datastax.bdp.cassandra.index.solr.AbstractSolrSecondaryIndex.doDelete(AbstractSolrSecondaryIndex.java:628)
at com.datastax.bdp.cassandra.index.solr.Cql3SolrSecondaryIndex.updateColumnFamilyIndex(Cql3SolrSecondaryIndex.java:138)
at com.datastax.bdp.cassandra.index.solr.AbstractSolrSecondaryIndex$3.run(AbstractSolrSecondaryIndex.java:896)
at com.datastax.bdp.cassandra.index.solr.concurrent.IndexWorker.run(IndexWorker.java:38)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: org.apache.solr.common.SolrException: Invalid Date String:'2013-10-10 23:59:59+0300'
at org.apache.solr.schema.DateField.parseMath(DateField.java:182)
at org.apache.solr.analysis.TrieTokenizer.reset(TrieTokenizerFactory.java:135)
at org.apache.solr.parser.SolrQueryParserBase.newFieldQuery(SolrQueryParserBase.java:409)
at org.apache.solr.parser.SolrQueryParserBase.getFieldQuery(SolrQueryParserBase.java:959)
at org.apache.solr.parser.SolrQueryParserBase.getFieldQuery(SolrQueryParserBase.java:574)
at org.apache.solr.parser.SolrQueryParserBase.handleQuotedTerm(SolrQueryParserBase.java:779)

Schema below:

<schema name="mach" version="1.1">
<types>
    <fieldType name="string" class="solr.StrField"/>
    <fieldType name="int" class="solr.TrieIntField"/>
    <fieldType name="date" class="solr.TrieDateField"/>
 </types>
 <fields>
    <field name="snapshot_date" type="date" indexed="true"  stored="true"/>
    <field name="account_id" type="string" indexed="true"  stored="true"/>
    <field name="account_type" type="string" indexed="true"  stored="true" />
  </fields>
  <uniqueKey>(snapshot_date, account_id)</uniqueKey>
  <defaultSearchField>account_id</defaultSearchField>
 </schema>
Was it helpful?

Solution 2

This is a bug affecting reindexing of deleted rows, and will be fixed in DSE 3.2.3.

OTHER TIPS

Solr uses a particular subset of the ISO date format: YYYY-MM-DDThh:mm:ssZ or ss.tttZ at the end, suppressing any trailing zeros. Only GMT is supported ("Z").

So, your value of "2013-10-10 23:59:59+0300" should be expressed as "2013-10-10T20:59:59Z".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top