Hi Peter,
What are the downsides to your last alternative approach below? That
seems like the simplest approach and should work as long as the terms
within those fields do not need to be boosted separately.
If you want to go the boosting terms route, this is handled via a
thing called Payloads in Lucene. Payloads are an array of bytes that
are added during indexing at the term level through the analysis
process. To do this in Solr, you would need to write your own
TokenFilter that adds payloads as needed. Then, during search, you
can take advantage of these payloads by using the BoostingTermQuery
from Lucene. The downside to all of this is Solr doesn't currently
support it, so you would be coding it up yourself. I'm sure, though,
that if you were to start a patch on it, there would be others who are
interested.
Note, on the payloads. The biggest sticking point, I think, is coming
up w/ an efficient way of encoding the byte array and putting it into
the XML format, such that one can send in payloads when indexing.
It's not particularly hard, but no one has done it yet.
-Grant
On Nov 29, 2008, at 10:45 PM, Peter Wolanin wrote:
I've recently started working on the Drupal integration module for
SOLR, and we are looking for suggestions for how to address this
question: how do we boost the importance of a subset of terms within
a field.
For example, we are using the standard request handler for queries,
and the default field for keyword searches is a concatentation of the
title, body, taxonomy terms, etc.
One "hackish" way I can imagine is that terms we want to boost (for
example the title, or text inside h2 tags) could be concatenated on
multiple times. Would this be effective and reasonable?
It seems like the alternative is to try to switch to using the dismax
handler, storing the terms that we desire to have different boosts
into different fields, all of which are in the list of query fields?
Thanks in advance for your suggestions.
-Peter
--------------------------------------------------------------
Peter M. Wolanin, Ph.D.
Momentum Specialist, Acquia. Inc.
[EMAIL PROTECTED]
--------------------------
Grant Ingersoll
Lucene Helpful Hints:
http://wiki.apache.org/lucene-java/BasicsOfPerformance
http://wiki.apache.org/lucene-java/LuceneFAQ