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 David Boxenhorn <da...@lookin2.com> on 2010/10/05 18:20:54 UTC

Query slop vs. phrase slop

Can anyone explain to me the practical difference (i.e. in terms of results)
between query slop and phrase slop?

Re: Query slop vs. phrase slop

Posted by David Boxenhorn <da...@lookin2.com>.
Got it!

Thanks a lot.

On Thu, Oct 7, 2010 at 3:00 PM, Ahmet Arslan <io...@yahoo.com> wrote:

>
> > ps = ? - something that affects boosting, but how?
>
> Lets say your query is apache solr. (without quotation marks)
>
> Lets say these three documents contains all of these words and returned.
>
> 1-) solr is built on the top of apache lucene.
> 2-) apache solr is fast, mature and popular.
> 3-) solr is hosted under apache umbrella.
>
> Even if you don't use pf and ps parameters, those documents will be in
> result set anyway. Lets say that they appear in this order 1,2,3.
>
> Then we include pf and ps parameter, q=apache solr&pf=title^1.2&ps=1
> Second document is boosted, lets say it comes first now. The order is
> changed. The documents - that have the all query words close each other -
> are boosted. Again the same three documents are returned.
>
>
>
>
>

Re: Query slop vs. phrase slop

Posted by Ahmet Arslan <io...@yahoo.com>.
> ps = ? - something that affects boosting, but how?

Lets say your query is apache solr. (without quotation marks)

Lets say these three documents contains all of these words and returned.

1-) solr is built on the top of apache lucene.
2-) apache solr is fast, mature and popular.
3-) solr is hosted under apache umbrella. 

Even if you don't use pf and ps parameters, those documents will be in result set anyway. Lets say that they appear in this order 1,2,3.

Then we include pf and ps parameter, q=apache solr&pf=title^1.2&ps=1
Second document is boosted, lets say it comes first now. The order is changed. The documents - that have the all query words close each other - are boosted. Again the same three documents are returned.



      

Re: Query slop vs. phrase slop

Posted by David Boxenhorn <da...@lookin2.com>.
Thank you very much!

Forgive me, but I'm still having some trouble understanding:

qs = the maximum number of words apart the match can be
ps = ? - something that affects boosting, but how?

On Thu, Oct 7, 2010 at 12:57 PM, Ahmet Arslan <io...@yahoo.com> wrote:

> phrase slop is about proximity search.
>
>
> http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Proximity%20Searches
>
> ps (Phrase Slop) affects boosting, if you play with ps value, numFound and
> result set do not change. But the order of result set change. This is about
> the phrase query that is constructed out of the entire "q" param.
>
> qs (Query Phrase Slop) affects matching. If you play with qs, numFound
> changes. This parameter is about when you have explicit phrase query in your
> raw query. i.e. &q="apache lucene"
>
> --- On Thu, 10/7/10, David Boxenhorn <da...@lookin2.com> wrote:
>
> > From: David Boxenhorn <da...@lookin2.com>
> > Subject: Re: Query slop vs. phrase slop
> > To: solr-user@lucene.apache.org
> > Date: Thursday, October 7, 2010, 11:34 AM
> > Does anybody know the answer to
> > this?
> >
> > On Tue, Oct 5, 2010 at 7:19 PM, David Boxenhorn <da...@lookin2.com>
> > wrote:
> >
> > > Thank you. I am talking about dismax's parameters.
> > >
> > > This is how I understand things, please tell me where
> > I'm wrong:
> > >
> > > Query slop (qs) = how many words you can move the
> > query to match the text.
> > > Phrase slop (ps) (when used in conjunction with
> > &pf=text - is there another
> > > possibility?) = how many words you can move the text
> > to match the query.
> > >
> > > How are those two different in terms of the results
> > they produce?
> > >
> > > On Tue, Oct 5, 2010 at 7:08 PM, Ahmet Arslan <io...@yahoo.com>
> > wrote:
> > >
> > >> > Can anyone explain to me the
> > >> > practical difference (i.e. in terms of
> > results)
> > >> > between query slop and phrase slop?
> > >>
> > >> I think you are asking about dismax's parameters,
> > right?
> > >>
> > >> ps (Phrase Slop) is about pf parameter.
> > >>
> > >> qs (Query Phrase Slop) : You cannot use tilde
> > operator with dismax, so
> > >> this parameter is used instead.
> > >>
> > >> luceneQParser : "term1 term2"~3 => dismaxQParer
> > : q="term1 term2"&qs=3
> > >>
> > >>
> > >>
> > >>
> > >
> >
>
>
>
>

