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 Mark Robinson <ma...@gmail.com> on 2016/04/27 18:13:16 UTC

Decide on facets from results

Hi,

If I don't have my facet list at query time, from the results can I select
some fields and by any means create a facet on them? ie after I get the
results I want to identify some fields as facets and send back facets for
them in the response.

A kind of very dynamic faceting based on the results!

Cld some one pls share their idea.

Thanks!
Anil.

Re: Decide on facets from results

Posted by Mark Robinson <ma...@gmail.com>.
Thanks for the suggestion Joe.
I will check on it.

Thanks!
Mark.

On Fri, Apr 29, 2016 at 11:56 AM, Joel Bernstein <jo...@gmail.com> wrote:

> Check out the new docs for the gatherNodes streaming expression. it Allows
> you to aggregate and then use those aggregates as input for another
> expression. You can even do this across collections.
>
> https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=62693238
>
> This is slated for Solr 6.1
>
>
>
> Joel Bernstein
> http://joelsolr.blogspot.com/
>
> On Fri, Apr 29, 2016 at 10:38 AM, Mark Robinson <ma...@gmail.com>
> wrote:
>
> > Thanks much everyone!
> > Appreciate your responses.
> >
> > Best,
> > Mark
> >
> > On Thu, Apr 28, 2016 at 10:52 AM, Jay Potharaju <js...@gmail.com>
> > wrote:
> >
> > > On the same lines as Erik suggested but using facet stats instead. you
> > can
> > > get stats on your facet fields in the first pass and then include the
> > > facets that you need in the second pass.
> > >
> > >
> > > > On Apr 27, 2016, at 1:21 PM, Mark Robinson <ma...@gmail.com>
> > > wrote:
> > > >
> > > > Thanks Eric!
> > > > So that will mean another call will be definitely required to SOLR
> with
> > > the
> > > > facets,  before the results can be send back (with the facet fields
> > being
> > > > derived traversing through the response).
> > > >
> > > > I was basically checking on whether in the "process" method (I
> believe
> > > > results will be accessed in the process method), we can dynamically
> > > > generate facets after traversing through the results and identifying
> > the
> > > > fields for faceting, using some aggregation function or so, without
> > > having
> > > > to make another call using facet=on&facet.field=<field_name>, before
> > the
> > > > response is send back to the user.
> > > >
> > > > Cheers!
> > > >
> > > > On Wed, Apr 27, 2016 at 2:27 PM, Erik Hatcher <
> erik.hatcher@gmail.com>
> > > > wrote:
> > > >
> > > >> Results will vary based on how you indexed those fields, but sure…
> > > >> &facet=on&facet.field=<field_name> - with sufficient RAM, lots of
> fun
> > > to be
> > > >> had!
> > > >>
> > > >> —
> > > >> Erik Hatcher, Senior Solutions Architect
> > > >> http://www.lucidworks.com <http://www.lucidworks.com/>
> > > >>
> > > >>
> > > >>
> > > >>>> On Apr 27, 2016, at 12:13 PM, Mark Robinson <
> > mark123learns@gmail.com>
> > > >>> wrote:
> > > >>>
> > > >>> Hi,
> > > >>>
> > > >>> If I don't have my facet list at query time, from the results can I
> > > >> select
> > > >>> some fields and by any means create a facet on them? ie after I get
> > the
> > > >>> results I want to identify some fields as facets and send back
> facets
> > > for
> > > >>> them in the response.
> > > >>>
> > > >>> A kind of very dynamic faceting based on the results!
> > > >>>
> > > >>> Cld some one pls share their idea.
> > > >>>
> > > >>> Thanks!
> > > >>> Anil.
> > > >>
> > > >>
> > >
> >
>

Re: Decide on facets from results

Posted by Joel Bernstein <jo...@gmail.com>.
Check out the new docs for the gatherNodes streaming expression. it Allows
you to aggregate and then use those aggregates as input for another
expression. You can even do this across collections.

https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=62693238

This is slated for Solr 6.1



Joel Bernstein
http://joelsolr.blogspot.com/

On Fri, Apr 29, 2016 at 10:38 AM, Mark Robinson <ma...@gmail.com>
wrote:

