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 yriveiro <ya...@gmail.com> on 2014/01/15 11:16:36 UTC

Facets maxcount feature?

Hi,

I'm wondering if Solr has some feature like face.mincount but for maxcount.

I have an use case where I need to know what facets have less than n
elements. 

I can do this adding the facet.limit=-1 parameter and fetch the whole set
and client-side remove the elements that don't match the threshold. The
problem is that the facet can return millions of rows and fetch the response
and reduce the set can take a while ...

/Yago



-----
Best regards
--
View this message in context: http://lucene.472066.n3.nabble.com/Facets-maxcount-feature-tp4111408.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Facets maxcount feature?

Posted by William Bell <bi...@gmail.com>.
Yeah for a couple years we have wanted to know the number of values in a
facet field.

I.e.

facet.field=name&facet.limit=-1

But we only want to return 3, and we want to know how many names.

facet
facet.field = name
facet.field.name.count = 156
facet.field.name.1 = Bill, 8958
facet.field.name.2 = Tony, 7049
facet.field.name.3 = Sue, 5000

The facet.field.name.count is what we want. The issue is simple on one
machine, but with sharding and SolrCloud getting unique names is a
challenge. You either need to send the whole list to be deduped to get a
unique value or you get the unique count from each shard. The latter is
okay as long as each shard does not have duplicate fields... Then you can
add them.

Bill




On Wed, Jan 15, 2014 at 3:16 AM, yriveiro <ya...@gmail.com> wrote:

> Hi,
>
> I'm wondering if Solr has some feature like face.mincount but for maxcount.
>
> I have an use case where I need to know what facets have less than n
> elements.
>
> I can do this adding the facet.limit=-1 parameter and fetch the whole set
> and client-side remove the elements that don't match the threshold. The
> problem is that the facet can return millions of rows and fetch the
> response
> and reduce the set can take a while ...
>
> /Yago
>
>
>
> -----
> Best regards
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Facets-maxcount-feature-tp4111408.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
Bill Bell
billnbell@gmail.com
cell 720-256-8076

Re: Facets maxcount feature?

Posted by Mikhail Khludnev <mk...@griddynamics.com>.
Hello Yago,

This condition doesn't help to reduce computation significantly for
facet.method=fc nor fcs, it might help for enum, but it requires
implementation efforts. Also, my feeling is that you have much more
performance challenges if you have million size facets response, it's not
typical usage at all.
Literally your problem can be solved by extending
http://wiki.apache.org/solr/SolrPlugins#QueryResponseWriter


On Wed, Jan 15, 2014 at 2:16 PM, yriveiro <ya...@gmail.com> wrote:

> Hi,
>
> I'm wondering if Solr has some feature like face.mincount but for maxcount.
>
> I have an use case where I need to know what facets have less than n
> elements.
>
> I can do this adding the facet.limit=-1 parameter and fetch the whole set
> and client-side remove the elements that don't match the threshold. The
> problem is that the facet can return millions of rows and fetch the
> response
> and reduce the set can take a while ...
>
> /Yago
>
>
>
> -----
> Best regards
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Facets-maxcount-feature-tp4111408.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics

<http://www.griddynamics.com>
 <mk...@griddynamics.com>