Rick: Hmmm, try this: https://cwiki.apache.org/confluence/display/solr/Function+Queries. It's not quite as explicit, but it's the latest document.
Essentially that's what the function on that page does, something like: "recip(rord (creationDate),1,1000,1000)" the "recip" function is actually recip(x,m,a,b)implementing a/(m*x+b). So by playing with the constants, you can boost on a sliding scale where there is more discrimination between more recent docs. I.e. a great difference in the boost applied to a doc now .vs. a week ago than between 100 and 101 weeks ago... Or any other combinations of math functions you want to use for your boost, that page has a bunch. Best, Erick On Tue, Mar 14, 2017 at 7:28 AM, Rick Leir <rl...@leirtech.com> wrote: > Hi Erick > We have ten year old documents and new ones which often score about the same > just based on default similarity. But the newer ones are much more relevant > in our case. > > Suppose we de-boost proportionally to (NOW/YEAR - modifiedDate/YEAR). Thanks > for the link you provided, it had not jumped out at me. Is the syntax up to > date (no pun!)? > > Walter, how do you calculate this logarithmically? > Thanks, Rick > > On March 14, 2017 1:21:52 AM EDT, Erick Erickson <erickerick...@gmail.com> > wrote: >>first I think the requirement is a bad one. Why should a document with >>low relevance 29 days ago score higher than the perfect document from >>31 days ago? That doesn't seem like it serves the user very well... >> >>And then "However in cases where update date is unavailable I need to >>sort it using created date." Does that mean if a doc has no update >>date but does have a created date 10 days ago you want to sort it >>before any docs older than 30 days? If so the simplest bit here would >>be to insure that any incoming doc has an update date by copying the >>created date into the update field if there is no update field. >> >>Now, all that aside, you sort by date with function queries. And >>function queries can have if clauses. So your sort function will be a >>big long set of if statements giving a boost to docs in your ranges. >>Or you can make your own function query plugin that would undoubtedly >>be more efficient. See the ref guide for "function queries". >> >>But again, I think this is a case where if you present the people who >>came up with this requirement with an explanation of the effects, you >>may just be able to sort by giving weight to more recent documents and >>be done with it. See: >>https://wiki.apache.org/solr/SolrRelevancyFAQ#How_can_I_boost_the_score_of_newer_documents >> >>Best, >>Erick >> >>On Mon, Mar 13, 2017 at 7:17 PM, Atita Arora <atitaar...@gmail.com> >>wrote: >>> Hi all, >>> >>> I am trying to resolve a problem here where I have to fiddle around >>with >>> set of dates ( created and updated date). >>> My use is that I have to make sure that the document with latest >>(recent) >>> update date should come higher in my search results. >>> Precisely, I am required to maintain 3 buckets wherein documents >>with >>> updated date falling in range of last 30 days should have maximum >>weight, >>> followed by update date in 60 and 90 and the rest. >>> However in cases where update date is unavailable I need to sort it >>using >>> created date. >>> I am not sure how do I achieve this. >>> Any insights here would be a great help. >>> Thanks in advance. >>> Regards, >>> Atita > > -- > Sent from my Android device with K-9 Mail. Please excuse my brevity.