> Thanks much everyone!
> Appreciate your responses.
>
> Best,
> Mark
>
> On Thu, Apr 28, 2016 at 10:52 AM, Jay Potharaju <js...@gmail.com>
> wrote:
>
> > On the same lines as Erik suggested but using facet stats instead. you
> can
> > get stats on your facet fields in the first pass and then include the
> > facets that you need in the second pass.
> >
> >
> > > On Apr 27, 2016, at 1:21 PM, Mark Robinson <ma...@gmail.com>
> > wrote:
> > >
> > > Thanks Eric!
> > > So that will mean another call will be definitely required to SOLR with
> > the
> > > facets,  before the results can be send back (with the facet fields
> being
> > > derived traversing through the response).
> > >
> > > I was basically checking on whether in the "process" method (I believe
> > > results will be accessed in the process method), we can dynamically
> > > generate facets after traversing through the results and identifying
> the
> > > fields for faceting, using some aggregation function or so, without
> > having
> > > to make another call using facet=on&facet.field=<field_name>, before
> the
> > > response is send back to the user.
> > >
> > > Cheers!
> > >
> > > On Wed, Apr 27, 2016 at 2:27 PM, Erik Hatcher <er...@gmail.com>
> > > wrote:
> > >
> > >> Results will vary based on how you indexed those fields, but sure…
> > >> &facet=on&facet.field=<field_name> - with sufficient RAM, lots of fun
> > to be
> > >> had!
> > >>
> > >> —
> > >> Erik Hatcher, Senior Solutions Architect
> > >> http://www.lucidworks.com <http://www.lucidworks.com/>
> > >>
> > >>
> > >>
> > >>>> On Apr 27, 2016, at 12:13 PM, Mark Robinson <
> mark123learns@gmail.com>
> > >>> wrote:
> > >>>
> > >>> Hi,
> > >>>
> > >>> If I don't have my facet list at query time, from the results can I
> > >> select
> > >>> some fields and by any means create a facet on them? ie after I get
> the
> > >>> results I want to identify some fields as facets and send back facets
> > for
> > >>> them in the response.
> > >>>
> > >>> A kind of very dynamic faceting based on the results!
> > >>>
> > >>> Cld some one pls share their idea.
> > >>>
> > >>> Thanks!
> > >>> Anil.
> > >>
> > >>
> >
>

Re: Decide on facets from results

Posted by Mark Robinson <ma...@gmail.com>.
Thanks much everyone!
Appreciate your responses.

Best,
Mark

On Thu, Apr 28, 2016 at 10:52 AM, Jay Potharaju <js...@gmail.com>
wrote:

> On the same lines as Erik suggested but using facet stats instead. you can
> get stats on your facet fields in the first pass and then include the
> facets that you need in the second pass.
>
>
> > On Apr 27, 2016, at 1:21 PM, Mark Robinson <ma...@gmail.com>
> wrote:
> >
> > Thanks Eric!
> > So that will mean another call will be definitely required to SOLR with
> the
> > facets,  before the results can be send back (with the facet fields being
> > derived traversing through the response).
> >
> > I was basically checking on whether in the "process" method (I believe
> > results will be accessed in the process method), we can dynamically
> > generate facets after traversing through the results and identifying the
> > fields for faceting, using some aggregation function or so, without
> having
> > to make another call using facet=on&facet.field=<field_name>, before the
> > response is send back to the user.
> >
> > Cheers!
> >
> > On Wed, Apr 27, 2016 at 2:27 PM, Erik Hatcher <er...@gmail.com>
> > wrote:
> >
> >> Results will vary based on how you indexed those fields, but sure…
> >> &facet=on&facet.field=<field_name> - with sufficient RAM, lots of fun
> to be
> >> had!
> >>
> >> —
> >> Erik Hatcher, Senior Solutions Architect
> >> http://www.lucidworks.com <http://www.lucidworks.com/>
> >>
> >>
> >>
> >>>> On Apr 27, 2016, at 12:13 PM, Mark Robinson <ma...@gmail.com>
> >>> wrote:
> >>>
> >>> Hi,
> >>>
> >>> If I don't have my facet list at query time, from the results can I
> >> select
> >>> some fields and by any means create a facet on them? ie after I get the
> >>> results I want to identify some fields as facets and send back facets
> for
> >>> them in the response.
> >>>
> >>> A kind of very dynamic faceting based on the results!
> >>>
> >>> Cld some one pls share their idea.
> >>>
> >>> Thanks!
> >>> Anil.
> >>
> >>
>

