Hi Grant,


Grant Ingersoll-6 wrote:
> 
> You can use the payload functionality (have a look at  
> BoostingTermQuery and Michael B. excellent ApacheCon talk at
> http://people.apache.org/~buschmi/apachecon/).  Other option is to put  
> the synonyms into a separate field and boost that less than the main  
> field.
> 
> On Dec 27, 2007, at 4:19 PM, Frank Schima wrote:
> 
>> So I have my fancy new stemmed synonym based Lucene index. Let's say  
>> I have
>> the following synonym defined:
>>
>> radiation -> radiotherapy (and the reverse)
>>
>> The search results rank all results exactly the same. Is there a way  
>> to
>> Boost the actual search term a little higher than the synonym(s)?
> 

To be clear, if someone searches for "radiation" I want content exactly with
"radiation" to rank higher than content with "radiotherapy". But if someone
searches for "radiotherapy", I want content with that to rank higher than
content with "radiation". Will Payloads do this for me?

I would try it but I'm having trouble figuring out how to do the search. For
the search, I'm currently using a MultiFieldQueryParser, so like this:

    SnowballAnalyzer sba = new SnowballAnalyzer("English",
StopAnalyzer.ENGLISH_STOP_WORDS);
    QueryParser qp = new MultiFieldQueryParser( new String[] {"field1",
"field2", "field3"}, sba );
    try {
      Query query = qp.parse(strSearchTerms);
    } catch ( Throwable th) {
       ...
    }

However, the payload example in the presentation requires a
BoostingTermQuery, like this:

    Query query = new BoostingTermQuery( new Term(“field”, “searchterm”));

Is there a way to make the two work together?


Thanks!
Frank


-- 
View this message in context: 
http://www.nabble.com/Synonyms-and-Ranking-tp14518753p14527508.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


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

Reply via email to