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 Gastone Penzo <ga...@gmail.com> on 2011/03/10 12:02:33 UTC

disquery - difference qf qs / pf ps

Hi
i understand what qf and qs parameters are
but i can't understand what pf and ps are exactly.
someone can explain it to me??

for example

qf=title^2 name^1.2 surname^1
qs=3

it means i search in title field with boost 2 or in name field with boost
1.2 or in surname field with boost 1
and the maximum slop beetween term to match is 3.

right??

and the ps? pf? (phrase filter and phrase slop)?
can i use all 4 parameters together??

Thanx

-- 
Gastone Penzo

Re: disquery - difference qf qs / pf ps

Posted by Bill Bell <bi...@gmail.com>.
Thank you, that is the best explanation I have ever heard.

We should add to the Wiki (given that is is correct).

On 3/11/11 9:05 AM, "Tomás Fernández Löbbe" <to...@gmail.com> wrote:

>AFAIK, the difference is that the phrase slop applies to the phrase
>queries
>generated automatically by dismax and applied to the fields in "pf". Query
>Slop (qs) is the phrase slop applied to a phrase explicitly specified by
>the
>user, which will be applied to all the Query Fields (qf).
>
>An easy way to understand the phrase slop, is "the number of positions
>that
>you have to move a term to have the exact phrase". For example, If you
>have
>the query
>
>"A query" (a phrase query with slop = 0)
>
>and a document that says
>
>"a simple query"
>
>It won't match, but if you have the query:
>
>"A query"~1 (a phrase query with slop = 1)
>
>Then, the document will match the phrase query, even if is not exact.
>
>I hope I'm clear enough.
>
>Tomás
>
>
>On Fri, Mar 11, 2011 at 12:41 PM, Bill Bell <bi...@gmail.com> wrote:
>
>> What exactly is phrase and query slop? What technically is a slop?
>>
>> Bill Bell
>> Sent from mobile
>>
>>
>> On Mar 11, 2011, at 4:15 AM, Gastone Penzo <ga...@gmail.com>
>> wrote:
>>
>> > ok thank you!!!
>> >
>> > 2011/3/10 Jonathan Rochkind <ro...@jhu.edu>
>> >
>> >> On 3/10/2011 8:15 AM, Gastone Penzo wrote:
>> >>
>> >>> Thank you very much. i understand the difference beetween qs and ps
>>but
>> >>> not
>> >>> what pf is...is it necessary to use ps?
>> >>>
>> >>
>> >> It's not neccesary to use anything, including Solr.
>> >>
>> >> pf:  Will take the entire query the user entered, make it into a
>>single
>> >> phrase, and boost documents within the already existing result set
>>that
>> >> match that phrase. pf does not change the result set, it just changes
>> the
>> >> ranking.
>> >> ps: Will set phrase query slop on that pf query of the entire entered
>> >> search string, that effects boosting.
>> >>
>> >>
>> >>
>> >
>> >
>> > --
>> > Gastone Penzo
>>



Re: disquery - difference qf qs / pf ps

Posted by Tomás Fernández Löbbe <to...@gmail.com>.
AFAIK, the difference is that the phrase slop applies to the phrase queries
generated automatically by dismax and applied to the fields in "pf". Query
Slop (qs) is the phrase slop applied to a phrase explicitly specified by the
user, which will be applied to all the Query Fields (qf).

An easy way to understand the phrase slop, is "the number of positions that
you have to move a term to have the exact phrase". For example, If you have
the query

"A query" (a phrase query with slop = 0)

and a document that says

"a simple query"

It won't match, but if you have the query:

"A query"~1 (a phrase query with slop = 1)

Then, the document will match the phrase query, even if is not exact.

I hope I'm clear enough.

Tomás


On Fri, Mar 11, 2011 at 12:41 PM, Bill Bell <bi...@gmail.com> wrote:

> What exactly is phrase and query slop? What technically is a slop?
>
> Bill Bell
> Sent from mobile
>
>
> On Mar 11, 2011, at 4:15 AM, Gastone Penzo <ga...@gmail.com>
> wrote:
>
> > ok thank you!!!
> >
> > 2011/3/10 Jonathan Rochkind <ro...@jhu.edu>
> >
> >> On 3/10/2011 8:15 AM, Gastone Penzo wrote:
> >>
> >>> Thank you very much. i understand the difference beetween qs and ps but
> >>> not
> >>> what pf is...is it necessary to use ps?
> >>>
> >>
> >> It's not neccesary to use anything, including Solr.
> >>
> >> pf:  Will take the entire query the user entered, make it into a single
> >> phrase, and boost documents within the already existing result set that
> >> match that phrase. pf does not change the result set, it just changes
> the
> >> ranking.
> >> ps: Will set phrase query slop on that pf query of the entire entered
> >> search string, that effects boosting.
> >>
> >>
> >>
> >
> >
> > --
> > Gastone Penzo
>

