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 Dotan Cohen <do...@gmail.com> on 2012/09/03 16:38:27 UTC
Faceting Facets
Is there any way to nest facet searches in Solr? Specifically, I have
a User field and a DateTime field. I need to know how many Documents
match each User for each one-hour period in the past 24 hours. That
is, 16 Users * 24 time periods = 384 values to return.
I could run 16 queries and facet on DateTime, or 24 queries and facet
on User. However, if there is a way to facet the facets, then I would
love to know. Thanks!
--
Dotan Cohen
http://gibberish.co.il
http://what-is-what.com
Re: Faceting Facets
Posted by Dotan Cohen <do...@gmail.com>.
On Mon, Sep 3, 2012 at 6:07 PM, Tanguy Moal <ta...@gmail.com> wrote:
> I think it's not possible to combine pivots with facet queries, nor with
> facet ranges (or facet dates), please someone correct me if I'm wrong...
>
> I think only "standard" fields are "pivotable" :)
>
> That said, if you always use the same ranges for your DateTime field, you
> *could* have a "string" version of the time field that only outputs the
> hour of the day of the date contained in your time field, and then you'll
> be able to use facet.pivots with those two text fields.
>
> You could still use the original date time field to constrain the results
> set to return docs within the last 24 hours...
>
> Would that make sense to you ?
>
I think that I understand you!
Actually, the DateTime is currently being stored as a UNIX timestamp
for compatibility with other software. I had planned on converting it
all over to the internal Solr Datetime type, but I now see that I
should leave it as a timestamp.
Thanks.
--
Dotan Cohen
http://gibberish.co.il
http://what-is-what.com
Re: Faceting Facets
Posted by Tanguy Moal <ta...@gmail.com>.
I think it's not possible to combine pivots with facet queries, nor with
facet ranges (or facet dates), please someone correct me if I'm wrong...
I think only "standard" fields are "pivotable" :)
That said, if you always use the same ranges for your DateTime field, you
*could* have a "string" version of the time field that only outputs the
hour of the day of the date contained in your time field, and then you'll
be able to use facet.pivots with those two text fields.
You could still use the original date time field to constrain the results
set to return docs within the last 24 hours...
Would that make sense to you ?
--
Tanguy
2012/9/3 Alexey Serba <as...@gmail.com>
>
> http://wiki.apache.org/solr/SimpleFacetParameters#Pivot_.28ie_Decision_Tree.29_Faceting
>
> On Mon, Sep 3, 2012 at 6:38 PM, Dotan Cohen <do...@gmail.com> wrote:
> > Is there any way to nest facet searches in Solr? Specifically, I have
> > a User field and a DateTime field. I need to know how many Documents
> > match each User for each one-hour period in the past 24 hours. That
> > is, 16 Users * 24 time periods = 384 values to return.
> >
> > I could run 16 queries and facet on DateTime, or 24 queries and facet
> > on User. However, if there is a way to facet the facets, then I would
> > love to know. Thanks!
> >
> > --
> > Dotan Cohen
> >
> > http://gibberish.co.il
> > http://what-is-what.com
>
Re: Faceting Facets
Posted by Dotan Cohen <do...@gmail.com>.
On Mon, Sep 3, 2012 at 5:50 PM, Alexey Serba <as...@gmail.com> wrote:
> http://wiki.apache.org/solr/SimpleFacetParameters#Pivot_.28ie_Decision_Tree.29_Faceting
>
Thank you, that does seem to be only available on Solr 4.0. Luckily,
we're using Websolr so upgrading is rather easy!
Thanks!
--
Dotan Cohen
http://gibberish.co.il
http://what-is-what.com
Re: Faceting Facets
Posted by Alexey Serba <as...@gmail.com>.
http://wiki.apache.org/solr/SimpleFacetParameters#Pivot_.28ie_Decision_Tree.29_Faceting
On Mon, Sep 3, 2012 at 6:38 PM, Dotan Cohen <do...@gmail.com> wrote:
> Is there any way to nest facet searches in Solr? Specifically, I have
> a User field and a DateTime field. I need to know how many Documents
> match each User for each one-hour period in the past 24 hours. That
> is, 16 Users * 24 time periods = 384 values to return.
>
> I could run 16 queries and facet on DateTime, or 24 queries and facet
> on User. However, if there is a way to facet the facets, then I would
> love to know. Thanks!
>
> --
> Dotan Cohen
>
> http://gibberish.co.il
> http://what-is-what.com