Re: Query slop vs. phrase slop

Posted by Otis Gospodnetic <ot...@yahoo.com>.
David, here is an example.

* Original query: foo bar baz

* "phrases created from the  entire query": "foo bar baz"

Otis
----
Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch
Lucene ecosystem search :: http://search-lucene.com/



----- Original Message ----
> From: David Boxenhorn <da...@lookin2.com>
> To: solr-user@lucene.apache.org
> Sent: Sun, October 10, 2010 5:02:01 AM
> Subject: Re: Query slop vs. phrase slop
> 
> Thanks, Jonathan. Your explanation is very helpful.
> 
> Can you explain  exactly what you mean by "phrases created from the  entire
> query"?
> 
> 
> 
> On Thu, Oct 7, 2010 at 7:13 PM, Jonathan  Rochkind <ro...@jhu.edu> wrote:
> 
> > What  you said in your own quoted message is correct. qs is slop applied to
> >  phrases explicitly in the &q with double quotes. ps is slop applied to  the
> > phrases created from the entire query for evaluating pf  boosts.
> >
> > qs will (potentially) change your result set.  ps  will only (potentially)
> > change the ranked ordering of your result set,  by loosening what a "phrase
> > match" means to the pf  boost.
> >
> >
> > David Boxenhorn wrote:
> >
> >> Does  anybody know the answer to this?
> >>
> >> On Tue, Oct 5, 2010 at  7:19 PM, David Boxenhorn <da...@lookin2.com>
> >>  wrote:
> >>
> >>
> >>
> >>> Thank you. I am  talking about dismax's parameters.
> >>>
> >>> This is how I  understand things, please tell me where I'm  wrong:
> >>>
> >>> Query slop (qs) = how many words you can  move the query to match the
> >>> text.
> >>> Phrase slop  (ps) (when used in conjunction with &pf=text - is there
> >>>  another
> >>> possibility?) = how many words you can move the text to  match the query.
> >>>
> >>> How are those two different in  terms of the results they produce?
> >>>
> >>> On Tue, Oct  5, 2010 at 7:08 PM, Ahmet Arslan <io...@yahoo.com>  wrote:
> >>>
> >>>
> >>>
> >>>> Can  anyone explain to me the
> >>>>> practical difference (i.e. in  terms of results)
> >>>>> between query slop and phrase  slop?
> >>>>>
> >>>>>
> >>>> I  think you are asking about dismax's parameters,  right?
> >>>>
> >>>> ps (Phrase Slop) is about pf  parameter.
> >>>>
> >>>> qs (Query Phrase Slop) : You  cannot use tilde operator with dismax, so
> >>>> this parameter is  used instead.
> >>>>
> >>>> luceneQParser : "term1  term2"~3 => dismaxQParer : q="term1  term2"&qs=3
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>
> >>
> >>
> >
> 

Re: Query slop vs. phrase slop

Posted by David Boxenhorn <da...@lookin2.com>.
Thanks, Jonathan. Your explanation is very helpful.

Can you explain exactly what you mean by "phrases created from the entire
query"?



On Thu, Oct 7, 2010 at 7:13 PM, Jonathan Rochkind <ro...@jhu.edu> wrote:

