So, if I have my database multiply my value by 1000, I can put that directly into a tdate field and it'll work as expected?

If that's the case, I think I might be able to modify my query from "SELECT *" to "SELECT *,post_date*1000 as pdate" and add the pdate field to the schema as type tdate. Sound right?


On 4/17/2010 3:00 PM, Lance Norskog wrote:
No, a copyField will not do the xlation from (seconds from epoch) to
(milliseconds from 1/1/1970). You should be able to do this with a
combination of functions in your database SELECT call. The major DBs
all have a wealth of functions that xform between numbers and dates.

The DIH is smart about types: if the DB select returns a value as a
database date type, it becomes a java.sql.Date which the DIH then
makes a Solr 'tdate'.

In MYSQL there's a bunch of time/date/number/string xformers:

http://dev.mysql.com/tech-resources/articles/4.1/time.html

It's easier to do this in the database, than in the DIH.

Reply via email to