You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by TorAtle <to...@gmail.com> on 2009/12/19 18:48:39 UTC
Wildcard searches and document boost
I have indexed a number of geotagged locations and want the results sorted by
relevance.
For instance, when searching for "wash*" I want "Washington" (the city) to
appear before "Washington Park", so I have boosted the "Washington"
document. Unfortunately, when using WildcardQuery, the score is always 1.0.
Luke says my query has been rewritten to "ConstantScore(myField:wash*), so
that sort of explains what's going on. But why? And short of sorting the
result, what is the solution to my problem?
Best regards,
Tor Atle
--
View this message in context: http://old.nabble.com/Wildcard-searches-and-document-boost-tp26857120p26857120.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
RE: Wildcard searches and document boost
Posted by Uwe Schindler <uw...@thetaphi.de>.
WildcardQuery is a subclass of MultiTermQuery, read the javadocs about MTQ,
than you might understand whats going on and what you can do.
Uwe
-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de
> -----Original Message-----
> From: TorAtle [mailto:toratlelav@gmail.com]
> Sent: Saturday, December 19, 2009 6:49 PM
> To: java-user@lucene.apache.org
> Subject: Wildcard searches and document boost
>
>
> I have indexed a number of geotagged locations and want the results sorted
> by
> relevance.
>
> For instance, when searching for "wash*" I want "Washington" (the city) to
> appear before "Washington Park", so I have boosted the "Washington"
> document. Unfortunately, when using WildcardQuery, the score is always
> 1.0.
>
> Luke says my query has been rewritten to "ConstantScore(myField:wash*), so
> that sort of explains what's going on. But why? And short of sorting the
> result, what is the solution to my problem?
>
> Best regards,
> Tor Atle
> --
> View this message in context: http://old.nabble.com/Wildcard-searches-and-
> document-boost-tp26857120p26857120.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
RE: Wildcard searches and document boost
Posted by Uwe Schindler <uw...@thetaphi.de>.
That would be an option.
-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de
> -----Original Message-----
> From: TorAtle [mailto:toratlelav@gmail.com]
> Sent: Sunday, December 20, 2009 5:20 PM
> To: java-user@lucene.apache.org
> Subject: Re: Wildcard searches and document boost
>
>
> > You need to change multiTermRewriteMethod of QueryParser.
> >
> qp.setMultiTermRewriteMethod(MultiTermQuery.SCORING_BOOLEAN_QUERY_REWRITE)
> ;
>
> Thanks. So the normal way of doing this is setting the rewrite method to
> scoring, and if BooleanQuery.TooManyClauses is catched then switch back to
> constant score method?
>
> Tor Atle
> --
> View this message in context: http://old.nabble.com/Wildcard-searches-and-
> document-boost-tp26857120p26864799.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Wildcard searches and document boost
Posted by TorAtle <to...@gmail.com>.
> You need to change multiTermRewriteMethod of QueryParser.
> qp.setMultiTermRewriteMethod(MultiTermQuery.SCORING_BOOLEAN_QUERY_REWRITE);
Thanks. So the normal way of doing this is setting the rewrite method to
scoring, and if BooleanQuery.TooManyClauses is catched then switch back to
constant score method?
Tor Atle
--
View this message in context: http://old.nabble.com/Wildcard-searches-and-document-boost-tp26857120p26864799.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Wildcard searches and document boost
Posted by AHMET ARSLAN <io...@yahoo.com>.
> For instance, when searching for "wash*" I want
> "Washington" (the city) to
> appear before "Washington Park", so I have boosted the
> "Washington"
> document. Unfortunately, when using WildcardQuery, the
> score is always 1.0.
>
> Luke says my query has been rewritten to
> "ConstantScore(myField:wash*), so
> that sort of explains what's going on. But why? And short
> of sorting the
> result, what is the solution to my problem?
You need to change multiTermRewriteMethod of QueryParser.
qp.setMultiTermRewriteMethod(MultiTermQuery.SCORING_BOOLEAN_QUERY_REWRITE);
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org