> What you said in your own quoted message is correct. qs is slop applied to
> phrases explicitly in the &q with double quotes. ps is slop applied to the
> phrases created from the entire query for evaluating pf boosts.
>
> qs will (potentially) change your result set.  ps will only (potentially)
> change the ranked ordering of your result set, by loosening what a "phrase
> match" means to the pf boost.
>
>
> David Boxenhorn wrote:
>
>> Does anybody know the answer to this?
>>
>> On Tue, Oct 5, 2010 at 7:19 PM, David Boxenhorn <da...@lookin2.com>
>> wrote:
>>
>>
>>
>>> Thank you. I am talking about dismax's parameters.
>>>
>>> This is how I understand things, please tell me where I'm wrong:
>>>
>>> Query slop (qs) = how many words you can move the query to match the
>>> text.
>>> Phrase slop (ps) (when used in conjunction with &pf=text - is there
>>> another
>>> possibility?) = how many words you can move the text to match the query.
>>>
>>> How are those two different in terms of the results they produce?
>>>
>>> On Tue, Oct 5, 2010 at 7:08 PM, Ahmet Arslan <io...@yahoo.com> wrote:
>>>
>>>
>>>
>>>> Can anyone explain to me the
>>>>> practical difference (i.e. in terms of results)
>>>>> between query slop and phrase slop?
>>>>>
>>>>>
>>>> I think you are asking about dismax's parameters, right?
>>>>
>>>> ps (Phrase Slop) is about pf parameter.
>>>>
>>>> qs (Query Phrase Slop) : You cannot use tilde operator with dismax, so
>>>> this parameter is used instead.
>>>>
>>>> luceneQParser : "term1 term2"~3 => dismaxQParer : q="term1 term2"&qs=3
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>
>>
>

Re: Query slop vs. phrase slop

Posted by Jonathan Rochkind <ro...@jhu.edu>.
What you said in your own quoted message is correct. qs is slop applied 
to phrases explicitly in the &q with double quotes. ps is slop applied 
to the phrases created from the entire query for evaluating pf boosts.

qs will (potentially) change your result set.  ps will only 
(potentially) change the ranked ordering of your result set, by 
loosening what a "phrase match" means to the pf boost.

David Boxenhorn wrote:
> Does anybody know the answer to this?
>
> On Tue, Oct 5, 2010 at 7:19 PM, David Boxenhorn <da...@lookin2.com> wrote:
>
>   
>> Thank you. I am talking about dismax's parameters.
>>
>> This is how I understand things, please tell me where I'm wrong:
>>
>> Query slop (qs) = how many words you can move the query to match the text.
>> Phrase slop (ps) (when used in conjunction with &pf=text - is there another
>> possibility?) = how many words you can move the text to match the query.
>>
>> How are those two different in terms of the results they produce?
>>
>> On Tue, Oct 5, 2010 at 7:08 PM, Ahmet Arslan <io...@yahoo.com> wrote:
>>
>>     
>>>> Can anyone explain to me the
>>>> practical difference (i.e. in terms of results)
>>>> between query slop and phrase slop?
>>>>         
>>> I think you are asking about dismax's parameters, right?
>>>
>>> ps (Phrase Slop) is about pf parameter.
>>>
>>> qs (Query Phrase Slop) : You cannot use tilde operator with dismax, so
>>> this parameter is used instead.
>>>
>>> luceneQParser : "term1 term2"~3 => dismaxQParer : q="term1 term2"&qs=3
>>>
>>>
>>>
>>>
>>>       
>
>   

Re: Query slop vs. phrase slop

Posted by Ahmet Arslan <io...@yahoo.com>.
phrase slop is about proximity search.

http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Proximity%20Searches

ps (Phrase Slop) affects boosting, if you play with ps value, numFound and result set do not change. But the order of result set change. This is about the phrase query that is constructed out of the entire "q" param.

qs (Query Phrase Slop) affects matching. If you play with qs, numFound changes. This parameter is about when you have explicit phrase query in your raw query. i.e. &q="apache lucene"

--- On Thu, 10/7/10, David Boxenhorn <da...@lookin2.com> wrote:

