You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Achim Domma <ac...@uberresearch.com> on 2016/02/03 15:09:02 UTC
Restricting / Filtering facet results
Hi,
I asked this before on the users mailing list, but it was probably the
wrong list, so I give it another try here:
Our problem is, to restrict faceting results to only a subset of the
possible facet values.
The use case is the following:
Our documents have a multi value field, which holds user ids, so the
values might be like this:
doc1 = ['UserA', 'UserB', 'UserC']
doc2 = ['UserA', 'UserB']
doc3 = ['UserA', 'UserC']
doc4 = ...
Now I execute a search using some arbitrary query and filter and lets
assume that the result set is [doc1, doc2, doc3]. Facetting over the
user ids would give:
UserA: 3
UserB: 2
UserC: 2
What I need is a way to specify that I'm only interested in user ids
['UserB', 'UserC'] so that the result would be:
UserB: 2
UserC: 2
Somebody proposed to use query facets, but in real live, the reference
set is not just a list of two elements, but a large set which has to be
retrieved/configured from the outside and defining hundreds or thousands
of query facets makes no sense.
My plan would be, to extend the json facets with a filter, which checks
during aggregation whether a value should go into the result setd or not.
To me, this feature looks quite useful, reusable and rather obvious, so
I'm a bit concerned: Is it not yet implemented, just because nobody did
it? Then we would be willing to give it a try or to hire somebody. Or is
there some reason I don't see, that makes it impossible?
Any feedback which guides me to a solution would be very appreciated!
thanks,
Achim
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
Re: Restricting / Filtering facet results
Posted by Erik Hatcher <er...@gmail.com>.
Maybe the facet.prefix or facet.contains parameters could achieve what you’re after? See https://cwiki.apache.org/confluence/display/solr/Faceting <https://cwiki.apache.org/confluence/display/solr/Faceting> for details.
Erik
> On Feb 3, 2016, at 9:09 AM, Achim Domma <ac...@uberresearch.com> wrote:
>
> Hi,
>
> I asked this before on the users mailing list, but it was probably the
> wrong list, so I give it another try here:
>
> Our problem is, to restrict faceting results to only a subset of the
> possible facet values.
>
> The use case is the following:
>
> Our documents have a multi value field, which holds user ids, so the
> values might be like this:
>
> doc1 = ['UserA', 'UserB', 'UserC']
> doc2 = ['UserA', 'UserB']
> doc3 = ['UserA', 'UserC']
> doc4 = ...
>
> Now I execute a search using some arbitrary query and filter and lets
> assume that the result set is [doc1, doc2, doc3]. Facetting over the
> user ids would give:
>
> UserA: 3
> UserB: 2
> UserC: 2
>
> What I need is a way to specify that I'm only interested in user ids
> ['UserB', 'UserC'] so that the result would be:
>
> UserB: 2
> UserC: 2
>
> Somebody proposed to use query facets, but in real live, the reference
> set is not just a list of two elements, but a large set which has to be
> retrieved/configured from the outside and defining hundreds or thousands
> of query facets makes no sense.
>
> My plan would be, to extend the json facets with a filter, which checks
> during aggregation whether a value should go into the result setd or not.
>
> To me, this feature looks quite useful, reusable and rather obvious, so
> I'm a bit concerned: Is it not yet implemented, just because nobody did
> it? Then we would be willing to give it a try or to hire somebody. Or is
> there some reason I don't see, that makes it impossible?
>
> Any feedback which guides me to a solution would be very appreciated!
>
> thanks,
> Achim
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>