Re: Decide on facets from results

Posted by Jay Potharaju <js...@gmail.com>.
On the same lines as Erik suggested but using facet stats instead. you can get stats on your facet fields in the first pass and then include the facets that you need in the second pass. 


> On Apr 27, 2016, at 1:21 PM, Mark Robinson <ma...@gmail.com> wrote:
> 
> Thanks Eric!
> So that will mean another call will be definitely required to SOLR with the
> facets,  before the results can be send back (with the facet fields being
> derived traversing through the response).
> 
> I was basically checking on whether in the "process" method (I believe
> results will be accessed in the process method), we can dynamically
> generate facets after traversing through the results and identifying the
> fields for faceting, using some aggregation function or so, without having
> to make another call using facet=on&facet.field=<field_name>, before the
> response is send back to the user.
> 
> Cheers!
> 
> On Wed, Apr 27, 2016 at 2:27 PM, Erik Hatcher <er...@gmail.com>
> wrote:
> 
>> Results will vary based on how you indexed those fields, but sure…
>> &facet=on&facet.field=<field_name> - with sufficient RAM, lots of fun to be
>> had!
>> 
>> —
>> Erik Hatcher, Senior Solutions Architect
>> http://www.lucidworks.com <http://www.lucidworks.com/>
>> 
>> 
>> 
>>>> On Apr 27, 2016, at 12:13 PM, Mark Robinson <ma...@gmail.com>
>>> wrote:
>>> 
>>> Hi,
>>> 
>>> If I don't have my facet list at query time, from the results can I
>> select
>>> some fields and by any means create a facet on them? ie after I get the
>>> results I want to identify some fields as facets and send back facets for
>>> them in the response.
>>> 
>>> A kind of very dynamic faceting based on the results!
>>> 
>>> Cld some one pls share their idea.
>>> 
>>> Thanks!
>>> Anil.
>> 
>> 

Re: Decide on facets from results

Posted by Georg Sorst <g....@findologic.com>.
Maybe you could do this:

   - MyFacetComponent extends FacetComponent
   - MyFacetComponent.process(): The results will be available at this
   point; look at them and decide which facets to fetch and return


Best,
Georg

Alexandre Rafalovitch <ar...@gmail.com> schrieb am Do., 28. Apr. 2016 um
06:44 Uhr:

> What about a custom component? Something similar to spell-checker? Add
> it last after everything else.
>
> It would have to be custom because you have some domain magic about
> how to decide what fields to facet on.
>
> Regards,
>   Alex.
> ----
> Newsletter and resources for Solr beginners and intermediates:
> http://www.solr-start.com/
>
>
> On 28 April 2016 at 11:45, Erick Erickson <er...@gmail.com> wrote:
> > Mark:
> >
> > You can do anything you want that Java can do ;). Smart-alec comments
> > aside, there's
> > no mechanism for doing this in Solr that I know of. The first thing
> > I'd do is try the two-query-
> > from-the-client approach to see if it was "fast enough".
> >
> > Best,
> > Erick (the other one)
> >
> > On Wed, Apr 27, 2016 at 1:21 PM, Mark Robinson <ma...@gmail.com>
> wrote:
> >> Thanks Eric!
> >> So that will mean another call will be definitely required to SOLR with
> the
> >> facets,  before the results can be send back (with the facet fields
> being
> >> derived traversing through the response).
> >>
> >> I was basically checking on whether in the "process" method (I believe
> >> results will be accessed in the process method), we can dynamically
> >> generate facets after traversing through the results and identifying the
> >> fields for faceting, using some aggregation function or so, without
> having
> >> to make another call using facet=on&facet.field=<field_name>, before the
> >> response is send back to the user.
> >>
> >> Cheers!
> >>
> >> On Wed, Apr 27, 2016 at 2:27 PM, Erik Hatcher <er...@gmail.com>
> >> wrote:
> >>
> >>> Results will vary based on how you indexed those fields, but sure…
> >>> &facet=on&facet.field=<field_name> - with sufficient RAM, lots of fun
> to be
> >>> had!
> >>>
> >>> —
> >>> Erik Hatcher, Senior Solutions Architect
> >>> http://www.lucidworks.com <http://www.lucidworks.com/>
> >>>
> >>>
> >>>
> >>> > On Apr 27, 2016, at 12:13 PM, Mark Robinson <mark123learns@gmail.com
> >
> >>> wrote:
> >>> >
> >>> > Hi,
> >>> >
> >>> > If I don't have my facet list at query time, from the results can I
> >>> select
> >>> > some fields and by any means create a facet on them? ie after I get
> the
> >>> > results I want to identify some fields as facets and send back
> facets for
> >>> > them in the response.
> >>> >
> >>> > A kind of very dynamic faceting based on the results!
> >>> >
> >>> > Cld some one pls share their idea.
> >>> >
> >>> > Thanks!
> >>> > Anil.
> >>>
> >>>
>
-- 
*Georg M. Sorst I CTO*
FINDOLOGIC GmbH



