On Wed, 2006-10-18 at 19:05 +1300, Paul Waite wrote:

No they don't want that. They just want a small number. What happens is
they enter some silly query, like searching for all stories with a single
common non-stop-word in them, and with the usual sort criterion of by date
(ie. a field) descending, and a limit of, say 25.

So Lucene then presumably has to haul out a massive resultset, sort it, and
return the top 25 (out of 500,000 or whatever).

I had a similar requirement on a project last year. I implemented a two-pronged approach:

1. Index (i.e. addDocument()) the documents in the order I wanted the final sort to be.

2.  Modify a few classes to give a "first N" results capability.

We had 4 or 5 sort orders, so I had multiple indexes on the same data, 2 per sort order (forward and reverse), and used the appropriate one at search time.

It wasn't a one-hour change, but it didn't take a man-year either.  Hope it 
helps!

--MDC

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to