Thanks Yonik, I was just looking at that actually.
Trying something like recip(ms(NOW,datetime),3.16e-11,1,1)^10  now.
My 'inspiration' for the ord method was actually the Solr 1.4 Enterprise Search 
server book. Page 126 has a section 'using reciprocals and rord with dates'. 
You should let those guys know what's up!

Thanks,
Kallin.

-----Original Message-----
From: ysee...@gmail.com [mailto:ysee...@gmail.com] On Behalf Of Yonik Seeley
Sent: Wednesday, January 06, 2010 11:23 AM
To: solr-user@lucene.apache.org
Subject: Re: ord on TrieDateField always returning max

Besides using up a lot more memory, ord() isn't even going to work for
a field with multiple tokens indexed per value (like tdate).
I'd recommend using a function on the date value itself.
http://wiki.apache.org/solr/FunctionQuery#ms

-Yonik
http://www.lucidimagination.com



On Wed, Jan 6, 2010 at 10:52 AM, Nagelberg, Kallin
<knagelb...@globeandmail.com> wrote:
> Hi everyone,
>
> I've been trying to add a date based boost to my queries. I have a field like:
>
> <fieldType name="tdate" class="solr.TrieDateField" omitNorms="true" 
> precisionStep="6" positionIncrementGap="0"/>
> <field name="datetime" type="tdate" indexed="true" stored="true" 
> required="true" />
>
> When I look at the datetime field in the solr schema browser I can see that 
> there are 9051 distinct dates.
>
> When I try to add the parameter to my query like: bf=ord(datetime) (on a 
> dismax query) I always get 9051 as the result of the function. I see this in 
> the debug data:
>
>
> 1698.6041 = (MATCH) FunctionQuery(top(ord(datetime))), product of:
>
>    9051.0 = 9051
>
>    1.0 = boost
>
>    0.18767032 = queryNorm
>
>
>
> It is exactly the same for every result, even though each result has a 
> different value for datetime.
>
>
>
> Does anyone have any suggestions as to why this could be happening? I have 
> done extensive googling with no luck.
>
>
>
> Thanks,
>
> Kallin Nagelberg.
>
>

Reply via email to