> From: David Boxenhorn <da...@lookin2.com>
> Subject: Re: Query slop vs. phrase slop
> To: solr-user@lucene.apache.org
> Date: Thursday, October 7, 2010, 11:34 AM
> Does anybody know the answer to
> this?
> 
> On Tue, Oct 5, 2010 at 7:19 PM, David Boxenhorn <da...@lookin2.com>
> wrote:
> 
> > Thank you. I am talking about dismax's parameters.
> >
> > This is how I understand things, please tell me where
> I'm wrong:
> >
> > Query slop (qs) = how many words you can move the
> query to match the text.
> > Phrase slop (ps) (when used in conjunction with
> &pf=text - is there another
> > possibility?) = how many words you can move the text
> to match the query.
> >
> > How are those two different in terms of the results
> they produce?
> >
> > On Tue, Oct 5, 2010 at 7:08 PM, Ahmet Arslan <io...@yahoo.com>
> wrote:
> >
> >> > Can anyone explain to me the
> >> > practical difference (i.e. in terms of
> results)
> >> > between query slop and phrase slop?
> >>
> >> I think you are asking about dismax's parameters,
> right?
> >>
> >> ps (Phrase Slop) is about pf parameter.
> >>
> >> qs (Query Phrase Slop) : You cannot use tilde
> operator with dismax, so
> >> this parameter is used instead.
> >>
> >> luceneQParser : "term1 term2"~3 => dismaxQParer
> : q="term1 term2"&qs=3
> >>
> >>
> >>
> >>
> >
> 


      

Re: Query slop vs. phrase slop

Posted by David Boxenhorn <da...@lookin2.com>.
Does anybody know the answer to this?

On Tue, Oct 5, 2010 at 7:19 PM, David Boxenhorn <da...@lookin2.com> wrote:

> Thank you. I am talking about dismax's parameters.
>
> This is how I understand things, please tell me where I'm wrong:
>
> Query slop (qs) = how many words you can move the query to match the text.
> Phrase slop (ps) (when used in conjunction with &pf=text - is there another
> possibility?) = how many words you can move the text to match the query.
>
> How are those two different in terms of the results they produce?
>
> On Tue, Oct 5, 2010 at 7:08 PM, Ahmet Arslan <io...@yahoo.com> wrote:
>
>> > Can anyone explain to me the
>> > practical difference (i.e. in terms of results)
>> > between query slop and phrase slop?
>>
>> I think you are asking about dismax's parameters, right?
>>
>> ps (Phrase Slop) is about pf parameter.
>>
>> qs (Query Phrase Slop) : You cannot use tilde operator with dismax, so
>> this parameter is used instead.
>>
>> luceneQParser : "term1 term2"~3 => dismaxQParer : q="term1 term2"&qs=3
>>
>>
>>
>>
>

Re: Query slop vs. phrase slop

Posted by David Boxenhorn <da...@lookin2.com>.
Thank you. I am talking about dismax's parameters.

This is how I understand things, please tell me where I'm wrong:

Query slop (qs) = how many words you can move the query to match the text.
Phrase slop (ps) (when used in conjunction with &pf=text - is there another
possibility?) = how many words you can move the text to match the query.

How are those two different in terms of the results they produce?

On Tue, Oct 5, 2010 at 7:08 PM, Ahmet Arslan <io...@yahoo.com> wrote:

> > Can anyone explain to me the
> > practical difference (i.e. in terms of results)
> > between query slop and phrase slop?
>
> I think you are asking about dismax's parameters, right?
>
> ps (Phrase Slop) is about pf parameter.
>
> qs (Query Phrase Slop) : You cannot use tilde operator with dismax, so this
> parameter is used instead.
>
> luceneQParser : "term1 term2"~3 => dismaxQParer : q="term1 term2"&qs=3
>
>
>
>

Re: Query slop vs. phrase slop

Posted by Ahmet Arslan <io...@yahoo.com>.
> Can anyone explain to me the
> practical difference (i.e. in terms of results)
> between query slop and phrase slop?

I think you are asking about dismax's parameters, right?

ps (Phrase Slop) is about pf parameter.

qs (Query Phrase Slop) : You cannot use tilde operator with dismax, so this parameter is used instead. 

luceneQParser : "term1 term2"~3 => dismaxQParer : q="term1 term2"&qs=3