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 Gustavo Falco <co...@gmail.com> on 2011/10/27 16:54:16 UTC

How can I force the threshold for a fuzzy query?

Hi guys,

I'm new to Solr (as you may guess for the subject). I'd like to force the
threshold for fuzzy queries to, say, 0.7. I've read that fuzzy queries are
expensive, but limiting it's threshold to a number near 1 would help.

So my question is: Is this possible to configure in some of the xml
configuration files? and if that's so, if I use this query:

myField:myQuery~0.2

Would Solr use the configured threshold instead, preventing indeed that
anyone force a minor value than what I've set in the xml file? Would it help
for what I want to do?



Thanks in advance!

Re: How can I force the threshold for a fuzzy query?

Posted by Gustavo Falco <co...@gmail.com>.
Great! I didn't think there was a way to do it. I was about removing this
feature from my app for that reason. I'll give your advice it a try.


Thanks a lot!

2011/10/27 Simon Willnauer <si...@googlemail.com>

> I am not sure if there is such an option but you might be able to
> override your query parser and reset that value if it is too fuzzy.
> look for   protected Query newFuzzyQuery(Term term, float
> minimumSimilarity, int prefixLength)  there you can change the actual
> value used for minimumSimilarity
>
> simon
>
>
> On Thu, Oct 27, 2011 at 4:54 PM, Gustavo Falco
> <co...@gmail.com> wrote:
> > Hi guys,
> >
> > I'm new to Solr (as you may guess for the subject). I'd like to force the
> > threshold for fuzzy queries to, say, 0.7. I've read that fuzzy queries
> are
> > expensive, but limiting it's threshold to a number near 1 would help.
> >
> > So my question is: Is this possible to configure in some of the xml
> > configuration files? and if that's so, if I use this query:
> >
> > myField:myQuery~0.2
> >
> > Would Solr use the configured threshold instead, preventing indeed that
> > anyone force a minor value than what I've set in the xml file? Would it
> help
> > for what I want to do?
> >
> >
> >
> > Thanks in advance!
> >
>

Re: How can I force the threshold for a fuzzy query?

Posted by Simon Willnauer <si...@googlemail.com>.
I am not sure if there is such an option but you might be able to
override your query parser and reset that value if it is too fuzzy.
look for   protected Query newFuzzyQuery(Term term, float
minimumSimilarity, int prefixLength)  there you can change the actual
value used for minimumSimilarity

simon


On Thu, Oct 27, 2011 at 4:54 PM, Gustavo Falco
<co...@gmail.com> wrote:
> Hi guys,
>
> I'm new to Solr (as you may guess for the subject). I'd like to force the
> threshold for fuzzy queries to, say, 0.7. I've read that fuzzy queries are
> expensive, but limiting it's threshold to a number near 1 would help.
>
> So my question is: Is this possible to configure in some of the xml
> configuration files? and if that's so, if I use this query:
>
> myField:myQuery~0.2
>
> Would Solr use the configured threshold instead, preventing indeed that
> anyone force a minor value than what I've set in the xml file? Would it help
> for what I want to do?
>
>
>
> Thanks in advance!
>