jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ard Schrijvers <a.schrijv...@onehippo.com>
Subject Re: Confusion regarding order of search results
Date Thu, 25 Jun 2009 07:46:28 GMT
>> what do you mean 'no'...I said I would expect it, and IMO it makes sense.
> I'm sorry. I didn't mean to be rude.

no problem, was a joke of mine, i forgot the smiley i now realize :-)

>> If in lucene you do not specify an order, you'll get back the highest scores first.
> that true. however I'm not sure this is always desirable. what if I'm
> just interested in the result set and not a particular order? then the
> ordering is irrelevant and just costs more CPU cycles.

I thought lucene would always order...but I guess you are right..OTOH,
in lucene Hits I see:

TopDocs topDocs = (sort == null) ? searcher.search(weight, filter, n)
: searcher.search(weight, filter, n, sort);

This gives me the idea, that with no sort, Hits are returned by
relevance. AFAIK, returning hits by doc id is done by specifying a
sort, namely SortField.DOC

/** Sort by document number (index order).  Sort values are Integer and lower
   * values are at the front. */
  public static final int DOC = 1;

I'll do some tests and will provide the results

> at some point in the discussion of the EG for JSR 170 the score was
> actually named rank, which would have better matched your expectation.
> assuming that a lower rank value is better. but then it was decided to
> call it score where higher values mean more relevant.

Yes, I see, thx

>> An order by score would make a perfect default if respectDocumentOrder is set to
> see also my comment above. however we could default to 'order by
> @jcr:score descending' if there is a fulltext search clause in the
> query. WDYT?

I think this would be more in line what people would expect, so +1

>> Bottom line, I'll default to adding 'order by @jcr:score descending' when no order
>> specified :-))
> or we change jackrabbit to do that if there is a fulltext clause (aka
> jcr:contains()) in the query :)

I will try to find why the results seem to be not by default according
lucene scoring...I would think this is namely the default with no sort
as described above: I must be wrong somewhere I guess.

I think it would make sense, that if we have no order by, we default
to the lucene order...I'll test this now to see whether I am wrong
about the default lucene ordering.

Furthermore I can live without the default 'order by @jcr:score
descending' because I now know this. It depends on whether we think
other people/users will benefit from this. WDYT?

Regards Ard

> regards
>  marcel
>> thx for your replies Marcel
>> Ard
>>> regards
>>>  marcel

View raw message