Yes, that is exactly what I want to do ! My external system gives me sell rate/Top N Selling books matching the user terms (query)
I don't know what is the best way: Storing sell rate into lucene Fields of the documents... (multiple combination) and sort by this field, or doing something like you said: "adding an optional clauses to your query for each of your N productIds"... but I don't really know how to do this... Any sample code exemple ? Thank you very much, John Chris Hostetter wrote: > > > : Ok, for the sort object, but my problem is I don't know haox to retrieve > (or > : store) information of the sell rate of the products (the sell rate > deponds > : on the QUERY ! The sort is different for each queries.) > : > : I imagine to connect to the DB and get sell rate of products for this > : specific query... but connecting to DB at each query is not a right > choice > : ;-) > > I'm sorry .. i missunderstood your question ... rereading it now here > is what i sounds like you are saying: > > When a user tells gives you a search term they are interested in, > you have an external system that that you use to look up the top N selling > books matching those terms, and what their sell rate is. you would like > to do a search across your entire lucene index, having those N products > score higher based on their sell rate. (which is not in the index) > > ...assuming i have that right, try adding an optional clauses to your > query for each of your N productIds, with a boost which is proportionate > to the sell rate. the exact boost values should be based on how importnat > you want the sell rate to be compared with with the textual relevancy of > the query term. > > > > -Hoss > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Sorting-based-on-a-selling-rate-tf2175860.html#a6057151 Sent from the Lucene - Java Users forum at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]