It sounds like this is a webapp.
I'd consider playing with HTML DOM a little bit - come up with a system where I 
get top N matches by relevance, store them somewhere, and then just re-sort 
them using users' criteria, without going back to the Lucene index.

For instance, you could store this data inside some JavaScript arrays in the 
first results page, and re-sorting inside the client (browser).  Why go all the 
way back to the server and disk?

Or, if you really want to go to the server, you could come up with a mechanism 
where the first set of N hits are stored some place on disk in whichever format 
is suitable (e.g. serialized object on disk, XML...) and then when the user 
wants to re-sort the matches, go to the server, grab the cached data, sort 
appropriately, and display.  Smells like ajax, if you want to play with that.

Otis

----- Original Message ----
From: Mufaddal Khumri <[EMAIL PROTECTED]>
To: java-user@lucene.apache.org
Sent: Tue 21 Feb 2006 11:33:22 AM EST
Subject: get results by relevance, limiting results and then sort the results 
by some criterion

When I do a search for example on "batteries" i get 1200+ results. I 
would like to show the user lets say 300. I can do that by only 
extracting the first 300 hits (sorted by decreasing relevance by 
default) and displaying those to the user.

Now on the search results page, I have a drop down box that lets the 
user sort the results by price. When the user selects the "Sort by price 
low to high", i would like to be able to sort the same 300 hits I got 
above (sorted by decreasing relevance by default) by price.

Essentially I want to be able to sort the first 300 relevant search 
results by price. (in other words I would like to be able to get search 
results by relevance, limit the results and sort the results by some 
criterion).

What would be a good way to do this in lucene?

-Thanks.


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





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

Reply via email to