Hi,
I found the API in another post on the net.

new *Sort*(new SortField(null, SortField.DOC, true))

The trick is to set the field to null.

Thanks for the help.

Preetham Kajekar wrote:
Hi Uwe,
Thanks for your response. However, I could not find the API in SortField and Sort to achieve this. SortField can be wrapped inside a Sort, but you cannot specify to reverse the order .

Thx,
~preetham


Uwe Schindler wrote:
It should, do not use Sort.INDEX_ORDER, create a SortField with indexorder
and the reverse parameter, the SortField can be warpped inside a Sort
instance and voila. I am not sure, if it works, but it should. Same with
score.

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: u...@thetaphi.de

-----Original Message-----
From: Preetham Kajekar [mailto:preet...@cisco.com]
Sent: Friday, April 10, 2009 11:27 AM
To: java-user@lucene.apache.org
Subject: Re: MultiSearcher query with Sort option

Hi,
 I just realized it was a bug in my code.
On a related note, is it possible to Sort based on reverse index order ?

Thanks,
 ~preetham

Uwe Schindler wrote:
Hallo Preetham,

never heard of this. What Lucene version do you use?
To check out, try the search in andifferent way:
Combine the two indexes not into a MultiSearcher, instead open an
IndexReader for both indexes and combine both readers to a MultiReader.
This
MultiReader can be used like a conventional single index and searched
with
IndexSearcher. If the error then disappears, there may be a bug. If not,
something with your indexes is wrong.

I always recommend to only use MultiSearcher in distributed or parallel
search scenarios, never for just combining two indexes.

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: u...@thetaphi.de


-----Original Message-----
From: Preetham Kajekar [mailto:preet...@cisco.com]
Sent: Friday, April 10, 2009 9:43 AM
To: java-user@lucene.apache.org
Subject: MultiSearcher query with Sort option

Hi,
I am using a MultiSearcher to search 2 indexes. As part of my query, I
am sorting the results based on a field (which in NOT_ANALYSED).
However, i seem to be getting hits only from one of the indexes. If I
change to Sort.INDEX_ORDER, I seem to be getting results from both. Is
this a know problem ?

Thanks,
 ~preetham

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to