Joel,
     I just removed the "score" from "fl" and the results still are the
same as before. So score is not causing the good results, Maybe I got lucky
and chanced on a ReRanking + Sort bug which is working to my advantage ??
:-)  The sort should have applied to the main query and then only should
the ReRank kick in. However it seems like the sort is being done after the
ReRanking, just to check the results it I queried with & without ReRanking
for the same query. The results are shown below, surely teh sort is applied
differently when ReRanking, the Mystery deepens :-)

Pure Sort Without ReRanking
http://localhost:8080/solr-admin/sitesearchcore/select?q=faces of the
fallen&sort=publish_date desc&fl=headline,publish_date

<result name="response" numFound="3936" start="0">
    <doc>
        <str name="headline">Mexico dreams face test after opening to
investors</str>
        <date name="publish_date">2014-08-07T17:32:16Z</date>
    </doc>
    <doc>
        <str name="headline">Virginia football QB David Watford tries 'to
make the best out of' fall down depth chart</str>
        <date name="publish_date">2014-08-07T17:25:00Z</date>
    </doc>
    <doc>
        <str name="headline">As wars end, a benefits system complicates the
process of moving on for spouses</str>
        <date name="publish_date">2014-08-07T14:41:36Z</date>
    </doc>
    <doc>
        <str name="headline">Wonkbook: What you need to know about Obama's
possible inversion intervention</str>
        <date name="publish_date">2014-08-07T12:44:26Z</date>
    </doc>
    <doc>
        <str name="headline">Japan architects sell a lifestyle on global
stage</str>
        <date name="publish_date">2014-08-07T07:19:57Z</date>
    </doc>
    <doc>
        <str name="headline">Japan architects sell a lifestyle on global
stage</str>
        <date name="publish_date">2014-08-07T07:11:01Z</date>
    </doc>
    <doc>
        <str name="headline">Month-long war in Gaza has left a humanitarian
and environmental crisis</str>
        <date name="publish_date">2014-08-07T00:16:00Z</date>
    </doc>
    <doc>
        <str name="headline">Shiites in India want to join the fight
against the Islamic State in Iraq</str>
        <date name="publish_date">2014-08-06T11:02:59Z</date>
    </doc>
    <doc>
        <str name="headline">Business Highlights</str>
        <date name="publish_date">2014-08-05T22:12:19Z</date>
    </doc>
    <doc>
        <str name="headline">Shining Stars finds new home in time for
school year</str>
        <date name="publish_date">2014-08-05T21:57:12Z</date>
    </doc>
</result>

With ReRanking and Sorting
http://localhost:8080/solr-admin/sitesearchcore/select?q=faces of the
fallen&rq={!rerank reRankQuery=$rqq
reRankDocs=1000}&rqq=*:*&sort=publish_date desc&fl=headline,publish_date


<result name="response" numFound="3936" start="0">
    <doc>
        <str name="headline">More than just the faces of the fallen</str>
        <date name="publish_date">2013-05-10T21:55:44Z</date>
    </doc>
    <doc>
        <str name="headline">Faces of the Fallen</str>
        <date name="publish_date">2013-02-08T20:39:00Z</date>
    </doc>
    <doc>
        <str name="headline">Tears for the fallen</str>
        <date name="publish_date">2013-01-11T23:51:53Z</date>
    </doc>
    <doc>
        <str name="headline">In Afghanistan, under fire from 'friends'</str>
        <date name="publish_date">2013-04-06T00:19:45Z</date>
    </doc>
    <doc>
        <str name="headline">Counting the dead</str>
        <date name="publish_date">2013-02-08T23:28:42Z</date>
    </doc>
    <doc>
        <str name="headline">Women should be trained for combat</str>
        <date name="publish_date">2013-03-20T23:36:31Z</date>
    </doc>
    <doc>
        <str name="headline">8 overlooked Civil War moments from 1864 that
could have changed history</str>
        <date name="publish_date">2014-04-24T21:08:16Z</date>
    </doc>
    <doc>
        <str name="headline">'This can't happen to the same family
twice'</str>
        <date name="publish_date">2014-01-17T23:38:00Z</date>
    </doc>
    <doc>
        <str name="headline">Islamist rebels in Syria use faces of the dead
to lure the living</str>
        <date name="publish_date">2013-11-04T23:11:00Z</date>
    </doc>
    <doc>
        <str name="headline">Behind the Wise family story</str>
        <date name="publish_date">2014-01-17T23:28:00Z</date>
    </doc>
</result>


Thanks

Ravi Kiran Bhaskar


On Sat, Sep 6, 2014 at 4:06 PM, Joel Bernstein <joels...@gmail.com> wrote:

> What may be happening here:
>
> http://localhost:8080/solr/select?q=malaysian airline crash&rq={!rerank
> reRankQuery=$rqq reRankDocs=1000}&rqq=*:*&sort=publish_date
> desc&fl=headline,publish_date,score
>
>
> Because the fl is requesting the score, possibly the scores are being
> tracked in the initial query even though it is being sorted by
> publish_date.
>
> Then during the rerank phase the the initial score is being combined with
> the *:* score which will be 1. So the effect would be to rerank the docs by
> the scores from the main query.
>
> One way to prove this would be to remove the score from the "fl" param and
> see if this changes the result ordering.
>
>
>
>
>
> Joel Bernstein
> Search Engineer at Heliosearch
>
>
> On Sat, Sep 6, 2014 at 3:58 PM, Joel Bernstein <joels...@gmail.com> wrote:
>
> > This folllowing query:
> >
> > http://localhost:8080/solr/select?q=malaysian airline crash&rq={!rerank
> > reRankQuery=$rqq reRankDocs=1000}&rqq=*:*&sort=publish_date
> > desc&fl=headline,publish_date,score
> >
> > Is doing the following:
> >
> > The main query is sorted by publish_date. Then the results are reranked
> by
> > *:*, which in theory would have no effect at all.
> >
> > The reRankQuery only uses the reRankQuery to re-rank the results. The
> sort
> > param will always apply to the main query.
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Joel Bernstein
> > Search Engineer at Heliosearch
> >
> >
> > On Sat, Sep 6, 2014 at 2:33 PM, Ravi Solr <ravis...@gmail.com> wrote:
> >
> >> Erick,
> >>         Your idea about reversing Joel's suggestion seems to give the
> best
> >> results of all the options I tried...but I cant seem to understand why.
> I
> >> thought the query shown below should give irrelevant results as sorting
> by
> >> date would throw relevancy off...but somehow its getting relevant
> results
> >> with fair enough reverse chronology. It is as if the sort is applied
> after
> >> the docs are collected and reranked (which is what I wanted). One more
> >> thing that baffled me was, if I change reRankDocs from 1000 to100 the
> >> results become irrelevant, which doesnt make sense.
> >>
> >> So can you kindly explain whats going on in the following query.
> >>
> >> http://localhost:8080/solr/select?q=malaysian airline crash&rq={!rerank
> >> reRankQuery=$rqq reRankDocs=1000}&rqq=*:*&sort=publish_date
> >> desc&fl=headline,publish_date,score
> >>
> >> I love the solr community, so much to learn from so many knowledgeable
> >> people.
> >>
> >> Thanks
> >>
> >> Ravi Kiran Bhaskar
> >>
> >>
> >>
> >> On Fri, Sep 5, 2014 at 1:23 PM, 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