lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shawn Heisey <s...@elyograg.org>
Subject Re: dismax and date boosts
Date Tue, 20 Apr 2010 18:32:29 GMT
I found what I believe is a better option even if the multiplication 
would work - FROM_UNIXTIME.  That returns the same kind of output as you 
get from an actual database date field.

On 4/20/2010 12:07 PM, Shawn Heisey wrote:
> 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.
>


Mime
View raw message