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 Antoine LE FLOC'H <le...@gmail.com> on 2016/04/18 21:25:49 UTC

Re: Cannot use Phrase Queries in eDisMax and filtering

Hello,

I don't have Solr source code handy but is
pf3=1&
pf2=1&
valid ? What would that do ? use the df or qf fields ?

This
https://cwiki.apache.org/confluence/display/solr/The+Extended+DisMax+Query+Parser
says that the value of pf2 is a multivalued list of fields ? There are not
many example about this in this link.

I cannot find either the condition on the field analyzer to be able to use
pf, pf2 and pf3.

Feedback would be appreciated, thanks.

Antoine.





On Mon, Nov 3, 2014 at 8:29 PM, Ramzi Alqrainy <ra...@gmail.com>
wrote:

> I tried to produce your case in my machine with below queries, but
> everything
> worked fine with me. I just want to ask you a question what is the field
> type of "tag" field ?
>
> q=bmw&
> fl=score,*&
> wt=json&
> fq=city_id:59&
> qt=/query&
> defType=edismax&
> pf=title^15%20discription^5&
> pf3=1&
> pf2=1&
> ps=1&
> qroup=true&
> group.field=member_id&
> group.limit=10&
> sort=score desc&
> group.ngroups=true
>
>
>
>
> q=bmw&
> fl=score,*&
> wt=json&
> fq=city_id:59&
> qt=/query&
> defType=edismax&
> pf=title^15%20discription^5&
> pf3=1&
> pf2=1&
> ps=1&
> qroup=true&
> group.field=member_id&
> group.limit=10&
> group.ngroups=true&
> sort=score desc&
> fq=category_id:1777
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Cannot-use-Phrase-Queries-in-eDisMax-and-filtering-tp4167302p4167338.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: Cannot use Phrase Queries in eDisMax and filtering

Posted by Antoine LE FLOC'H <le...@gmail.com>.
Thanks Erick,

looking at   parseFieldBoostsAndSlop()  do you confirm that
pf3=1&
pf2=1&
is not valid and it has to be a multivalued list of fields ?

Thank you.


On Tue, Apr 19, 2016 at 1:59 AM, Erick Erickson <er...@gmail.com>
wrote:

> bq: I cannot find either the condition on the field analyzer to be able to
> use
> pf, pf2 and pf3.
>
> These don't apply to field analysis at all. What they translate into
> is a series of
> phrase queries against different sets of fields. So, you may have
> pf=fieldA^5 fieldB
> pf2=fieldA^3 fieldC
>
> Now a query like (without quotes) "big dog" would be
> translated into something like
> ...
> fieldA:"big dog"^5 fieldB:"big dog" fieldA:"big dog"^3 fieldC:"big dog"
>
> Having multiple pf fields allows you to query with different slop values,
> different boosts etc. on the same or different fields.
>
> Best,
> Erick
>
>
> On Mon, Apr 18, 2016 at 12:25 PM, Antoine LE FLOC'H <le...@gmail.com>
> wrote:
> > Hello,
> >
> > I don't have Solr source code handy but is
> > pf3=1&
> > pf2=1&
> > valid ? What would that do ? use the df or qf fields ?
> >
> > This
> >
> https://cwiki.apache.org/confluence/display/solr/The+Extended+DisMax+Query+Parser
> > says that the value of pf2 is a multivalued list of fields ? There are
> not
> > many example about this in this link.
> >
> > I cannot find either the condition on the field analyzer to be able to
> use
> > pf, pf2 and pf3.
> >
> > Feedback would be appreciated, thanks.
> >
> > Antoine.
> >
> >
> >
> >
> >
> > On Mon, Nov 3, 2014 at 8:29 PM, Ramzi Alqrainy <ramzi.alqrainy@gmail.com
> >
> > wrote:
> >
> >> I tried to produce your case in my machine with below queries, but
> >> everything
> >> worked fine with me. I just want to ask you a question what is the field
> >> type of "tag" field ?
> >>
> >> q=bmw&
> >> fl=score,*&
> >> wt=json&
> >> fq=city_id:59&
> >> qt=/query&
> >> defType=edismax&
> >> pf=title^15%20discription^5&
> >> pf3=1&
> >> pf2=1&
> >> ps=1&
> >> qroup=true&
> >> group.field=member_id&
> >> group.limit=10&
> >> sort=score desc&
> >> group.ngroups=true
> >>
> >>
> >>
> >>
> >> q=bmw&
> >> fl=score,*&
> >> wt=json&
> >> fq=city_id:59&
> >> qt=/query&
> >> defType=edismax&
> >> pf=title^15%20discription^5&
> >> pf3=1&
> >> pf2=1&
> >> ps=1&
> >> qroup=true&
> >> group.field=member_id&
> >> group.limit=10&
> >> group.ngroups=true&
> >> sort=score desc&
> >> fq=category_id:1777
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://lucene.472066.n3.nabble.com/Cannot-use-Phrase-Queries-in-eDisMax-and-filtering-tp4167302p4167338.html
> >> Sent from the Solr - User mailing list archive at Nabble.com.
> >>
>

Re: Cannot use Phrase Queries in eDisMax and filtering

Posted by Doug Turnbull <dt...@opensourceconnections.com>.
Also you mentioned your field was a string? This means the field must match
*exactly* to be considered.a phrase match. Have you considered changing the
field to text field type with a tokenizer and doing phrase matching -- it
might work more like you'd expect.

Thanks
-Doug

On Mon, Apr 18, 2016 at 7:59 PM Erick Erickson <er...@gmail.com>
wrote:

