You can probably use the FunctionQParserPlugin in conjunction with Query
ReRanking to achieve what you're trying to do.

q=foo&rq={!rerank reRankDocs=1000 reRankQuery=$qq}&qq={!func}someFunction()

What this is going to do is rerank the docs based on a function query.

Your function query will need to return a float because the query reranker
is expecting a score which is a float. So you'll have to devise function
query logic that will transform your date to a float.





Joel Bernstein
Search Engineer at Heliosearch


On Fri, Sep 5, 2014 at 7:06 PM, Ravi Solr <ravis...@gmail.com> wrote:

> Walter, thank you for the valuable insight. The problem I am facing is that
> between the term frequencies, mm, date boost and stemming the results can
> become very inconsistent...Look at the following examples
>
> Here the chronology is all over the place because of what I mentioned above
> http://www.washingtonpost.com/pb/newssearch/?query=malaysian+airline+crash
>
> Now take the instance of an old topic/news which was covered a a while ago
> for a period of time but not actively updated recently...In this case, the
> date boosting predominantly takes over because of common terms and we get a
> rash of irrelevant content
>
> http://www.washingtonpost.com/pb/newssearch/?query=faces+of+the+fallen
>
> This has become such a balancing act and hence I was looking to see if
> reRanking might help
>
> Thanks
>
> Ravi Kiran Bhaskar
>
>
>
>
>
> On Fri, Sep 5, 2014 at 1:32 PM, Walter Underwood <wun...@wunderwood.org>
> wrote:
>
> > Boosting on recency is probably a better approach. A fixed re-ranking
> > horizon will always be a compromise, a guess at the precision of the
> query.
> > It will give poor results for queries that are more or less specific than
> > the assumption.
> >
> > Think of the recency boost as a tie-breaker. When documents are similar
> in
> > relevance, show the most recent. This can work over a wide range of
> queries.
> >
> > For “malaysian airlines crash”, there are two sets of relevant documents,
> > one set on MH 370 starting six months ago, and one set on MH 17, two
> months
> > ago. But four hours ago, The Guardian published a “six months on” article
> > on MH 370. A recency boost will handle that complexity.
> >
> > wunder
> > Walter Underwood
> > wun...@wunderwood.org
> > http://observer.wunderwood.org/
> >
> >
> > On Sep 5, 2014, at 10:23 AM, Erick Erickson <erickerick...@gmail.com>
> > wrote:
> >
> > > OK, why can't you switch the clauses from Joel's suggestion?
> > >
> > > Something like:
> > > q=Malaysia plane crash&rq={!rerank reRankDocs=1000
> > > reRankQuery=$myquery}&myquery=*:*&sort=date+desc
> > >
> > > (haven't tried this yet, but you get the idea....).
> > >
> > > Best,
> > > Erick
> > >
> > > On Fri, Sep 5, 2014 at 9:33 AM, Markus Jelsma
> > > <markus.jel...@openindex.io> wrote:
> > >> Hi - You can already achieve this by boosting on the document's
> > recency. The result set won't be exactly ordered by date but you will get
> > the most relevant and recent documents on top.
> > >>
> > >> Markus
> > >>
> > >> -----Original message-----
> > >>> From:Ravi Solr <ravis...@gmail.com <mailto:ravis...@gmail.com> >
> > >>> Sent: Friday 5th September 2014 18:06
> > >>> To: solr-user@lucene.apache.org <mailto:solr-user@lucene.apache.org>
> > >>> Subject: Re: Query ReRanking question
> > >>>
> > >>> Thank you very much for responding. I want to do exactly the opposite
> > of
> > >>> what you said. I want to sort the relevant docs in reverse
> chronology.
> > If
> > >>> you sort by date before hand then the relevancy is lost. So I want to
> > get
> > >>> Top N relevant results and then rerank those Top N to achieve
> relevant
> > >>> reverse chronological results.
> > >>>
> > >>> If you ask Why would I want to do that ??
> > >>>
> > >>> Lets take a example about Malaysian airline crash. several articles
> > might
> > >>> have been published over a period of time. When I search for -
> malaysia
> > >>> airline crash blackbox - I would want to see "relevant" results but
> > would
> > >>> also like to see the the recent developments on the top i.e.
> > effectively a
> > >>> reverse chronological order within the relevant results, like
> telling a
> > >>> story over a period of time
> > >>>
> > >>> Hope i am clear. Thanks for your help.
> > >>>
> > >>> Thanks
> > >>>
> > >>> Ravi Kiran Bhaskar
> > >>>
> > >>>
> > >>> On Thu, Sep 4, 2014 at 5:08 PM, Joel Bernstein <joels...@gmail.com
> > <mailto:joels...@gmail.com> > wrote:
> > >>>
> > >>>> If you want the main query to be sorted by date then the top N docs
> > >>>> reranked by a query, that should work. Try something like this:
> > >>>>
> > >>>> q=foo&sort=date+desc&rq={!rerank reRandDocs=1000
> > >>>> reRankQuery=$myquery}&myquery=blah
> > >>>>
> > >>>>
> > >>>> Joel Bernstein
> > >>>> Search Engineer at Heliosearch
> > >>>>
> > >>>>
> > >>>> On Thu, Sep 4, 2014 at 4:25 PM, Ravi Solr <ravis...@gmail.com
> > <mailto:ravis...@gmail.com> > wrote:
> > >>>>
> > >>>>> Can the ReRanking API be used to sort within docs retrieved by a
> date
> > >>>> field
> > >>>>> ? Can somebody help me understand how to write such a query ?
> > >>>>>
> > >>>>> Thanks
> > >>>>>
> > >>>>> Ravi Kiran Bhaskar
> > >>>>>
> > >>>>
> > >>>
> > >>
> >
> >
>

Reply via email to