JSON Facets and excluded tags - not working for empty results

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

JSON Facets and excluded tags - not working for empty results

Stefan Matheis-3
I’m not entirely sure i’m describing the correct problem here - for now it looks like the only way it occurs and i hope it’s not misleading any pointers that would be helpful. so in case you think i got it wrong, please say so

I have two documents in the index [{"source":"foo"}, {"source":"bar”}] where source is a simple string field (indexed as well as stored, if that’ll matter).

Using

> ?q=*:*
> &fq={!tag=source}source:"meh"
> &json.facet={"source":{"type":"terms","field":"source","domain":{"excludeTags":"source"}}}

where meh is a value that is not available for source, i get no results (expected) but no facets as well - which is rather unexpected to me. as soon as i go with source:”bar” (or something else that yields at least one record) i’m getting a record back and as well facets.

which is why i’ve started of with the idea that there might be a correlation between those things. verifying the situation using the old facet approach i always get the expected facets back, no matter if the result is empty or not.

Or isn’t it supposed to work like this anymore and i’m the guy who didn’t get the memo?

Thanks
Stefan

Reply | Threaded
Open this post in threaded view
|

Re: JSON Facets and excluded tags - not working for empty results

Mikhail Khludnev-2
Hello Stefan,
Have you tried to add processEmpty:true ?

json.facet={processEmpty:true,"source":{"type":"terms","field":"source","
domain":{"excludeTags":"source"}}}

On Wed, Sep 14, 2016 at 5:12 PM, Stefan Matheis <[hidden email]> wrote:

> I’m not entirely sure i’m describing the correct problem here - for now it
> looks like the only way it occurs and i hope it’s not misleading any
> pointers that would be helpful. so in case you think i got it wrong, please
> say so
>
> I have two documents in the index [{"source":"foo"}, {"source":"bar”}]
> where source is a simple string field (indexed as well as stored, if
> that’ll matter).
>
> Using
>
> > ?q=*:*
> > &fq={!tag=source}source:"meh"
> > &json.facet={"source":{"type":"terms","field":"source","
> domain":{"excludeTags":"source"}}}
>
> where meh is a value that is not available for source, i get no results
> (expected) but no facets as well - which is rather unexpected to me. as
> soon as i go with source:”bar” (or something else that yields at least one
> record) i’m getting a record back and as well facets.
>
> which is why i’ve started of with the idea that there might be a
> correlation between those things. verifying the situation using the old
> facet approach i always get the expected facets back, no matter if the
> result is empty or not.
>
> Or isn’t it supposed to work like this anymore and i’m the guy who didn’t
> get the memo?
>
> Thanks
> Stefan
>
>


--
Sincerely yours
Mikhail Khludnev
Reply | Threaded
Open this post in threaded view
|

Re: JSON Facets and excluded tags - not working for empty results

Stefan Matheis-3

Thanks for the Pointer Mikhail,

i didn’t ;o i’ve seen it in some tests but i didn’t realize that it might help (now pretty obvious) .. and now i’m finding all the relevant threads as well.

Thanks again,
Stefan

On September 15, 2016 at 10:10:32 AM, Mikhail Khludnev ([hidden email]) wrote:

> Hello Stefan,
> Have you tried to add processEmpty:true ?
>  
> json.facet={processEmpty:true,"source":{"type":"terms","field":"source","  
> domain":{"excludeTags":"source"}}}
>  
> On Wed, Sep 14, 2016 at 5:12 PM, Stefan Matheis wrote:
>  
> > I’m not entirely sure i’m describing the correct problem here - for now it
> > looks like the only way it occurs and i hope it’s not misleading any
> > pointers that would be helpful. so in case you think i got it wrong, please
> > say so
> >
> > I have two documents in the index [{"source":"foo"}, {"source":"bar”}]
> > where source is a simple string field (indexed as well as stored, if
> > that’ll matter).
> >
> > Using
> >
> > > ?q=*:*
> > > &fq={!tag=source}source:"meh"
> > > &json.facet={"source":{"type":"terms","field":"source","
> > domain":{"excludeTags":"source"}}}
> >
> > where meh is a value that is not available for source, i get no results
> > (expected) but no facets as well - which is rather unexpected to me. as
> > soon as i go with source:”bar” (or something else that yields at least one
> > record) i’m getting a record back and as well facets.
> >
> > which is why i’ve started of with the idea that there might be a
> > correlation between those things. verifying the situation using the old
> > facet approach i always get the expected facets back, no matter if the
> > result is empty or not.
> >
> > Or isn’t it supposed to work like this anymore and i’m the guy who didn’t
> > get the memo?
> >
> > Thanks
> > Stefan
> >
> >
>  
>  
> --
> Sincerely yours
> Mikhail Khludnev
>  

Reply | Threaded
Open this post in threaded view
|

Re: JSON Facets and excluded tags - not working for empty results

Yonik Seeley
In reply to this post by Stefan Matheis-3
On Wed, Sep 14, 2016 at 10:12 AM, Stefan Matheis <[hidden email]> wrote:

> I’m not entirely sure i’m describing the correct problem here - for now it looks like the only way it occurs and i hope it’s not misleading any pointers that would be helpful. so in case you think i got it wrong, please say so
>
> I have two documents in the index [{"source":"foo"}, {"source":"bar”}] where source is a simple string field (indexed as well as stored, if that’ll matter).
>
> Using
>
>> ?q=*:*
>> &fq={!tag=source}source:"meh"
>> &json.facet={"source":{"type":"terms","field":"source","domain":{"excludeTags":"source"}}}
>
> where meh is a value that is not available for source, i get no results (expected) but no facets as well - which is rather unexpected to me. as soon as i go with source:”bar” (or something else that yields at least one record) i’m getting a record back and as well facets.

A case this simple should be categorized as a bug...

Background: the JSON Facet API does not execute sub-facets for a facet
bucket with a 0 count (and the root facet bucket is like any other
facet bucket).
This was to help prevent the combinatorial explosion of deeply nested
sub-facets with useless information.

This is obviously incorrect though, when a sub-facet does something
that can expand the domain rather than just restrict it.  Facet
exclusions are one of these cases.
For zero facet buckets, we should check if any sub-facets have these
properties and then recurse if so.

-Yonik


> which is why i’ve started of with the idea that there might be a correlation between those things. verifying the situation using the old facet approach i always get the expected facets back, no matter if the result is empty or not.
>
> Or isn’t it supposed to work like this anymore and i’m the guy who didn’t get the memo?
>
> Thanks
> Stefan
>
Reply | Threaded
Open this post in threaded view
|

Re: JSON Facets and excluded tags - not working for empty results

Yonik Seeley
I opened
https://issues.apache.org/jira/browse/SOLR-9519

-Yonik


On Thu, Sep 15, 2016 at 9:17 AM, Yonik Seeley <[hidden email]> wrote:

> On Wed, Sep 14, 2016 at 10:12 AM, Stefan Matheis <[hidden email]> wrote:
>> I’m not entirely sure i’m describing the correct problem here - for now it looks like the only way it occurs and i hope it’s not misleading any pointers that would be helpful. so in case you think i got it wrong, please say so
>>
>> I have two documents in the index [{"source":"foo"}, {"source":"bar”}] where source is a simple string field (indexed as well as stored, if that’ll matter).
>>
>> Using
>>
>>> ?q=*:*
>>> &fq={!tag=source}source:"meh"
>>> &json.facet={"source":{"type":"terms","field":"source","domain":{"excludeTags":"source"}}}
>>
>> where meh is a value that is not available for source, i get no results (expected) but no facets as well - which is rather unexpected to me. as soon as i go with source:”bar” (or something else that yields at least one record) i’m getting a record back and as well facets.
>
> A case this simple should be categorized as a bug...
>
> Background: the JSON Facet API does not execute sub-facets for a facet
> bucket with a 0 count (and the root facet bucket is like any other
> facet bucket).
> This was to help prevent the combinatorial explosion of deeply nested
> sub-facets with useless information.
>
> This is obviously incorrect though, when a sub-facet does something
> that can expand the domain rather than just restrict it.  Facet
> exclusions are one of these cases.
> For zero facet buckets, we should check if any sub-facets have these
> properties and then recurse if so.
>
> -Yonik
>
>
>> which is why i’ve started of with the idea that there might be a correlation between those things. verifying the situation using the old facet approach i always get the expected facets back, no matter if the result is empty or not.
>>
>> Or isn’t it supposed to work like this anymore and i’m the guy who didn’t get the memo?
>>
>> Thanks
>> Stefan
>>