lucenenet-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mirek Novák <mirek.no...@auto.cz>
Subject Re: Weighting results by 'freshness'
Date Fri, 05 May 2017 10:46:24 GMT
Hi,

I've done something like this using custom collector and reciprocal function 
known from SOLR.  My solution incorporates age of the doc and documents' 
category. With reciprocal function I have achieved nonlinear aging  of a 
document and different aging schema for different categories. I did it years 
ago with Lucene.NET 2.9.* it still works great.

All my work is based on those slides

https://www.slideshare.net/lucenerevolution/potter-timothy-boosting-documents-in-solr

M.


-----Původní zpráva----- 
From: Michael Newton
Sent: Wednesday, April 05, 2017 7:39 PM
To: user@lucenenet.apache.org
Subject: Weighting results by 'freshness'

Hi,
I've managed to build a nice little Lucene.net back end with 4.0.8 and the
free text side of things is working really well. However, I'd like to add a
weighting to the queries supplied that means that newer documents are
considered more highly (but not to outright sort by date).

I have a "created" field on all of my documents, which has been populated
using "DateTools.DateToString" with a resolution of day, but I'm uncertain
how to add a query which add weight to results based on "the higher the
value of field 'x', the better".

What would be the best way to go about this?

My current query code (in F#) looks like this:

    let parser =
        QueryParsers.Classic.MultiFieldQueryParser
            (Util.LuceneVersion.LUCENE_48, [| "title"; "content" |],
             context.Analyzer)
    let query = parser.Parse phrase

Many thanks,

Michael 


Mime
View raw message