Re: disquery - difference qf qs / pf ps

Posted by Bill Bell <bi...@gmail.com>.
What exactly is phrase and query slop? What technically is a slop?

Bill Bell
Sent from mobile


On Mar 11, 2011, at 4:15 AM, Gastone Penzo <ga...@gmail.com> wrote:

> ok thank you!!!
> 
> 2011/3/10 Jonathan Rochkind <ro...@jhu.edu>
> 
>> On 3/10/2011 8:15 AM, Gastone Penzo wrote:
>> 
>>> Thank you very much. i understand the difference beetween qs and ps but
>>> not
>>> what pf is...is it necessary to use ps?
>>> 
>> 
>> It's not neccesary to use anything, including Solr.
>> 
>> pf:  Will take the entire query the user entered, make it into a single
>> phrase, and boost documents within the already existing result set that
>> match that phrase. pf does not change the result set, it just changes the
>> ranking.
>> ps: Will set phrase query slop on that pf query of the entire entered
>> search string, that effects boosting.
>> 
>> 
>> 
> 
> 
> -- 
> Gastone Penzo

Re: disquery - difference qf qs / pf ps

Posted by Gastone Penzo <ga...@gmail.com>.
ok thank you!!!

2011/3/10 Jonathan Rochkind <ro...@jhu.edu>

> On 3/10/2011 8:15 AM, Gastone Penzo wrote:
>
>> Thank you very much. i understand the difference beetween qs and ps but
>> not
>> what pf is...is it necessary to use ps?
>>
>
> It's not neccesary to use anything, including Solr.
>
> pf:  Will take the entire query the user entered, make it into a single
> phrase, and boost documents within the already existing result set that
> match that phrase. pf does not change the result set, it just changes the
> ranking.
> ps: Will set phrase query slop on that pf query of the entire entered
> search string, that effects boosting.
>
>
>


-- 
Gastone Penzo

Re: disquery - difference qf qs / pf ps

Posted by Jonathan Rochkind <ro...@jhu.edu>.
On 3/10/2011 8:15 AM, Gastone Penzo wrote:
> Thank you very much. i understand the difference beetween qs and ps but not
> what pf is...is it necessary to use ps?

It's not neccesary to use anything, including Solr.

pf:  Will take the entire query the user entered, make it into a single 
phrase, and boost documents within the already existing result set that 
match that phrase. pf does not change the result set, it just changes 
the ranking.
ps: Will set phrase query slop on that pf query of the entire entered 
search string, that effects boosting.



Re: disquery - difference qf qs / pf ps

Posted by Ahmet Arslan <io...@yahoo.com>.

> i understand the
> difference beetween qs and ps but not
> what pf is...is it necessary to use ps?

pf (Phrase Fields) and ps (Phrase Slop) related to each other.

Lets say you have &q=term1 term1&pf=title text&ps=10

We can think as if dismax adds title:"term1 term2"~10 text:"term1 term2"~10 imaginary  optional clauses to your original query. Optional means they effect order of documents.

http://wiki.apache.org/solr/DisMaxQParserPlugin#pf_.28Phrase_Fields.29


      

Re: disquery - difference qf qs / pf ps

Posted by Gastone Penzo <ga...@gmail.com>.
Thank you very much. i understand the difference beetween qs and ps but not
what pf is...is it necessary to use ps?


>  Yes you can use all 4 parameters together. Please see similar discussion:
> http://search-lucene.com/m/KWkYf2kE4Ng1/
>
>
>
>


-- 
Gastone Penzo

Re: disquery - difference qf qs / pf ps

Posted by Ahmet Arslan <io...@yahoo.com>.
> Hi
> i understand what qf and qs parameters are
> but i can't understand what pf and ps are exactly.
> someone can explain it to me??
> 
> for example
> 
> qf=title^2 name^1.2 surname^1
> qs=3
> 
> it means i search in title field with boost 2 or in name
> field with boost
> 1.2 or in surname field with boost 1
> and the maximum slop beetween term to match is 3.
> 
> right??
> 
> and the ps? pf? (phrase filter and phrase slop)?
> can i use all 4 parameters together??

Yes you can use all 4 parameters together. Please see similar discussion:
http://search-lucene.com/m/KWkYf2kE4Ng1/