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 Furkan KAMACI <fu...@gmail.com> on 2017/04/17 22:51:06 UTC

Filter Facet Query

My query:

/select?facet.field=research&facet=on&q=content:test

Q1) Facet returns research values with 0 counts which has a research value
that is not from a document matched by main query (content:test). Is that
usual?

Q2) I want to filter out research values with empty string ("") from facet
result. How can I do that?

Kind Regards,
Furkan KAMACI

Re: Filter Facet Query

Posted by Furkan KAMACI <fu...@gmail.com>.
Hi Alex,

I found the reason, thanks for the help. Facet shows all possible values
including 0.

Could you help on my last question:

I have facet results like:

"", 9
"research",6
"development",3


I want to filter empty string from my facet "" (I don't want to add it to
fq, just filter from facets). How can I do that?

On Tue, Apr 18, 2017 at 11:52 AM, Alexandre Rafalovitch <ar...@gmail.com>
wrote:

> Are you saying that all the values in the facet are zero with that
> query? The query you gave seems to be the super-basic faceting code,
> so maybe something super-basic is missing.
>
> E.g.
> *) Did you check that the documents you get back actually have any
> values in that field to facet on?
> *) Did you try making a query just by ID for a document that
> definitely has the value in that field?
> *) Did you do the query with echoParams=all to see that you are not
> having any hidden extra parameters that get appended?
>
> Regards,
>    Alex.
>
> ----
> http://www.solr-start.com/ - Resources for Solr users, new and experienced
>
>
> On 18 April 2017 at 11:43, Furkan KAMACI <fu...@gmail.com> wrote:
> > OK, it returns 0 results every time.
> >
> > So,
> >
> > I want to filter out research values with empty string ("") from facet
> > result. How can I do that?
> >
> >
> > On Tue, Apr 18, 2017 at 8:53 AM, Furkan KAMACI <fu...@gmail.com>
> > wrote:
> >
> >> First problem is they do not match with main query.
> >>
> >> 18 Nis 2017 Sal, saat 01:54 tarihinde Dave <
> hastings.recursive@gmail.com>
> >> şunu yazdı:
> >>
> >>> Min.count is what you're looking for to get non 0 facets
> >>>
> >>> > On Apr 17, 2017, at 6:51 PM, Furkan KAMACI <fu...@gmail.com>
> >>> wrote:
> >>> >
> >>> > My query:
> >>> >
> >>> > /select?facet.field=research&facet=on&q=content:test
> >>> >
> >>> > Q1) Facet returns research values with 0 counts which has a research
> >>> value
> >>> > that is not from a document matched by main query (content:test). Is
> >>> that
> >>> > usual?
> >>> >
> >>> > Q2) I want to filter out research values with empty string ("") from
> >>> facet
> >>> > result. How can I do that?
> >>> >
> >>> > Kind Regards,
> >>> > Furkan KAMACI
> >>>
> >>
>

Re: Filter Facet Query

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
Are you saying that all the values in the facet are zero with that
query? The query you gave seems to be the super-basic faceting code,
so maybe something super-basic is missing.

E.g.
*) Did you check that the documents you get back actually have any
values in that field to facet on?
*) Did you try making a query just by ID for a document that
definitely has the value in that field?
*) Did you do the query with echoParams=all to see that you are not
having any hidden extra parameters that get appended?

Regards,
   Alex.

----
http://www.solr-start.com/ - Resources for Solr users, new and experienced


On 18 April 2017 at 11:43, Furkan KAMACI <fu...@gmail.com> wrote:
> OK, it returns 0 results every time.
>
> So,
>
> I want to filter out research values with empty string ("") from facet
> result. How can I do that?
>
>
> On Tue, Apr 18, 2017 at 8:53 AM, Furkan KAMACI <fu...@gmail.com>
> wrote:
>
>> First problem is they do not match with main query.
>>
>> 18 Nis 2017 Sal, saat 01:54 tarihinde Dave <ha...@gmail.com>
>> şunu yazdı:
>>
>>> Min.count is what you're looking for to get non 0 facets
>>>
>>> > On Apr 17, 2017, at 6:51 PM, Furkan KAMACI <fu...@gmail.com>
>>> wrote:
>>> >
>>> > My query:
>>> >
>>> > /select?facet.field=research&facet=on&q=content:test
>>> >
>>> > Q1) Facet returns research values with 0 counts which has a research
>>> value
>>> > that is not from a document matched by main query (content:test). Is
>>> that
>>> > usual?
>>> >
>>> > Q2) I want to filter out research values with empty string ("") from
>>> facet
>>> > result. How can I do that?
>>> >
>>> > Kind Regards,
>>> > Furkan KAMACI
>>>
>>

Re: Filter Facet Query

Posted by Furkan KAMACI <fu...@gmail.com>.
OK, it returns 0 results every time.

So,

I want to filter out research values with empty string ("") from facet
result. How can I do that?


On Tue, Apr 18, 2017 at 8:53 AM, Furkan KAMACI <fu...@gmail.com>
wrote:

> First problem is they do not match with main query.
>
> 18 Nis 2017 Sal, saat 01:54 tarihinde Dave <ha...@gmail.com>
> şunu yazdı:
>
>> Min.count is what you're looking for to get non 0 facets
>>
>> > On Apr 17, 2017, at 6:51 PM, Furkan KAMACI <fu...@gmail.com>
>> wrote:
>> >
>> > My query:
>> >
>> > /select?facet.field=research&facet=on&q=content:test
>> >
>> > Q1) Facet returns research values with 0 counts which has a research
>> value
>> > that is not from a document matched by main query (content:test). Is
>> that
>> > usual?
>> >
>> > Q2) I want to filter out research values with empty string ("") from
>> facet
>> > result. How can I do that?
>> >
>> > Kind Regards,
>> > Furkan KAMACI
>>
>

Re: Filter Facet Query

Posted by Furkan KAMACI <fu...@gmail.com>.
First problem is they do not match with main query.

18 Nis 2017 Sal, saat 01:54 tarihinde Dave <ha...@gmail.com>
şunu yazdı:

> Min.count is what you're looking for to get non 0 facets
>
> > On Apr 17, 2017, at 6:51 PM, Furkan KAMACI <fu...@gmail.com>
> wrote:
> >
> > My query:
> >
> > /select?facet.field=research&facet=on&q=content:test
> >
> > Q1) Facet returns research values with 0 counts which has a research
> value
> > that is not from a document matched by main query (content:test). Is that
> > usual?
> >
> > Q2) I want to filter out research values with empty string ("") from
> facet
> > result. How can I do that?
> >
> > Kind Regards,
> > Furkan KAMACI
>

Re: Filter Facet Query

Posted by Dave <ha...@gmail.com>.
Min.count is what you're looking for to get non 0 facets

> On Apr 17, 2017, at 6:51 PM, Furkan KAMACI <fu...@gmail.com> wrote:
> 
> My query:
> 
> /select?facet.field=research&facet=on&q=content:test
> 
> Q1) Facet returns research values with 0 counts which has a research value
> that is not from a document matched by main query (content:test). Is that
> usual?
> 
> Q2) I want to filter out research values with empty string ("") from facet
> result. How can I do that?
> 
> Kind Regards,
> Furkan KAMACI