You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by "shrinath.m" <sh...@webyog.com> on 2011/05/16 13:49:00 UTC
How do we reverse sort on the docid ?
What I want:
docids that matched the search string are :
5
4
3
2
1
What I am getting :
docids that matched the search string are :
999
998
997
996
995
I am lucene sort object, and it is constructed like this :
Sort srt = new Sort(new SortField(null,SortField.DOC,true));
How do I get what I want ? Do I really need to use sort ?
--
View this message in context: http://lucene.472066.n3.nabble.com/How-do-we-reverse-sort-on-the-docid-tp2947495p2947495.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.
Re: How do we reverse sort on the docid ?
Posted by "shrinath.m" <sh...@webyog.com>.
No problems... I was trying to get the results to be reverse ordered, but I
had a small problem in my searcher to work... Now all works...
Thanks :)
On Mon, May 16, 2011 at 11:20 PM, Alexander Aristov [via Lucene] <
ml-node+2949011-1603567638-376162@n3.nabble.com> wrote:
> indeed. What's the problem?
>
> Best Regards
> Alexander Aristov
>
>
> On 16 May 2011 16:43, Uwe Schindler <[hidden email]<http://user/SendEmail.jtp?type=node&node=2949011&i=0>>
> wrote:
>
> > The problem we have is that you dont really say what your problem is!
> Whats
> > wrong with the search results you get? Give an example of the query you
> > execute and the documents you have.
> >
> > -----
> > Uwe Schindler
> > H.-H.-Meier-Allee 63, D-28213 Bremen
> > http://www.thetaphi.de
> > eMail: [hidden email]<http://user/SendEmail.jtp?type=node&node=2949011&i=1>
> >
> >
> > > -----Original Message-----
> > > From: shrinath.m [mailto:[hidden email]<http://user/SendEmail.jtp?type=node&node=2949011&i=2>]
>
> > > Sent: Monday, May 16, 2011 2:30 PM
> > > To: [hidden email]<http://user/SendEmail.jtp?type=node&node=2949011&i=3>
> > > Subject: Re: How do we reverse sort on the docid ?
> > >
> > >
> > > Erick Erickson wrote:
> > > >
> > > > At any rate, I think all you need to do is specify the reverse
> boolean
> > > > in the SortField c'tor???
> > > >
> > > > Best
> > > > Erick
> > > >
> > > >
> > >
> > > The "true" in
> > > `Sort srt = new Sort(new SortField(null,SortField.DOC,true)); `
> actually
> > is the
> > > reverse boolean sort field. So it is turned on, but look at my original
>
> > question,
> > > what I am getting is not what I desire. :(
> > >
> > > --
> > > View this message in context:
> http://lucene.472066.n3.nabble.com/How-do-
> > > we-reverse-sort-on-the-docid-tp2947495p2947629.html
> > > Sent from the Lucene - Java Users mailing list archive at Nabble.com.
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=2949011&i=4>
> > > For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=2949011&i=5>
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=2949011&i=6>
> > For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=2949011&i=7>
> >
> >
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://lucene.472066.n3.nabble.com/How-do-we-reverse-sort-on-the-docid-tp2947495p2949011.html
> To unsubscribe from How do we reverse sort on the docid ?, click here<http://lucene.472066.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2947495&code=c2hyaW5hdGgubUB3ZWJ5b2cuY29tfDI5NDc0OTV8LTIxMzY3ODQ0ODI=>.
>
>
--
Regards
*Shrinath.M*
--
View this message in context: http://lucene.472066.n3.nabble.com/How-do-we-reverse-sort-on-the-docid-tp2947495p2950963.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.
Re: How do we reverse sort on the docid ?
Posted by Alexander Aristov <al...@gmail.com>.
indeed. What's the problem?
Best Regards
Alexander Aristov
On 16 May 2011 16:43, Uwe Schindler <uw...@thetaphi.de> wrote:
> The problem we have is that you dont really say what your problem is! Whats
> wrong with the search results you get? Give an example of the query you
> execute and the documents you have.
>
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
>
>
> > -----Original Message-----
> > From: shrinath.m [mailto:shrinath.m@webyog.com]
> > Sent: Monday, May 16, 2011 2:30 PM
> > To: java-user@lucene.apache.org
> > Subject: Re: How do we reverse sort on the docid ?
> >
> >
> > Erick Erickson wrote:
> > >
> > > At any rate, I think all you need to do is specify the reverse boolean
> > > in the SortField c'tor???
> > >
> > > Best
> > > Erick
> > >
> > >
> >
> > The "true" in
> > `Sort srt = new Sort(new SortField(null,SortField.DOC,true)); ` actually
> is the
> > reverse boolean sort field. So it is turned on, but look at my original
> question,
> > what I am getting is not what I desire. :(
> >
> > --
> > View this message in context: http://lucene.472066.n3.nabble.com/How-do-
> > we-reverse-sort-on-the-docid-tp2947495p2947629.html
> > Sent from the Lucene - Java Users mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
RE: How do we reverse sort on the docid ?
Posted by Uwe Schindler <uw...@thetaphi.de>.
The problem we have is that you dont really say what your problem is! Whats
wrong with the search results you get? Give an example of the query you
execute and the documents you have.
-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de
> -----Original Message-----
> From: shrinath.m [mailto:shrinath.m@webyog.com]
> Sent: Monday, May 16, 2011 2:30 PM
> To: java-user@lucene.apache.org
> Subject: Re: How do we reverse sort on the docid ?
>
>
> Erick Erickson wrote:
> >
> > At any rate, I think all you need to do is specify the reverse boolean
> > in the SortField c'tor???
> >
> > Best
> > Erick
> >
> >
>
> The "true" in
> `Sort srt = new Sort(new SortField(null,SortField.DOC,true)); ` actually
is the
> reverse boolean sort field. So it is turned on, but look at my original
question,
> what I am getting is not what I desire. :(
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/How-do-
> we-reverse-sort-on-the-docid-tp2947495p2947629.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: How do we reverse sort on the docid ?
Posted by "shrinath.m" <sh...@webyog.com>.
Erick Erickson wrote:
>
> At any rate, I think all you need to do is specify
> the reverse boolean in the SortField c'tor???
>
> Best
> Erick
>
>
The "true" in
`Sort srt = new Sort(new SortField(null,SortField.DOC,true)); `
actually is the reverse boolean sort field. So it is turned on, but look at
my original question, what I am getting is not what I desire. :(
--
View this message in context: http://lucene.472066.n3.nabble.com/How-do-we-reverse-sort-on-the-docid-tp2947495p2947629.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: How do we reverse sort on the docid ?
Posted by Erick Erickson <er...@gmail.com>.
Ahhh, I probably should have read more carefully!
At any rate, I think all you need to do is specify
the reverse boolean in the SortField c'tor???
Best
Erick
On Mon, May 16, 2011 at 8:12 AM, shrinath.m <sh...@webyog.com> wrote:
>
> Erick Erickson wrote:
>>
>> Why do you want to do this? the internal doc ids are
>> transient. If you update a document by delete/add, the
>> internal id will now be different. What I'm getting at is
>> that I'd like to be sure the use case here does what
>> you think it will because this smells like an XY problem,
>> see:
>> http://people.apache.org/~hossman/#xyproblem
>>
>> Best
>> Erick
>>
>>
>
> LoL :) the explanation of XY problem is good one, but thats not my case...
> I must agree, my first idea was on docid itself, but I don't stress on
> docid, it can be on any field for that instance, the way it works is the
> same.
>
> so stress in the question is on how to do it, not which field I do it on...
>
> Apologies for not being clear in the question, I tried to keep it very
> simple, but failed to give essential info...
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/How-do-we-reverse-sort-on-the-docid-tp2947495p2947572.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: How do we reverse sort on the docid ?
Posted by "shrinath.m" <sh...@webyog.com>.
Erick Erickson wrote:
>
> Why do you want to do this? the internal doc ids are
> transient. If you update a document by delete/add, the
> internal id will now be different. What I'm getting at is
> that I'd like to be sure the use case here does what
> you think it will because this smells like an XY problem,
> see:
> http://people.apache.org/~hossman/#xyproblem
>
> Best
> Erick
>
>
LoL :) the explanation of XY problem is good one, but thats not my case...
I must agree, my first idea was on docid itself, but I don't stress on
docid, it can be on any field for that instance, the way it works is the
same.
so stress in the question is on how to do it, not which field I do it on...
Apologies for not being clear in the question, I tried to keep it very
simple, but failed to give essential info...
--
View this message in context: http://lucene.472066.n3.nabble.com/How-do-we-reverse-sort-on-the-docid-tp2947495p2947572.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: How do we reverse sort on the docid ?
Posted by Erick Erickson <er...@gmail.com>.
Why do you want to do this? the internal doc ids are
transient. If you update a document by delete/add, the
internal id will now be different. What I'm getting at is
that I'd like to be sure the use case here does what
you think it will because this smells like an XY problem,
see:
http://people.apache.org/~hossman/#xyproblem
Best
Erick
On Mon, May 16, 2011 at 7:49 AM, shrinath.m <sh...@webyog.com> wrote:
> What I want:
>
> docids that matched the search string are :
> 5
> 4
> 3
> 2
> 1
>
>
> What I am getting :
>
> docids that matched the search string are :
> 999
> 998
> 997
> 996
> 995
>
>
> I am lucene sort object, and it is constructed like this :
> Sort srt = new Sort(new SortField(null,SortField.DOC,true));
>
> How do I get what I want ? Do I really need to use sort ?
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/How-do-we-reverse-sort-on-the-docid-tp2947495p2947495.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org