: Here's how we did it in Lucene: we had an extension of Query, with a custom
: scorer.   In the index we stored the category id's as single-valued
: space-separated string.  We also stored a space-separated string of scores
: in another field.  We made of these fields stored.  We simply delegated the
: search to the normal searcher, then we calculated the score we retrieved the
: values of both fields for the document.  Then we turned the space-separated
: strings into arrays, searched the id array for the index of the desired id,
: then scanned the score array for the matching score, and returned.

oh man, so you were parsing the Stored field values of every matching doc 
at query time? ouch.

Assuming i'm understanding your goal, the conventional way to solve this 
type of problem is "payloads" ... you'll find lots of discussion on it in 
the various Lucene mailing lists, and if you look online Michael Busch has 
various slides that talk about using them.  they let you say things 
like "in this document, at this postion of field 'x' the word 'microsoft' 
is worth 37.4, but at this other position (or in this other document) 
'microsoft' is only worth 17.2"

The simplest way to use them in Solr (as i understand it) is to use 
soemthing like the DelimitedPayloadTokenFilterFactory when indexing, and then 
write yourself 
a simple little custom QParser that generates a BoostingTermQuery on your 
field.

should be a lot simpler to implement then the Query you are describing, 
and much faster.


-Hoss

Reply via email to