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 Никита Веневитин <ve...@gmail.com> on 2016/10/21 09:34:02 UTC

Excluding filter queries in json facet

Hello! I've got problem with excluding filter query when using json facet
api.
My query:

q=*
fq={!tag=fieldA} fieldA:"valueA"
fq={!tag=fieldB} fieldB:"valueB"


and there is no documents with fieldA:"valueA" and fieldB:"valueB",
so docs list is empty.
Then, if I use

facet=true&facet.field={!ex=fieldB}fieldB


it works fine: response contains terms with counts not taking second filter
query
into account, but if I use

json.facet=
{
    "fieldB_facet": {
        "field": "fieldB",
        "mincount": 0,
        "domain": {
            "excludeTags": "fieldB"
        },
        "limit": -1,
        "sort": "index asc",
        "type": "terms"
    }
}

I expect same result, but response contains only

"facets":{ "count":0}}

Re: Excluding filter queries in json facet

Posted by Никита Веневитин <ve...@gmail.com>.
Thank you!

2016-10-21 14:31 GMT+03:00 Yonik Seeley <ys...@gmail.com>:

> That's this issue:
> https://issues.apache.org/jira/browse/SOLR-9519
>
> -Yonik
>
>
> On Fri, Oct 21, 2016 at 5:34 AM, Никита Веневитин
> <ve...@gmail.com> wrote:
> > Hello! I've got problem with excluding filter query when using json facet
> > api.
> > My query:
> >
> > q=*
> > fq={!tag=fieldA} fieldA:"valueA"
> > fq={!tag=fieldB} fieldB:"valueB"
> >
> >
> > and there is no documents with fieldA:"valueA" and fieldB:"valueB",
> > so docs list is empty.
> > Then, if I use
> >
> > facet=true&facet.field={!ex=fieldB}fieldB
> >
> >
> > it works fine: response contains terms with counts not taking second
> filter
> > query
> > into account, but if I use
> >
> > json.facet=
> > {
> >     "fieldB_facet": {
> >         "field": "fieldB",
> >         "mincount": 0,
> >         "domain": {
> >             "excludeTags": "fieldB"
> >         },
> >         "limit": -1,
> >         "sort": "index asc",
> >         "type": "terms"
> >     }
> > }
> >
> > I expect same result, but response contains only
> >
> > "facets":{ "count":0}}
>

Re: Excluding filter queries in json facet

Posted by Yonik Seeley <ys...@gmail.com>.
That's this issue:
https://issues.apache.org/jira/browse/SOLR-9519

-Yonik


On Fri, Oct 21, 2016 at 5:34 AM, Никита Веневитин
<ve...@gmail.com> wrote:
> Hello! I've got problem with excluding filter query when using json facet
> api.
> My query:
>
> q=*
> fq={!tag=fieldA} fieldA:"valueA"
> fq={!tag=fieldB} fieldB:"valueB"
>
>
> and there is no documents with fieldA:"valueA" and fieldB:"valueB",
> so docs list is empty.
> Then, if I use
>
> facet=true&facet.field={!ex=fieldB}fieldB
>
>
> it works fine: response contains terms with counts not taking second filter
> query
> into account, but if I use
>
> json.facet=
> {
>     "fieldB_facet": {
>         "field": "fieldB",
>         "mincount": 0,
>         "domain": {
>             "excludeTags": "fieldB"
>         },
>         "limit": -1,
>         "sort": "index asc",
>         "type": "terms"
>     }
> }
>
> I expect same result, but response contains only
>
> "facets":{ "count":0}}

Fwd: Excluding filter queries in json facet

Posted by Никита Веневитин <ve...@gmail.com>.
Hello! I've got problem with excluding filter query when using json facet
api.
My query:

q=*
fq={!tag=fieldA} fieldA:"valueA"
fq={!tag=fieldB} fieldB:"valueB"


and there is no documents with fieldA:"valueA" and fieldB:"valueB",
so docs list is empty.
Then, if I use

facet=true&facet.field={!ex=fieldB}fieldB


it works fine: response contains terms with counts not taking second filter
query
into account, but if I use

json.facet=
{
    "fieldB_facet": {
        "field": "fieldB",
        "mincount": 0,
        "domain": {
            "excludeTags": "fieldB"
        },
        "limit": -1,
        "sort": "index asc",
        "type": "terms"
    }
}

I expect same result, but response contains only

"facets":{ "count":0}}