> bq: I cannot find either the condition on the field analyzer to be able to
> use
> pf, pf2 and pf3.
>
> These don't apply to field analysis at all. What they translate into
> is a series of
> phrase queries against different sets of fields. So, you may have
> pf=fieldA^5 fieldB
> pf2=fieldA^3 fieldC
>
> Now a query like (without quotes) "big dog" would be
> translated into something like
> ...
> fieldA:"big dog"^5 fieldB:"big dog" fieldA:"big dog"^3 fieldC:"big dog"
>
> Having multiple pf fields allows you to query with different slop values,
> different boosts etc. on the same or different fields.
>
> Best,
> Erick
>
>
> On Mon, Apr 18, 2016 at 12:25 PM, Antoine LE FLOC'H <le...@gmail.com>
> wrote:
> > Hello,
> >
> > I don't have Solr source code handy but is
> > pf3=1&
> > pf2=1&
> > valid ? What would that do ? use the df or qf fields ?
> >
> > This
> >
> https://cwiki.apache.org/confluence/display/solr/The+Extended+DisMax+Query+Parser
> > says that the value of pf2 is a multivalued list of fields ? There are
> not
> > many example about this in this link.
> >
> > I cannot find either the condition on the field analyzer to be able to
> use
> > pf, pf2 and pf3.
> >
> > Feedback would be appreciated, thanks.
> >
> > Antoine.
> >
> >
> >
> >
> >
> > On Mon, Nov 3, 2014 at 8:29 PM, Ramzi Alqrainy <ramzi.alqrainy@gmail.com
> >
> > wrote:
> >
> >> I tried to produce your case in my machine with below queries, but
> >> everything
> >> worked fine with me. I just want to ask you a question what is the field
> >> type of "tag" field ?
> >>
> >> q=bmw&
> >> fl=score,*&
> >> wt=json&
> >> fq=city_id:59&
> >> qt=/query&
> >> defType=edismax&
> >> pf=title^15%20discription^5&
> >> pf3=1&
> >> pf2=1&
> >> ps=1&
> >> qroup=true&
> >> group.field=member_id&
> >> group.limit=10&
> >> sort=score desc&
> >> group.ngroups=true
> >>
> >>
> >>
> >>
> >> q=bmw&
> >> fl=score,*&
> >> wt=json&
> >> fq=city_id:59&
> >> qt=/query&
> >> defType=edismax&
> >> pf=title^15%20discription^5&
> >> pf3=1&
> >> pf2=1&
> >> ps=1&
> >> qroup=true&
> >> group.field=member_id&
> >> group.limit=10&
> >> group.ngroups=true&
> >> sort=score desc&
> >> fq=category_id:1777
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://lucene.472066.n3.nabble.com/Cannot-use-Phrase-Queries-in-eDisMax-and-filtering-tp4167302p4167338.html
> >> Sent from the Solr - User mailing list archive at Nabble.com.
> >>
>

Re: Cannot use Phrase Queries in eDisMax and filtering

Posted by Erick Erickson <er...@gmail.com>.
bq: I cannot find either the condition on the field analyzer to be able to use
pf, pf2 and pf3.

These don't apply to field analysis at all. What they translate into
is a series of
phrase queries against different sets of fields. So, you may have
pf=fieldA^5 fieldB
pf2=fieldA^3 fieldC

Now a query like (without quotes) "big dog" would be
translated into something like
...
fieldA:"big dog"^5 fieldB:"big dog" fieldA:"big dog"^3 fieldC:"big dog"

Having multiple pf fields allows you to query with different slop values,
different boosts etc. on the same or different fields.

Best,
Erick


On Mon, Apr 18, 2016 at 12:25 PM, Antoine LE FLOC'H <le...@gmail.com> wrote:
> Hello,
>
> I don't have Solr source code handy but is
> pf3=1&
> pf2=1&
> valid ? What would that do ? use the df or qf fields ?
>
> This
> https://cwiki.apache.org/confluence/display/solr/The+Extended+DisMax+Query+Parser
> says that the value of pf2 is a multivalued list of fields ? There are not
> many example about this in this link.
>
> I cannot find either the condition on the field analyzer to be able to use
> pf, pf2 and pf3.
>
> Feedback would be appreciated, thanks.
>
> Antoine.
>
>
>
>
>
> On Mon, Nov 3, 2014 at 8:29 PM, Ramzi Alqrainy <ra...@gmail.com>
> wrote:
>
>> I tried to produce your case in my machine with below queries, but
>> everything
>> worked fine with me. I just want to ask you a question what is the field
>> type of "tag" field ?
>>
>> q=bmw&
>> fl=score,*&
>> wt=json&
>> fq=city_id:59&
>> qt=/query&
>> defType=edismax&
>> pf=title^15%20discription^5&
>> pf3=1&
>> pf2=1&
>> ps=1&
>> qroup=true&
>> group.field=member_id&
>> group.limit=10&
>> sort=score desc&
>> group.ngroups=true
>>
>>
>>
>>
>> q=bmw&
>> fl=score,*&
>> wt=json&
>> fq=city_id:59&
>> qt=/query&
>> defType=edismax&
>> pf=title^15%20discription^5&
>> pf3=1&
>> pf2=1&
>> ps=1&
>> qroup=true&
>> group.field=member_id&
>> group.limit=10&
>> group.ngroups=true&
>> sort=score desc&
>> fq=category_id:1777
>>
>>
>>
>> --
>> View this message in context:
>> http://lucene.472066.n3.nabble.com/Cannot-use-Phrase-Queries-in-eDisMax-and-filtering-tp4167302p4167338.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
>>