Jakob-Haringer-Str. 5a | 5020 Salzburg I T.: +43 662 456708
E.: g.sorst@findologic.com
www.findologic.com Folgen Sie uns auf: XING
<https://www.xing.com/profile/Georg_Sorst>facebook
<https://www.facebook.com/Findologic> Twitter
<https://twitter.com/findologic>

Wir sehen uns auf dem *Shopware Community Day in Ahaus am 20.05.2016!* Hier
<beratung@findologic.com?subject=Terminvereinbarung%20SCD> Termin
vereinbaren!
Wir sehen uns auf der* dmexco in Köln am 14.09. und 15.09.2016!* Hier
<beratung@findologic.com?subject=Terminvereinbarung%20dmexco> Termin
vereinbaren!

Re: Decide on facets from results

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
What about a custom component? Something similar to spell-checker? Add
it last after everything else.

It would have to be custom because you have some domain magic about
how to decide what fields to facet on.

Regards,
  Alex.
----
Newsletter and resources for Solr beginners and intermediates:
http://www.solr-start.com/


On 28 April 2016 at 11:45, Erick Erickson <er...@gmail.com> wrote:
> Mark:
>
> You can do anything you want that Java can do ;). Smart-alec comments
> aside, there's
> no mechanism for doing this in Solr that I know of. The first thing
> I'd do is try the two-query-
> from-the-client approach to see if it was "fast enough".
>
> Best,
> Erick (the other one)
>
> On Wed, Apr 27, 2016 at 1:21 PM, Mark Robinson <ma...@gmail.com> wrote:
>> Thanks Eric!
>> So that will mean another call will be definitely required to SOLR with the
>> facets,  before the results can be send back (with the facet fields being
>> derived traversing through the response).
>>
>> I was basically checking on whether in the "process" method (I believe
>> results will be accessed in the process method), we can dynamically
>> generate facets after traversing through the results and identifying the
>> fields for faceting, using some aggregation function or so, without having
>> to make another call using facet=on&facet.field=<field_name>, before the
>> response is send back to the user.
>>
>> Cheers!
>>
>> On Wed, Apr 27, 2016 at 2:27 PM, Erik Hatcher <er...@gmail.com>
>> wrote:
>>
>>> Results will vary based on how you indexed those fields, but sure…
>>> &facet=on&facet.field=<field_name> - with sufficient RAM, lots of fun to be
>>> had!
>>>
>>> —
>>> Erik Hatcher, Senior Solutions Architect
>>> http://www.lucidworks.com <http://www.lucidworks.com/>
>>>
>>>
>>>
>>> > On Apr 27, 2016, at 12:13 PM, Mark Robinson <ma...@gmail.com>
>>> wrote:
>>> >
>>> > Hi,
>>> >
>>> > If I don't have my facet list at query time, from the results can I
>>> select
>>> > some fields and by any means create a facet on them? ie after I get the
>>> > results I want to identify some fields as facets and send back facets for
>>> > them in the response.
>>> >
>>> > A kind of very dynamic faceting based on the results!
>>> >
>>> > Cld some one pls share their idea.
>>> >
>>> > Thanks!
>>> > Anil.
>>>
>>>

