I would like to use a query function to boost documents of a certain
"type". I realize that I can use a boost query for this, but in
analyzing the scoring it doesn't seem as predictable as the query
functions.

 

So, imagine I have a field called "foo". Foo contains a value that
indicates what type of document this is. For now there are only document
types of "BAR" and "BAZ". I would like documents of type BAR to be
boosted much more strongly then documents of type BAZ. As far as I can
all of the query functions seem to work with fields that contain
numbers. The only exception being the ord() functions, but those don't
provide the stability I would like, as I can always introduce a new
document type down the road and risk screwing up my results.

 

Can this be done with function queries?

 

As a follow up, how difficult would it be for me to write my own
function (and plug it into Solr) that allowed me to return a 1.0 or 0.0
if a field had a particular string value in it? A function that would
look something like "fieldEq(foo,BAR)"

 

-Todd Feak

Reply via email to