lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Angelov, Rossen" <Rossen.Ange...@thomsonmedia.com>
Subject sorting on multiple fields
Date Mon, 18 Oct 2004 19:25:46 GMT
Hi,

I read the "sorting and score ordering -
http://www.mail-archive.com/lucene-user@jakarta.apache.org/msg09775.html"
thread from the archive and I think, I have a very similar problem but I
still don't understand how the sorting is supposed to work if there are
multiple fields given to Sort(SortField[]) constructor.

I'm sorting on two different indexed string fields and the results are
correctly sorted only by the first field but not by the second one. The
first one represents date in format yyyymmddMMHHSS and the second one are
the article headlines. The results are not ordered the way I would like them
to be with the second ordering field. I expect to see the returned articles
to be ordered alphabetically (or reverse) when the dates are the same.
Instead, I see "random" orders of the headlines for the same dates.

When I use the second field to sort by, the order changes (compared to not
having it) but it's not the right one. It also doesn't appear that "random"
order to be the score sorting. I cant find a pattern in the returned results
and scores.

I'm trying to understand if the score is determined before the sorting and
if the scores change after the sorting is applied?
Also, how exactly the multiple sort criteria are being executed when
constructing a Sort object with array of SortField objects?

Thanks,
Ross

"This communication is intended solely for the addressee and is
confidential and not for third party unauthorized distribution."


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message