You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Charles Draper (JIRA)" <ji...@apache.org> on 2015/11/09 19:15:10 UTC
[jira] [Updated] (SOLR-8264) Date boosting losing to constant value
in min function when date value is null
[ https://issues.apache.org/jira/browse/SOLR-8264?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Charles Draper updated SOLR-8264:
---------------------------------
Description:
I am following https://wiki.apache.org/solr/FunctionQuery#Date_Boosting for date boosting. This works great except when the date field is non-existent and I attempt to set a maximum value. As I understand it, a non-existent date field will default to the start of the epoch for functions. And so the following boost works even though date_s doesn't exist for the particular record:
{code}
recip(ms(NOW/YEAR,date_s),3.16e-11,1,1)
0.021798734 = 1.0/(3.16E-11*float(ms(const(1420070400000),date(date_s)=null))+1.0)
{code}
However, when I try to apply a min function, the constant value is always selected whether it is greater or less than the recip calculation:
{code}
min(1,recip(ms(NOW/YEAR,date_s),3.16e-11,1,1))
1.0 = min(const(1),1.0/(3.16E-11*float(ms(const(1420070400000),date(date_s)=null))+1.0))
{code}
I am currently getting around the issue by supplying a default value for the field in my schema.xml.
was:
I am following https://wiki.apache.org/solr/FunctionQuery#Date_Boosting for date boosting. This works great except when the date field is non-existent and I attempt to set a maximum value. As I understand it, a non-existent date field will default to the start of the epoch for functions. And so the following boost works even though date_s doesn't exist for the particular record:
{code}
recip(ms(NOW/YEAR,date_s),3.16e-11,1,1)
0.021798734 = 1.0/(3.16E-11*float(ms(const(1420070400000),date(date_s)=null))+1.0)
{code}
However, when I try to apply a min function, the constant value is always selected whether it is greater or less than the recip calculation:
{code}
min(1,recip(ms(NOW/YEAR,date_s),3.16e-11,1,1))
1.0 = min(const(1),1.0/(3.16E-11*float(ms(const(1420070400000),date(date_s)=null))+1.0))
{code}
I am currently getting around the issue by supplying a default value for the field in my schema.xml.
> Date boosting losing to constant value in min function when date value is null
> ------------------------------------------------------------------------------
>
> Key: SOLR-8264
> URL: https://issues.apache.org/jira/browse/SOLR-8264
> Project: Solr
> Issue Type: Bug
> Affects Versions: 5.3
> Reporter: Charles Draper
> Priority: Minor
>
> I am following https://wiki.apache.org/solr/FunctionQuery#Date_Boosting for date boosting. This works great except when the date field is non-existent and I attempt to set a maximum value. As I understand it, a non-existent date field will default to the start of the epoch for functions. And so the following boost works even though date_s doesn't exist for the particular record:
> {code}
> recip(ms(NOW/YEAR,date_s),3.16e-11,1,1)
> 0.021798734 = 1.0/(3.16E-11*float(ms(const(1420070400000),date(date_s)=null))+1.0)
> {code}
> However, when I try to apply a min function, the constant value is always selected whether it is greater or less than the recip calculation:
> {code}
> min(1,recip(ms(NOW/YEAR,date_s),3.16e-11,1,1))
> 1.0 = min(const(1),1.0/(3.16E-11*float(ms(const(1420070400000),date(date_s)=null))+1.0))
> {code}
> I am currently getting around the issue by supplying a default value for the field in my schema.xml.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org