You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by dm_tim <dm...@yahoo.com> on 2013/02/15 02:00:32 UTC
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.
Re: Query question
Posted by Chris Hostetter <ho...@fucit.org>.
: 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?
In general, this already happens because of the "coord" factor
of your query -- the more optional (ie: "SHOULD") clauses of a
BooleanQuery that match a document, the higher the score.
If you aren't happy with how much of an impact the coord factor has on
your score (vs things like the term freq) you can customize your
similarity -- take a look at the debug=true output to see how the scores
are built up for each doc to decide for yourself.
-Hoss
Re: Query question
Posted by Jack Krupansky <ja...@basetechnology.com>.
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.