Use the edismax query parser and set the PF, PF2, and PF3 parameters so that adjacent pairs and triples of query terms will get "phrase boosted".

See:
http://wiki.apache.org/solr/ExtendedDisMax#pf_.28Phrase_Fields.29
http://wiki.apache.org/solr/ExtendedDisMax#pf2_.28Phrase_bigram_fields.29

-- Jack Krupansky

-----Original Message----- From: dm_tim
Sent: Thursday, February 14, 2013 8:00 PM
To: solr-user@lucene.apache.org
Subject: Query question

Howdy,

I have a straight-forward index that contains a "name" field. I am currently
taking a string of text, tokenizing it into individual strings and making a
query out of them all against the "name" field.

Note that the name field is split up by a whitespace tokenizer and a lower
case filter during indexing.

My query is working fine but I want to boost the score when multiple terms
match. So for example if I had an entry in my index that was originally
"Valley Fair Mall" and the string I was using to search was "I'm shopping at
Valley Fair mall" my query is currently being chopped into:
name:i'm~ name:shopping~ name:at~ name:valley~ name:fair~ name:mall~

Note that I use OR by default.

So as I said, the search result I want is the one with the highest score,
but I was hoping to find a way to boost the score based on the number of
terms it finds (or matches well) so that I can differentiate between a close
match and nowhere near. Any suggestions?

Regards,

T



--
View this message in context: http://lucene.472066.n3.nabble.com/Query-question-tp4040559.html Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to