Re: Decide on facets from results

Posted by Erick Erickson <er...@gmail.com>.
Mark:

You can do anything you want that Java can do ;). Smart-alec comments
aside, there's
no mechanism for doing this in Solr that I know of. The first thing
I'd do is try the two-query-
from-the-client approach to see if it was "fast enough".

Best,
Erick (the other one)

On Wed, Apr 27, 2016 at 1:21 PM, Mark Robinson <ma...@gmail.com> wrote:
> Thanks Eric!
> So that will mean another call will be definitely required to SOLR with the
> facets,  before the results can be send back (with the facet fields being
> derived traversing through the response).
>
> I was basically checking on whether in the "process" method (I believe
> results will be accessed in the process method), we can dynamically
> generate facets after traversing through the results and identifying the
> fields for faceting, using some aggregation function or so, without having
> to make another call using facet=on&facet.field=<field_name>, before the
> response is send back to the user.
>
> Cheers!
>
> On Wed, Apr 27, 2016 at 2:27 PM, Erik Hatcher <er...@gmail.com>
> wrote:
>
>> Results will vary based on how you indexed those fields, but sure…
>> &facet=on&facet.field=<field_name> - with sufficient RAM, lots of fun to be
>> had!
>>
>> —
>> Erik Hatcher, Senior Solutions Architect
>> http://www.lucidworks.com <http://www.lucidworks.com/>
>>
>>
>>
>> > On Apr 27, 2016, at 12:13 PM, Mark Robinson <ma...@gmail.com>
>> wrote:
>> >
>> > Hi,
>> >
>> > If I don't have my facet list at query time, from the results can I
>> select
>> > some fields and by any means create a facet on them? ie after I get the
>> > results I want to identify some fields as facets and send back facets for
>> > them in the response.
>> >
>> > A kind of very dynamic faceting based on the results!
>> >
>> > Cld some one pls share their idea.
>> >
>> > Thanks!
>> > Anil.
>>
>>

Re: Decide on facets from results

Posted by Mark Robinson <ma...@gmail.com>.
Thanks Eric!
So that will mean another call will be definitely required to SOLR with the
facets,  before the results can be send back (with the facet fields being
derived traversing through the response).

I was basically checking on whether in the "process" method (I believe
results will be accessed in the process method), we can dynamically
generate facets after traversing through the results and identifying the
fields for faceting, using some aggregation function or so, without having
to make another call using facet=on&facet.field=<field_name>, before the
response is send back to the user.

Cheers!

On Wed, Apr 27, 2016 at 2:27 PM, Erik Hatcher <er...@gmail.com>
wrote:

> Results will vary based on how you indexed those fields, but sure…
> &facet=on&facet.field=<field_name> - with sufficient RAM, lots of fun to be
> had!
>
> —
> Erik Hatcher, Senior Solutions Architect
> http://www.lucidworks.com <http://www.lucidworks.com/>
>
>
>
> > On Apr 27, 2016, at 12:13 PM, Mark Robinson <ma...@gmail.com>
> wrote:
> >
> > Hi,
> >
> > If I don't have my facet list at query time, from the results can I
> select
> > some fields and by any means create a facet on them? ie after I get the
> > results I want to identify some fields as facets and send back facets for
> > them in the response.
> >
> > A kind of very dynamic faceting based on the results!
> >
> > Cld some one pls share their idea.
> >
> > Thanks!
> > Anil.
>
>

Re: Decide on facets from results

Posted by Erik Hatcher <er...@gmail.com>.
Results will vary based on how you indexed those fields, but sure… &facet=on&facet.field=<field_name> - with sufficient RAM, lots of fun to be had!

—
Erik Hatcher, Senior Solutions Architect
http://www.lucidworks.com <http://www.lucidworks.com/>



> On Apr 27, 2016, at 12:13 PM, Mark Robinson <ma...@gmail.com> wrote:
> 
> Hi,
> 
> If I don't have my facet list at query time, from the results can I select
> some fields and by any means create a facet on them? ie after I get the
> results I want to identify some fields as facets and send back facets for
> them in the response.
> 
> A kind of very dynamic faceting based on the results!
> 
> Cld some one pls share their idea.
> 
> Thanks!
> Anil.