It's stored in the database as a bigint, seconds since epoch, not a
date. I need to store the integer value in Solr for the application to
consume (done as a tlong), but I want to create a second copy that's
tdate. That's the part I don't know how to do. If I just do a
copyField in the schema, will that do it, or will I need to write some
magic somewhere?
Shawn
On 4/14/2010 9:46 PM, Lance Norskog wrote:
Wait- it's in a database? That's much simpler.
The select should supply the date as an SQL Date or Timestamp type.
The DIH will get this directly and store it as a Solr tdate. You
should not have to do any arithmetic or formatting of date strings.
This may need a few layers of SQL functions.
On 4/14/10, Shawn Heisey<s...@elyograg.org> wrote:
On 4/14/2010 8:12 AM, Shawn Heisey wrote:
On 4/12/2010 9:29 PM, Lance Norskog wrote:
During indexing: the basic Solr XmlUpdateHandler does not have a
facility for this. In the DataImportHandler you can add Javascript
that takes your 'seconds since epoch', adds the delta between your
epoch and 1/1/1970, and multiplies by 1000.
I had hoped there was a way to tell schema.xml to do the math, but
this sounds like there isn't. If you could point me at some examples
of how to put javascript into data-config.xml, then I could probably
work out how to do the javascript that I would need. I might be able
to alter my SQL query in the DIH config to multiply the value by 1000,
but that puts all the load on the SQL server instead of utilizing the
multiple CPUs involved in my shards. I'm pretty sure that the epoch
on my dates is also 1970/01/01.
What I'd truly like is a way to convert it directly to tdate, so all
of Solr's date capabilities become available. Is that nontrivial, or
is that perhaps what you've been already describing?
Thanks for all the help you've given so far. I've made a lot of
progress.