On Tue, May 24, 2011 at 1:03 PM, stockii <stock.jo...@googlemail.com> wrote:
> okay, thx =)
[...]

So, which version of Solr are you using? Just tried this with
Solr 1.4, and things seem to work as expected for me. Here
is what I did:
* Inserted a zero value into a mysql date field called testdate
  (also tried with datetime field). A select shows me "0000-00-00",
  as expected.
* Used DIH, with:
  - <dataSource
...url="jdbc:mysql://localhost/mydb?zeroDateTimeBehavior=convertToNull/>
  - <document>
    <entity ... query="select testdate from ...">
       <field column="testdate" name="testdate"
dateTimeFormat="yyyy-MM-dd'T'hh:mm:ss'Z'"/>
       ...
    </entity>
  - schema.xml has
    <field name="testdate" type="date" indexed="true" stored="true"
multiValued="false"/>
  - Running dataimport works fine, and gives me a document
    with no value for "testdate" (expected, as we are setting it
    to NULL.

I suspect the problem is elsewhere. Could you share the
SELECT statement in the query attribute of your entit?

Regards,
Gora

Reply via email to