Apply Boosting Based on a Field Value

GaussDate(b => b.Field(p => p.Date)
.Origin(DateTime.MaxValue)
.Decay(0.8)
.Scale("1d")
.Filter(f => f.DateRange(dr => dr.GreaterThanOrEquals(DateTime.MaxValue))))

This gauss should be applied to all documents where DR is bigger or equals to DateTime.MaxValue. Is this even possible?

It is DateTime.MaxValue, not greater than this value.

So only apply this function on documents where the date (dr) is bigger/equals than December 31, 9999?

I need it to be applied to documents with date as DateTime.MaxValue. But I don't recall there's an action for matching the exact value, so I used GreaterThanOrEquals.

I removed the DateTime.MaxValue and set the type property as "pages" and it worked like a charm!

  .Functions(fn => fn.FieldValueFactor(fvf => fvf.Field(ff => 
      ff.Importance).Factor(0.00033).Filter(f => !f.Term(t => t.Field(tf => tf.Type).Value("pages"))))
     .FieldValueFactor(fvf => fvf.Field(ff => ff.Importance).Factor(0.009).Filter(f => f.Term(t => t.Field(tf => 
          tf.Type).Value("pages"))))
    .GaussDate(b => b.Field(p => p.Date).Origin(DateMath.Now).Decay(0.5).Scale("140d").Filter(f => 
        f.DateRange(dr => dr.LessThanOrEquals(DateMath.Now))))
 )

Thank you so much for everything :smiley:

Awesome! :smiley:

Glad that you managed to work it out!

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.