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 Mateusz Umstädter <Ma...@deutschebahn.com> on 2018/10/02 09:23:28 UTC

Boolean facet and empty facet.prefix results in missing true entries.

Hello,

I got a trange behavior while using the facet parameter. When I do a query with the facet.prefix parameter set I don't get the "true" entries of the facet. Example call:
https://solr.url/solr/preview/select?facet.field=internal_b&facet=on&fl=id&indent=on&q=*:*&wt=json&facet.prefix=
The result is:
"facet_counts": {
"facet_queries": {}, "facet_fields": {
"internal_b": [
"false", 2097
]
}, "facet_ranges": {}, "facet_intervals": {}, "facet_heatmaps": {}
}
When I don't add the parameter it works as intended:
https://solr.url/solr/preview/select?facet.field=internal_b&facet=on&fl=id&indent=on&q=*:*&wt=json
The result is:
"facet_counts": {
"facet_queries": {}, "facet_fields": {
"internal_b": [
"true", 2511, "false", 2097
]
}, "facet_ranges": {}, "facet_intervals": {}, "facet_heatmaps": {}
}

My Solr version: 6.6.2
Is this a bug, or a feature?

Mateusz Umstädter


Re: Boolean facet and empty facet.prefix results in missing true entries.

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
Try adding echoParams=all and see what comes back. Maybe there is some sort
of "truthiness" mapping.

Still, the solution of catching this in middleware is probably the easiest
path.

Regards,
    Alex

On Tue, Oct 2, 2018, 10:55 PM Erick Erickson, <er...@gmail.com>
wrote:

> That does, indeed, look odd. I might point out that specifying
> facet.prefix without giving it a value is rather odd, but still that
> should default to not specifying facet.prefix at all.
>
> Sounds like a JIRA is in order but I doubt it'll get a very high
> priority unless you supply a patch since the obvious workaround is to
> not send an empty prefix.
>
> Best,
> Erick
> On Tue, Oct 2, 2018 at 2:23 AM Mateusz Umstädter
> <Ma...@deutschebahn.com> wrote:
> >
> > Hello,
> >
> > I got a trange behavior while using the facet parameter. When I do a
> query with the facet.prefix parameter set I don't get the "true" entries of
> the facet. Example call:
> >
> https://solr.url/solr/preview/select?facet.field=internal_b&facet=on&fl=id&indent=on&q=*:*&wt=json&facet.prefix=
> > The result is:
> > "facet_counts": {
> > "facet_queries": {}, "facet_fields": {
> > "internal_b": [
> > "false", 2097
> > ]
> > }, "facet_ranges": {}, "facet_intervals": {}, "facet_heatmaps": {}
> > }
> > When I don't add the parameter it works as intended:
> >
> https://solr.url/solr/preview/select?facet.field=internal_b&facet=on&fl=id&indent=on&q=*:*&wt=json
> > The result is:
> > "facet_counts": {
> > "facet_queries": {}, "facet_fields": {
> > "internal_b": [
> > "true", 2511, "false", 2097
> > ]
> > }, "facet_ranges": {}, "facet_intervals": {}, "facet_heatmaps": {}
> > }
> >
> > My Solr version: 6.6.2
> > Is this a bug, or a feature?
> >
> > Mateusz Umstädter
> >
>

Re: Boolean facet and empty facet.prefix results in missing true entries.

Posted by Erick Erickson <er...@gmail.com>.
That does, indeed, look odd. I might point out that specifying
facet.prefix without giving it a value is rather odd, but still that
should default to not specifying facet.prefix at all.

Sounds like a JIRA is in order but I doubt it'll get a very high
priority unless you supply a patch since the obvious workaround is to
not send an empty prefix.

Best,
Erick
On Tue, Oct 2, 2018 at 2:23 AM Mateusz Umstädter
<Ma...@deutschebahn.com> wrote:
>
> Hello,
>
> I got a trange behavior while using the facet parameter. When I do a query with the facet.prefix parameter set I don't get the "true" entries of the facet. Example call:
> https://solr.url/solr/preview/select?facet.field=internal_b&facet=on&fl=id&indent=on&q=*:*&wt=json&facet.prefix=
> The result is:
> "facet_counts": {
> "facet_queries": {}, "facet_fields": {
> "internal_b": [
> "false", 2097
> ]
> }, "facet_ranges": {}, "facet_intervals": {}, "facet_heatmaps": {}
> }
> When I don't add the parameter it works as intended:
> https://solr.url/solr/preview/select?facet.field=internal_b&facet=on&fl=id&indent=on&q=*:*&wt=json
> The result is:
> "facet_counts": {
> "facet_queries": {}, "facet_fields": {
> "internal_b": [
> "true", 2511, "false", 2097
> ]
> }, "facet_ranges": {}, "facet_intervals": {}, "facet_heatmaps": {}
> }
>
> My Solr version: 6.6.2
> Is this a bug, or a feature?
>
> Mateusz Umstädter
>