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 Eric Grobler <im...@googlemail.com> on 2010/07/22 17:39:45 UTC

Tree Faceting in Solr 1.4

Hi Solr Community

If I have:
COUNTRY CITY
Germany Berlin
Germany Hamburg
Spain   Madrid

Can I do faceting like:
Germany
  Berlin
  Hamburg
Spain
  Madrid

I tried to apply SOLR-792 to the current trunk but it does not seem to be
compatible.
Maybe there is a similar feature existing in the latest builds?

Thanks & Regards
Eric

RE: Tree Faceting in Solr 1.4

Posted by Jonathan Rochkind <ro...@jhu.edu>.
> I am keeping the id-to-name lookups in SOLR though, I just use some
> "lookup fields" where I put id and name into one field, separated by
> some fixed delimiter, e.g.
> "134982__Some name I am going to lookup later"
> The separator here would be two underscores ("__").
> So I can query for that lookup field, extract id and name and store them
> into an array or something to loop them up in my (PHP) frontend.

Interesting, thanks. Do you use a "prefix" query, then, to find that value?

Still confused thinking about how this would work. Each of your documents has only one ID? 

In my case, its more like the geographic hieararchical stuff this thread began with. The ID is not the documents' ID, it's the ID of essentially a "facet" value, which can be multi-valued (or maybe even hierarchical). 

  Document X:  
     * United State
     * China
  Document Y
     * China
     * Russia

If we turn those actual values into "ID__label" strings... it gets confusing how to query for them. ESPECIALLY if we try to introduce the hierarchy into it. 

Document X:
    * 1234__United States/677_Michigan/987_Detroit

I think actually trying to store things like that would break either of the techniques in the wiki page about hierarchical facetting. 

Maybe an external store is really the only way to go that doesn't turn into a mess. 
   

Re: Tree Faceting in Solr 1.4

Posted by Stefan Moises <mo...@shoptimax.de>.
Hi Jonathan,

I too am using IDs instead of names, one reason being that URLs are 
easier to read and they are more safe, because special chars in names 
could break the URLs etc.
I am keeping the id-to-name lookups in SOLR though, I just use some 
"lookup fields" where I put id and name into one field, separated by 
some fixed delimiter, e.g.
"134982__Some name I am going to lookup later"
The separator here would be two underscores ("__").
So I can query for that lookup field, extract id and name and store them 
into an array or something to loop them up in my (PHP) frontend.
If you don't have too many different values you could also map 
id-to-name in a simple text file (as suggested in the SOLR book e.g.)

Cheers,
Stefan


>> Perhaps completely unnessecery when you have a controlled domain, but I
>> meant to use ids for places instead of names, because names will quickly
>> become ambiguous, e.g.: there are numerous different places over the world
>> called washington, etc.
>>      
> This is related to something I've been thinking about. Okay, say you use ID's instead of names. Now, you've got to translate those ID's to names before you display them, of course.
>
> One way to do that would be to keep the id-to-name lookup in some non-solr store (rdbms, or non-sql store)
>
> Is that what you'd do? Is there any non-crazy way to do that without an external store, just with solr?  Any way to do it with term payloads? Anything else?
>
> Jonathan
>    

-- 
*******************************************
Stefan Moises
Senior Softwareentwickler

shoptimax GmbH
Guntherstraße 45 a
90461 Nürnberg
Amtsgericht Nürnberg HRB 21703
GF Friedrich Schreieck

Tel.: 0911/25566-25
Fax:  0911/25566-29
moises@shoptimax.de
http://www.shoptimax.de
*******************************************


Re: Tree Faceting in Solr 1.4

Posted by Geert-Jan Brits <gb...@gmail.com>.
I believe we use an in-process weakhashmap to store the id-name
relationship. It's not that we're talking billions of values here.
For anything more mem-intensive we use no-sql (tokyo tyrant through
memcached protocol at the moment)

2010/7/24 Jonathan Rochkind <ro...@jhu.edu>

> > Perhaps completely unnessecery when you have a controlled domain, but I
> > meant to use ids for places instead of names, because names will quickly
> > become ambiguous, e.g.: there are numerous different places over the
> world
> > called washington, etc.
>
> This is related to something I've been thinking about. Okay, say you use
> ID's instead of names. Now, you've got to translate those ID's to names
> before you display them, of course.
>
> One way to do that would be to keep the id-to-name lookup in some non-solr
> store (rdbms, or non-sql store)
>
> Is that what you'd do? Is there any non-crazy way to do that without an
> external store, just with solr?  Any way to do it with term payloads?
> Anything else?
>
> Jonathan

RE: Tree Faceting in Solr 1.4

Posted by Jonathan Rochkind <ro...@jhu.edu>.
> Perhaps completely unnessecery when you have a controlled domain, but I
> meant to use ids for places instead of names, because names will quickly
> become ambiguous, e.g.: there are numerous different places over the world
> called washington, etc.

This is related to something I've been thinking about. Okay, say you use ID's instead of names. Now, you've got to translate those ID's to names before you display them, of course. 

One way to do that would be to keep the id-to-name lookup in some non-solr store (rdbms, or non-sql store)

Is that what you'd do? Is there any non-crazy way to do that without an external store, just with solr?  Any way to do it with term payloads? Anything else?

Jonathan

Re: Tree Faceting in Solr 1.4

Posted by Geert-Jan Brits <gb...@gmail.com>.
Perhaps completely unnessecery when you have a controlled domain, but I
meant to use ids for places instead of names, because names will quickly
become ambiguous, e.g.: there are numerous different places over the world
called washington, etc.

2010/7/24 SR <r....@gmail.com>

> Hi Geert-Jan,
>
> What did you mean by this:
>
> > Also, just a suggestion, consider using id's instead of names for
> filtering;
>
> Thanks,
> -S

Re: Tree Faceting in Solr 1.4

Posted by SR <r....@gmail.com>.
Hi Geert-Jan,

What did you mean by this: 

> Also, just a suggestion, consider using id's instead of names for filtering;

Thanks,
-S

Re: Tree Faceting in Solr 1.4

Posted by Geert-Jan Brits <gb...@gmail.com>.
>If I am doing
>facet=on & facet.field={!ex=State}State & fq={!tag=State}State:Karnataka

>All it gives me is Facets on state excluding only that filter query.. But i
>was not able to do same on third level ..Like  facet.field= Give me the
>counts of  cities also in state Karantaka..
>Let me know solution for this...

This looks like regular faceting to me.

1. Showing citycounts given state
facet=on&fq=State:Karnataka&facet.field=city

2. showing statecounts given country (similar to 1)
facet=on&fq=Country:India&facet.field=state

3. showing city and state counts given country:
facet=on&fq=Country:India&facet.field=state&facet.field=city

4. showing city counts given state + all other states not filtered by
current state (
http://wiki.apache.org/solr/SimpleFacetParameters#Tagging_and_excluding_Filters
)
facet=on&fq={!tag=State}state:Karnataka&facet.field={!ex=State}state&facet.field=city

5. showing state + city counts given country + all other countries not
filtered by current country
(s<http://wiki.apache.org/solr/SimpleFacetParameters#Tagging_and_excluding_Filters>imilar
to 4)
facet=on&fq={!tag=country}country:India&facet.field={!ex=country}country&facet.field=city&facet.field=state

etc.

This has nothing to do with "Hierarchical faceting" as described in SOLR-792
btw, although I understand the possible confusion as County > state > city
can obvisouly be seen as some sort of hierarchy.  The first part of your
question seemed to be more about Hierarchial faceting as per SOLR-792, but I
couldn't quite distill a question from that part.

Also, just a suggestion, consider using id's instead of names for filtering;
you will get burned sooner or later otherwise.

HTH,

Geert-Jan



2010/7/23 rajini maski <ra...@gmail.com>

> I am also looking out for same feature in Solr and very keen to know
> whether
> it supports this feature of tree faceting... Or we are forced to index in
> tree faceting format....like
>
> 1/2/3/4
> 1/2/3
> 1/2
> 1
>
> In-case of multilevel faceting it will give only 2 level tree facet is what
> i found..
>
> If i give query as : country India and state Karnataka and city
> bangalore...All what i want is a facet count  1) for condition above. 2)
> The
> number of states in that Country 3) the number of cities in that state ...
>
> Like => Country: India ,State:Karnataka , City: Bangalore <1>
>
>             State:Karnataka
>                      Kerla
>                      Tamilnadu
>                      Andra Pradesh...and so on....
>
>             City:  Mysore
>                      Hubli
>                      Mangalore
>                      Coorg and so on...
>
>
> If I am doing
> facet=on & facet.field={!ex=State}State & fq={!tag=State}State:Karnataka
>
> All it gives me is Facets on state excluding only that filter query.. But i
> was not able to do same on third level ..Like  facet.field= Give me the
> counts of  cities also in state Karantaka..
> Let me know solution for this...
>
> Regards,
> Rajani Maski
>
>
>
>
>
> On Thu, Jul 22, 2010 at 10:13 PM, Eric Grobler <impalaherd@googlemail.com
> >wrote:
>
> > Thank you for the link.
> >
> > I was not aware of the multifaceting syntax - this will enable me to run
> 1
> > less query on the main page!
> >
> > However this is not a tree faceting feature.
> >
> > Thanks
> > Eric
> >
> >
> >
> >
> > On Thu, Jul 22, 2010 at 4:51 PM, SR <r....@gmail.com> wrote:
> >
> > > Perhaps the following article can help:
> > >
> >
> http://www.craftyfella.com/2010/01/faceting-and-multifaceting-syntax-in.html
> > >
> > > -S
> > >
> > >
> > > On Jul 22, 2010, at 5:39 PM, Eric Grobler wrote:
> > >
> > > > Hi Solr Community
> > > >
> > > > If I have:
> > > > COUNTRY CITY
> > > > Germany Berlin
> > > > Germany Hamburg
> > > > Spain   Madrid
> > > >
> > > > Can I do faceting like:
> > > > Germany
> > > >  Berlin
> > > >  Hamburg
> > > > Spain
> > > >  Madrid
> > > >
> > > > I tried to apply SOLR-792 to the current trunk but it does not seem
> to
> > be
> > > > compatible.
> > > > Maybe there is a similar feature existing in the latest builds?
> > > >
> > > > Thanks & Regards
> > > > Eric
> > >
> > >
> >
>

Re: Tree Faceting in Solr 1.4

Posted by Eric Grobler <im...@googlemail.com>.
Hi Erik,

Thanks for the fast update :-)
I will try it soon.

Regards
Eric

On Fri, Jul 23, 2010 at 2:37 PM, Erik Hatcher <er...@gmail.com>wrote:

> I've update the SOLR-792 patch to apply to trunk (using the solr/ directory
> as the root still, not the higher-level trunk/).
>
> This one I think is an important one that I'd love to see eventually part
> of Solr built-in, but the TODO's in TreeFacetComponent ought to be taken
> care of first, to generalize this to N fields levels and maybe some other
> must/nice-to-haves.
>
>        Erik
>
>
>
> On Jul 23, 2010, at 3:45 AM, Eric Grobler wrote:
>
>  Thanks I saw the article,
>>
>> As far as I can tell the trunk archives only go back to the middle of
>> March
>> and the 2 patches are from the beginning of the year.
>>
>> Thus:
>> *These approaches can be tried out easily using a single set of sample
>> data
>> and the Solr example application (assumes current trunk codebase and
>> latest
>> patches posted to the respective issues). **
>>
>> **Is a bit of an over-statement!**
>> *
>> Regards
>> Eric*
>> *
>> On Fri, Jul 23, 2010 at 6:22 AM, Jonathan Rochkind <ro...@jhu.edu>
>> wrote:
>>
>>  Solr does not, yet, at least not simply, as far as I know, but there are
>>> ideas and some JIRA's with maybe some patches:
>>>
>>> http://wiki.apache.org/solr/HierarchicalFaceting
>>>
>>>
>>> ________________________________________
>>> From: rajini maski [rajinimaski@gmail.com]
>>> Sent: Friday, July 23, 2010 12:34 AM
>>> To: solr-user@lucene.apache.org
>>> Subject: Re: Tree Faceting in Solr 1.4
>>>
>>> I am also looking out for same feature in Solr and very keen to know
>>> whether
>>> it supports this feature of tree faceting... Or we are forced to index in
>>> tree faceting format....like
>>>
>>> 1/2/3/4
>>> 1/2/3
>>> 1/2
>>> 1
>>>
>>> In-case of multilevel faceting it will give only 2 level tree facet is
>>> what
>>> i found..
>>>
>>> If i give query as : country India and state Karnataka and city
>>> bangalore...All what i want is a facet count  1) for condition above. 2)
>>> The
>>> number of states in that Country 3) the number of cities in that state
>>> ...
>>>
>>> Like => Country: India ,State:Karnataka , City: Bangalore <1>
>>>
>>>           State:Karnataka
>>>                    Kerla
>>>                    Tamilnadu
>>>                    Andra Pradesh...and so on....
>>>
>>>           City:  Mysore
>>>                    Hubli
>>>                    Mangalore
>>>                    Coorg and so on...
>>>
>>>
>>> If I am doing
>>> facet=on & facet.field={!ex=State}State & fq={!tag=State}State:Karnataka
>>>
>>> All it gives me is Facets on state excluding only that filter query.. But
>>> i
>>> was not able to do same on third level ..Like  facet.field= Give me the
>>> counts of  cities also in state Karantaka..
>>> Let me know solution for this...
>>>
>>> Regards,
>>> Rajani Maski
>>>
>>>
>>>
>>>
>>>
>>> On Thu, Jul 22, 2010 at 10:13 PM, Eric Grobler <
>>> impalaherd@googlemail.com
>>>
>>>> wrote:
>>>>
>>>
>>>  Thank you for the link.
>>>>
>>>> I was not aware of the multifaceting syntax - this will enable me to run
>>>>
>>> 1
>>>
>>>> less query on the main page!
>>>>
>>>> However this is not a tree faceting feature.
>>>>
>>>> Thanks
>>>> Eric
>>>>
>>>>
>>>>
>>>>
>>>> On Thu, Jul 22, 2010 at 4:51 PM, SR <r....@gmail.com> wrote:
>>>>
>>>>  Perhaps the following article can help:
>>>>>
>>>>>
>>>>
>>> http://www.craftyfella.com/2010/01/faceting-and-multifaceting-syntax-in.html
>>>
>>>>
>>>>> -S
>>>>>
>>>>>
>>>>> On Jul 22, 2010, at 5:39 PM, Eric Grobler wrote:
>>>>>
>>>>>  Hi Solr Community
>>>>>>
>>>>>> If I have:
>>>>>> COUNTRY CITY
>>>>>> Germany Berlin
>>>>>> Germany Hamburg
>>>>>> Spain   Madrid
>>>>>>
>>>>>> Can I do faceting like:
>>>>>> Germany
>>>>>> Berlin
>>>>>> Hamburg
>>>>>> Spain
>>>>>> Madrid
>>>>>>
>>>>>> I tried to apply SOLR-792 to the current trunk but it does not seem
>>>>>>
>>>>> to
>>>
>>>> be
>>>>
>>>>> compatible.
>>>>>> Maybe there is a similar feature existing in the latest builds?
>>>>>>
>>>>>> Thanks & Regards
>>>>>> Eric
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>
>

Re: Tree Faceting in Solr 1.4

Posted by Eric Grobler <im...@googlemail.com>.
Hi Erik,

Thanks, -p1 vs -p0 must then be the issue.

On Thu, Jul 29, 2010 at 2:32 PM, Erik Hatcher <er...@gmail.com>wrote:

> I use patch -p0, not -p1.  But otherwise that looks the same as what I do.
>
> Can you try again with -p0 and see if it's still an issue?  (or have you
> gotten past this and I've just not caught up with mails yet?)
>
>        Erik
>
>
> On Jul 23, 2010, at 10:26 AM, Eric Grobler wrote:
>
>  Hi Erik,
>>
>> I must be doing something wrong :-(
>> I took:
>> svn co https://svn.apache.org/repos/asf/lucene/dev/trunk  mytest
>>  then i copied SOLR-792.path to folder /mytest/solr
>> then i ran:
>>  patch -p1 < SOLR-792.patch
>>
>> but I get "can't find file to patch at input line 5"
>> Is this the correct trunk and patch command?
>>
>> However if I just manually
>>  - copy TreeFacetComponent.java to folder
>> solr/src/java/org/apache/solr/handler/component
>>  - add SimpleOrderedMap<SimpleOrderedMap> _treeFacets; to
>> ResponseBuilder.java
>>  - and make the changes to solrconfig.xml
>> I am able to compile and run your test :-)
>>
>> Regards
>> Eric
>>
>>
>> On Fri, Jul 23, 2010 at 2:37 PM, Erik Hatcher <erik.hatcher@gmail.com
>> >wrote:
>>
>>  I've update the SOLR-792 patch to apply to trunk (using the solr/
>>> directory
>>> as the root still, not the higher-level trunk/).
>>>
>>> This one I think is an important one that I'd love to see eventually part
>>> of Solr built-in, but the TODO's in TreeFacetComponent ought to be taken
>>> care of first, to generalize this to N fields levels and maybe some other
>>> must/nice-to-haves.
>>>
>>>      Erik
>>>
>>>
>>>
>>> On Jul 23, 2010, at 3:45 AM, Eric Grobler wrote:
>>>
>>> Thanks I saw the article,
>>>
>>>>
>>>> As far as I can tell the trunk archives only go back to the middle of
>>>> March
>>>> and the 2 patches are from the beginning of the year.
>>>>
>>>> Thus:
>>>> *These approaches can be tried out easily using a single set of sample
>>>> data
>>>> and the Solr example application (assumes current trunk codebase and
>>>> latest
>>>> patches posted to the respective issues). **
>>>>
>>>> **Is a bit of an over-statement!**
>>>> *
>>>> Regards
>>>> Eric*
>>>> *
>>>> On Fri, Jul 23, 2010 at 6:22 AM, Jonathan Rochkind <ro...@jhu.edu>
>>>> wrote:
>>>>
>>>> Solr does not, yet, at least not simply, as far as I know, but there are
>>>>
>>>>> ideas and some JIRA's with maybe some patches:
>>>>>
>>>>> http://wiki.apache.org/solr/HierarchicalFaceting
>>>>>
>>>>>
>>>>> ________________________________________
>>>>> From: rajini maski [rajinimaski@gmail.com]
>>>>> Sent: Friday, July 23, 2010 12:34 AM
>>>>> To: solr-user@lucene.apache.org
>>>>> Subject: Re: Tree Faceting in Solr 1.4
>>>>>
>>>>> I am also looking out for same feature in Solr and very keen to know
>>>>> whether
>>>>> it supports this feature of tree faceting... Or we are forced to index
>>>>> in
>>>>> tree faceting format....like
>>>>>
>>>>> 1/2/3/4
>>>>> 1/2/3
>>>>> 1/2
>>>>> 1
>>>>>
>>>>> In-case of multilevel faceting it will give only 2 level tree facet is
>>>>> what
>>>>> i found..
>>>>>
>>>>> If i give query as : country India and state Karnataka and city
>>>>> bangalore...All what i want is a facet count  1) for condition above.
>>>>> 2)
>>>>> The
>>>>> number of states in that Country 3) the number of cities in that state
>>>>> ...
>>>>>
>>>>> Like => Country: India ,State:Karnataka , City: Bangalore <1>
>>>>>
>>>>>         State:Karnataka
>>>>>                  Kerla
>>>>>                  Tamilnadu
>>>>>                  Andra Pradesh...and so on....
>>>>>
>>>>>         City:  Mysore
>>>>>                  Hubli
>>>>>                  Mangalore
>>>>>                  Coorg and so on...
>>>>>
>>>>>
>>>>> If I am doing
>>>>> facet=on & facet.field={!ex=State}State &
>>>>> fq={!tag=State}State:Karnataka
>>>>>
>>>>> All it gives me is Facets on state excluding only that filter query..
>>>>> But
>>>>> i
>>>>> was not able to do same on third level ..Like  facet.field= Give me the
>>>>> counts of  cities also in state Karantaka..
>>>>> Let me know solution for this...
>>>>>
>>>>> Regards,
>>>>> Rajani Maski
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Jul 22, 2010 at 10:13 PM, Eric Grobler <
>>>>> impalaherd@googlemail.com
>>>>>
>>>>>  wrote:
>>>>>>
>>>>>>
>>>>> Thank you for the link.
>>>>>
>>>>>>
>>>>>> I was not aware of the multifaceting syntax - this will enable me to
>>>>>> run
>>>>>>
>>>>>>  1
>>>>>
>>>>>  less query on the main page!
>>>>>>
>>>>>> However this is not a tree faceting feature.
>>>>>>
>>>>>> Thanks
>>>>>> Eric
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Thu, Jul 22, 2010 at 4:51 PM, SR <r....@gmail.com> wrote:
>>>>>>
>>>>>> Perhaps the following article can help:
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>> http://www.craftyfella.com/2010/01/faceting-and-multifaceting-syntax-in.html
>>>>>
>>>>>
>>>>>>  -S
>>>>>>>
>>>>>>>
>>>>>>> On Jul 22, 2010, at 5:39 PM, Eric Grobler wrote:
>>>>>>>
>>>>>>> Hi Solr Community
>>>>>>>
>>>>>>>>
>>>>>>>> If I have:
>>>>>>>> COUNTRY CITY
>>>>>>>> Germany Berlin
>>>>>>>> Germany Hamburg
>>>>>>>> Spain   Madrid
>>>>>>>>
>>>>>>>> Can I do faceting like:
>>>>>>>> Germany
>>>>>>>> Berlin
>>>>>>>> Hamburg
>>>>>>>> Spain
>>>>>>>> Madrid
>>>>>>>>
>>>>>>>> I tried to apply SOLR-792 to the current trunk but it does not seem
>>>>>>>>
>>>>>>>>  to
>>>>>>>
>>>>>>
>>>>>  be
>>>>>>
>>>>>>  compatible.
>>>>>>>
>>>>>>>> Maybe there is a similar feature existing in the latest builds?
>>>>>>>>
>>>>>>>> Thanks & Regards
>>>>>>>> Eric
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>
>

Re: Tree Faceting in Solr 1.4

Posted by Erik Hatcher <er...@gmail.com>.
I use patch -p0, not -p1.  But otherwise that looks the same as what I  
do.

Can you try again with -p0 and see if it's still an issue?  (or have  
you gotten past this and I've just not caught up with mails yet?)

	Erik

On Jul 23, 2010, at 10:26 AM, Eric Grobler wrote:

> Hi Erik,
>
> I must be doing something wrong :-(
> I took:
> svn co https://svn.apache.org/repos/asf/lucene/dev/trunk  mytest
>  then i copied SOLR-792.path to folder /mytest/solr
> then i ran:
>  patch -p1 < SOLR-792.patch
>
> but I get "can't find file to patch at input line 5"
> Is this the correct trunk and patch command?
>
> However if I just manually
>  - copy TreeFacetComponent.java to folder
> solr/src/java/org/apache/solr/handler/component
>  - add SimpleOrderedMap<SimpleOrderedMap> _treeFacets; to
> ResponseBuilder.java
>  - and make the changes to solrconfig.xml
> I am able to compile and run your test :-)
>
> Regards
> Eric
>
>
> On Fri, Jul 23, 2010 at 2:37 PM, Erik Hatcher  
> <er...@gmail.com>wrote:
>
>> I've update the SOLR-792 patch to apply to trunk (using the solr/  
>> directory
>> as the root still, not the higher-level trunk/).
>>
>> This one I think is an important one that I'd love to see  
>> eventually part
>> of Solr built-in, but the TODO's in TreeFacetComponent ought to be  
>> taken
>> care of first, to generalize this to N fields levels and maybe some  
>> other
>> must/nice-to-haves.
>>
>>       Erik
>>
>>
>>
>> On Jul 23, 2010, at 3:45 AM, Eric Grobler wrote:
>>
>> Thanks I saw the article,
>>>
>>> As far as I can tell the trunk archives only go back to the middle  
>>> of
>>> March
>>> and the 2 patches are from the beginning of the year.
>>>
>>> Thus:
>>> *These approaches can be tried out easily using a single set of  
>>> sample
>>> data
>>> and the Solr example application (assumes current trunk codebase and
>>> latest
>>> patches posted to the respective issues). **
>>>
>>> **Is a bit of an over-statement!**
>>> *
>>> Regards
>>> Eric*
>>> *
>>> On Fri, Jul 23, 2010 at 6:22 AM, Jonathan Rochkind  
>>> <ro...@jhu.edu>
>>> wrote:
>>>
>>> Solr does not, yet, at least not simply, as far as I know, but  
>>> there are
>>>> ideas and some JIRA's with maybe some patches:
>>>>
>>>> http://wiki.apache.org/solr/HierarchicalFaceting
>>>>
>>>>
>>>> ________________________________________
>>>> From: rajini maski [rajinimaski@gmail.com]
>>>> Sent: Friday, July 23, 2010 12:34 AM
>>>> To: solr-user@lucene.apache.org
>>>> Subject: Re: Tree Faceting in Solr 1.4
>>>>
>>>> I am also looking out for same feature in Solr and very keen to  
>>>> know
>>>> whether
>>>> it supports this feature of tree faceting... Or we are forced to  
>>>> index in
>>>> tree faceting format....like
>>>>
>>>> 1/2/3/4
>>>> 1/2/3
>>>> 1/2
>>>> 1
>>>>
>>>> In-case of multilevel faceting it will give only 2 level tree  
>>>> facet is
>>>> what
>>>> i found..
>>>>
>>>> If i give query as : country India and state Karnataka and city
>>>> bangalore...All what i want is a facet count  1) for condition  
>>>> above. 2)
>>>> The
>>>> number of states in that Country 3) the number of cities in that  
>>>> state
>>>> ...
>>>>
>>>> Like => Country: India ,State:Karnataka , City: Bangalore <1>
>>>>
>>>>          State:Karnataka
>>>>                   Kerla
>>>>                   Tamilnadu
>>>>                   Andra Pradesh...and so on....
>>>>
>>>>          City:  Mysore
>>>>                   Hubli
>>>>                   Mangalore
>>>>                   Coorg and so on...
>>>>
>>>>
>>>> If I am doing
>>>> facet=on & facet.field={!ex=State}State & fq={! 
>>>> tag=State}State:Karnataka
>>>>
>>>> All it gives me is Facets on state excluding only that filter  
>>>> query.. But
>>>> i
>>>> was not able to do same on third level ..Like  facet.field= Give  
>>>> me the
>>>> counts of  cities also in state Karantaka..
>>>> Let me know solution for this...
>>>>
>>>> Regards,
>>>> Rajani Maski
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Thu, Jul 22, 2010 at 10:13 PM, Eric Grobler <
>>>> impalaherd@googlemail.com
>>>>
>>>>> wrote:
>>>>>
>>>>
>>>> Thank you for the link.
>>>>>
>>>>> I was not aware of the multifaceting syntax - this will enable  
>>>>> me to run
>>>>>
>>>> 1
>>>>
>>>>> less query on the main page!
>>>>>
>>>>> However this is not a tree faceting feature.
>>>>>
>>>>> Thanks
>>>>> Eric
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Jul 22, 2010 at 4:51 PM, SR <r....@gmail.com> wrote:
>>>>>
>>>>> Perhaps the following article can help:
>>>>>>
>>>>>>
>>>>>
>>>> http://www.craftyfella.com/2010/01/faceting-and-multifaceting-syntax-in.html
>>>>
>>>>>
>>>>>> -S
>>>>>>
>>>>>>
>>>>>> On Jul 22, 2010, at 5:39 PM, Eric Grobler wrote:
>>>>>>
>>>>>> Hi Solr Community
>>>>>>>
>>>>>>> If I have:
>>>>>>> COUNTRY CITY
>>>>>>> Germany Berlin
>>>>>>> Germany Hamburg
>>>>>>> Spain   Madrid
>>>>>>>
>>>>>>> Can I do faceting like:
>>>>>>> Germany
>>>>>>> Berlin
>>>>>>> Hamburg
>>>>>>> Spain
>>>>>>> Madrid
>>>>>>>
>>>>>>> I tried to apply SOLR-792 to the current trunk but it does not  
>>>>>>> seem
>>>>>>>
>>>>>> to
>>>>
>>>>> be
>>>>>
>>>>>> compatible.
>>>>>>> Maybe there is a similar feature existing in the latest builds?
>>>>>>>
>>>>>>> Thanks & Regards
>>>>>>> Eric
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>


Re: Tree Faceting in Solr 1.4

Posted by Eric Grobler <im...@googlemail.com>.
Hi Erik,

I must be doing something wrong :-(
I took:
svn co https://svn.apache.org/repos/asf/lucene/dev/trunk  mytest
  then i copied SOLR-792.path to folder /mytest/solr
then i ran:
  patch -p1 < SOLR-792.patch

but I get "can't find file to patch at input line 5"
Is this the correct trunk and patch command?

However if I just manually
  - copy TreeFacetComponent.java to folder
solr/src/java/org/apache/solr/handler/component
  - add SimpleOrderedMap<SimpleOrderedMap> _treeFacets; to
ResponseBuilder.java
  - and make the changes to solrconfig.xml
I am able to compile and run your test :-)

Regards
Eric


On Fri, Jul 23, 2010 at 2:37 PM, Erik Hatcher <er...@gmail.com>wrote:

> I've update the SOLR-792 patch to apply to trunk (using the solr/ directory
> as the root still, not the higher-level trunk/).
>
> This one I think is an important one that I'd love to see eventually part
> of Solr built-in, but the TODO's in TreeFacetComponent ought to be taken
> care of first, to generalize this to N fields levels and maybe some other
> must/nice-to-haves.
>
>        Erik
>
>
>
> On Jul 23, 2010, at 3:45 AM, Eric Grobler wrote:
>
>  Thanks I saw the article,
>>
>> As far as I can tell the trunk archives only go back to the middle of
>> March
>> and the 2 patches are from the beginning of the year.
>>
>> Thus:
>> *These approaches can be tried out easily using a single set of sample
>> data
>> and the Solr example application (assumes current trunk codebase and
>> latest
>> patches posted to the respective issues). **
>>
>> **Is a bit of an over-statement!**
>> *
>> Regards
>> Eric*
>> *
>> On Fri, Jul 23, 2010 at 6:22 AM, Jonathan Rochkind <ro...@jhu.edu>
>> wrote:
>>
>>  Solr does not, yet, at least not simply, as far as I know, but there are
>>> ideas and some JIRA's with maybe some patches:
>>>
>>> http://wiki.apache.org/solr/HierarchicalFaceting
>>>
>>>
>>> ________________________________________
>>> From: rajini maski [rajinimaski@gmail.com]
>>> Sent: Friday, July 23, 2010 12:34 AM
>>> To: solr-user@lucene.apache.org
>>> Subject: Re: Tree Faceting in Solr 1.4
>>>
>>> I am also looking out for same feature in Solr and very keen to know
>>> whether
>>> it supports this feature of tree faceting... Or we are forced to index in
>>> tree faceting format....like
>>>
>>> 1/2/3/4
>>> 1/2/3
>>> 1/2
>>> 1
>>>
>>> In-case of multilevel faceting it will give only 2 level tree facet is
>>> what
>>> i found..
>>>
>>> If i give query as : country India and state Karnataka and city
>>> bangalore...All what i want is a facet count  1) for condition above. 2)
>>> The
>>> number of states in that Country 3) the number of cities in that state
>>> ...
>>>
>>> Like => Country: India ,State:Karnataka , City: Bangalore <1>
>>>
>>>           State:Karnataka
>>>                    Kerla
>>>                    Tamilnadu
>>>                    Andra Pradesh...and so on....
>>>
>>>           City:  Mysore
>>>                    Hubli
>>>                    Mangalore
>>>                    Coorg and so on...
>>>
>>>
>>> If I am doing
>>> facet=on & facet.field={!ex=State}State & fq={!tag=State}State:Karnataka
>>>
>>> All it gives me is Facets on state excluding only that filter query.. But
>>> i
>>> was not able to do same on third level ..Like  facet.field= Give me the
>>> counts of  cities also in state Karantaka..
>>> Let me know solution for this...
>>>
>>> Regards,
>>> Rajani Maski
>>>
>>>
>>>
>>>
>>>
>>> On Thu, Jul 22, 2010 at 10:13 PM, Eric Grobler <
>>> impalaherd@googlemail.com
>>>
>>>> wrote:
>>>>
>>>
>>>  Thank you for the link.
>>>>
>>>> I was not aware of the multifaceting syntax - this will enable me to run
>>>>
>>> 1
>>>
>>>> less query on the main page!
>>>>
>>>> However this is not a tree faceting feature.
>>>>
>>>> Thanks
>>>> Eric
>>>>
>>>>
>>>>
>>>>
>>>> On Thu, Jul 22, 2010 at 4:51 PM, SR <r....@gmail.com> wrote:
>>>>
>>>>  Perhaps the following article can help:
>>>>>
>>>>>
>>>>
>>> http://www.craftyfella.com/2010/01/faceting-and-multifaceting-syntax-in.html
>>>
>>>>
>>>>> -S
>>>>>
>>>>>
>>>>> On Jul 22, 2010, at 5:39 PM, Eric Grobler wrote:
>>>>>
>>>>>  Hi Solr Community
>>>>>>
>>>>>> If I have:
>>>>>> COUNTRY CITY
>>>>>> Germany Berlin
>>>>>> Germany Hamburg
>>>>>> Spain   Madrid
>>>>>>
>>>>>> Can I do faceting like:
>>>>>> Germany
>>>>>> Berlin
>>>>>> Hamburg
>>>>>> Spain
>>>>>> Madrid
>>>>>>
>>>>>> I tried to apply SOLR-792 to the current trunk but it does not seem
>>>>>>
>>>>> to
>>>
>>>> be
>>>>
>>>>> compatible.
>>>>>> Maybe there is a similar feature existing in the latest builds?
>>>>>>
>>>>>> Thanks & Regards
>>>>>> Eric
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>
>

Re: Tree Faceting in Solr 1.4

Posted by Erik Hatcher <er...@gmail.com>.
I've update the SOLR-792 patch to apply to trunk (using the solr/  
directory as the root still, not the higher-level trunk/).

This one I think is an important one that I'd love to see eventually  
part of Solr built-in, but the TODO's in TreeFacetComponent ought to  
be taken care of first, to generalize this to N fields levels and  
maybe some other must/nice-to-haves.

	Erik


On Jul 23, 2010, at 3:45 AM, Eric Grobler wrote:

> Thanks I saw the article,
>
> As far as I can tell the trunk archives only go back to the middle  
> of March
> and the 2 patches are from the beginning of the year.
>
> Thus:
> *These approaches can be tried out easily using a single set of  
> sample data
> and the Solr example application (assumes current trunk codebase and  
> latest
> patches posted to the respective issues). **
>
> **Is a bit of an over-statement!**
> *
> Regards
> Eric*
> *
> On Fri, Jul 23, 2010 at 6:22 AM, Jonathan Rochkind  
> <ro...@jhu.edu> wrote:
>
>> Solr does not, yet, at least not simply, as far as I know, but  
>> there are
>> ideas and some JIRA's with maybe some patches:
>>
>> http://wiki.apache.org/solr/HierarchicalFaceting
>>
>>
>> ________________________________________
>> From: rajini maski [rajinimaski@gmail.com]
>> Sent: Friday, July 23, 2010 12:34 AM
>> To: solr-user@lucene.apache.org
>> Subject: Re: Tree Faceting in Solr 1.4
>>
>> I am also looking out for same feature in Solr and very keen to know
>> whether
>> it supports this feature of tree faceting... Or we are forced to  
>> index in
>> tree faceting format....like
>>
>> 1/2/3/4
>> 1/2/3
>> 1/2
>> 1
>>
>> In-case of multilevel faceting it will give only 2 level tree facet  
>> is what
>> i found..
>>
>> If i give query as : country India and state Karnataka and city
>> bangalore...All what i want is a facet count  1) for condition  
>> above. 2)
>> The
>> number of states in that Country 3) the number of cities in that  
>> state ...
>>
>> Like => Country: India ,State:Karnataka , City: Bangalore <1>
>>
>>            State:Karnataka
>>                     Kerla
>>                     Tamilnadu
>>                     Andra Pradesh...and so on....
>>
>>            City:  Mysore
>>                     Hubli
>>                     Mangalore
>>                     Coorg and so on...
>>
>>
>> If I am doing
>> facet=on & facet.field={!ex=State}State & fq={! 
>> tag=State}State:Karnataka
>>
>> All it gives me is Facets on state excluding only that filter  
>> query.. But i
>> was not able to do same on third level ..Like  facet.field= Give me  
>> the
>> counts of  cities also in state Karantaka..
>> Let me know solution for this...
>>
>> Regards,
>> Rajani Maski
>>
>>
>>
>>
>>
>> On Thu, Jul 22, 2010 at 10:13 PM, Eric Grobler <impalaherd@googlemail.com
>>> wrote:
>>
>>> Thank you for the link.
>>>
>>> I was not aware of the multifaceting syntax - this will enable me  
>>> to run
>> 1
>>> less query on the main page!
>>>
>>> However this is not a tree faceting feature.
>>>
>>> Thanks
>>> Eric
>>>
>>>
>>>
>>>
>>> On Thu, Jul 22, 2010 at 4:51 PM, SR <r....@gmail.com> wrote:
>>>
>>>> Perhaps the following article can help:
>>>>
>>>
>> http://www.craftyfella.com/2010/01/faceting-and-multifaceting-syntax-in.html
>>>>
>>>> -S
>>>>
>>>>
>>>> On Jul 22, 2010, at 5:39 PM, Eric Grobler wrote:
>>>>
>>>>> Hi Solr Community
>>>>>
>>>>> If I have:
>>>>> COUNTRY CITY
>>>>> Germany Berlin
>>>>> Germany Hamburg
>>>>> Spain   Madrid
>>>>>
>>>>> Can I do faceting like:
>>>>> Germany
>>>>> Berlin
>>>>> Hamburg
>>>>> Spain
>>>>> Madrid
>>>>>
>>>>> I tried to apply SOLR-792 to the current trunk but it does not  
>>>>> seem
>> to
>>> be
>>>>> compatible.
>>>>> Maybe there is a similar feature existing in the latest builds?
>>>>>
>>>>> Thanks & Regards
>>>>> Eric
>>>>
>>>>
>>>
>>


Re: Tree Faceting in Solr 1.4

Posted by Eric Grobler <im...@googlemail.com>.
Thanks I saw the article,

As far as I can tell the trunk archives only go back to the middle of March
and the 2 patches are from the beginning of the year.

Thus:
*These approaches can be tried out easily using a single set of sample data
and the Solr example application (assumes current trunk codebase and latest
patches posted to the respective issues). **

**Is a bit of an over-statement!**
*
Regards
Eric*
*
On Fri, Jul 23, 2010 at 6:22 AM, Jonathan Rochkind <ro...@jhu.edu> wrote:

> Solr does not, yet, at least not simply, as far as I know, but there are
> ideas and some JIRA's with maybe some patches:
>
> http://wiki.apache.org/solr/HierarchicalFaceting
>
>
> ________________________________________
> From: rajini maski [rajinimaski@gmail.com]
> Sent: Friday, July 23, 2010 12:34 AM
> To: solr-user@lucene.apache.org
> Subject: Re: Tree Faceting in Solr 1.4
>
> I am also looking out for same feature in Solr and very keen to know
> whether
> it supports this feature of tree faceting... Or we are forced to index in
> tree faceting format....like
>
> 1/2/3/4
> 1/2/3
> 1/2
> 1
>
> In-case of multilevel faceting it will give only 2 level tree facet is what
> i found..
>
> If i give query as : country India and state Karnataka and city
> bangalore...All what i want is a facet count  1) for condition above. 2)
> The
> number of states in that Country 3) the number of cities in that state ...
>
> Like => Country: India ,State:Karnataka , City: Bangalore <1>
>
>             State:Karnataka
>                      Kerla
>                      Tamilnadu
>                      Andra Pradesh...and so on....
>
>             City:  Mysore
>                      Hubli
>                      Mangalore
>                      Coorg and so on...
>
>
> If I am doing
> facet=on & facet.field={!ex=State}State & fq={!tag=State}State:Karnataka
>
> All it gives me is Facets on state excluding only that filter query.. But i
> was not able to do same on third level ..Like  facet.field= Give me the
> counts of  cities also in state Karantaka..
> Let me know solution for this...
>
> Regards,
> Rajani Maski
>
>
>
>
>
> On Thu, Jul 22, 2010 at 10:13 PM, Eric Grobler <impalaherd@googlemail.com
> >wrote:
>
> > Thank you for the link.
> >
> > I was not aware of the multifaceting syntax - this will enable me to run
> 1
> > less query on the main page!
> >
> > However this is not a tree faceting feature.
> >
> > Thanks
> > Eric
> >
> >
> >
> >
> > On Thu, Jul 22, 2010 at 4:51 PM, SR <r....@gmail.com> wrote:
> >
> > > Perhaps the following article can help:
> > >
> >
> http://www.craftyfella.com/2010/01/faceting-and-multifaceting-syntax-in.html
> > >
> > > -S
> > >
> > >
> > > On Jul 22, 2010, at 5:39 PM, Eric Grobler wrote:
> > >
> > > > Hi Solr Community
> > > >
> > > > If I have:
> > > > COUNTRY CITY
> > > > Germany Berlin
> > > > Germany Hamburg
> > > > Spain   Madrid
> > > >
> > > > Can I do faceting like:
> > > > Germany
> > > >  Berlin
> > > >  Hamburg
> > > > Spain
> > > >  Madrid
> > > >
> > > > I tried to apply SOLR-792 to the current trunk but it does not seem
> to
> > be
> > > > compatible.
> > > > Maybe there is a similar feature existing in the latest builds?
> > > >
> > > > Thanks & Regards
> > > > Eric
> > >
> > >
> >
>

RE: Tree Faceting in Solr 1.4

Posted by Jonathan Rochkind <ro...@jhu.edu>.
Solr does not, yet, at least not simply, as far as I know, but there are ideas and some JIRA's with maybe some patches:

http://wiki.apache.org/solr/HierarchicalFaceting


________________________________________
From: rajini maski [rajinimaski@gmail.com]
Sent: Friday, July 23, 2010 12:34 AM
To: solr-user@lucene.apache.org
Subject: Re: Tree Faceting in Solr 1.4

I am also looking out for same feature in Solr and very keen to know whether
it supports this feature of tree faceting... Or we are forced to index in
tree faceting format....like

1/2/3/4
1/2/3
1/2
1

In-case of multilevel faceting it will give only 2 level tree facet is what
i found..

If i give query as : country India and state Karnataka and city
bangalore...All what i want is a facet count  1) for condition above. 2) The
number of states in that Country 3) the number of cities in that state ...

Like => Country: India ,State:Karnataka , City: Bangalore <1>

             State:Karnataka
                      Kerla
                      Tamilnadu
                      Andra Pradesh...and so on....

             City:  Mysore
                      Hubli
                      Mangalore
                      Coorg and so on...


If I am doing
facet=on & facet.field={!ex=State}State & fq={!tag=State}State:Karnataka

All it gives me is Facets on state excluding only that filter query.. But i
was not able to do same on third level ..Like  facet.field= Give me the
counts of  cities also in state Karantaka..
Let me know solution for this...

Regards,
Rajani Maski





On Thu, Jul 22, 2010 at 10:13 PM, Eric Grobler <im...@googlemail.com>wrote:

> Thank you for the link.
>
> I was not aware of the multifaceting syntax - this will enable me to run 1
> less query on the main page!
>
> However this is not a tree faceting feature.
>
> Thanks
> Eric
>
>
>
>
> On Thu, Jul 22, 2010 at 4:51 PM, SR <r....@gmail.com> wrote:
>
> > Perhaps the following article can help:
> >
> http://www.craftyfella.com/2010/01/faceting-and-multifaceting-syntax-in.html
> >
> > -S
> >
> >
> > On Jul 22, 2010, at 5:39 PM, Eric Grobler wrote:
> >
> > > Hi Solr Community
> > >
> > > If I have:
> > > COUNTRY CITY
> > > Germany Berlin
> > > Germany Hamburg
> > > Spain   Madrid
> > >
> > > Can I do faceting like:
> > > Germany
> > >  Berlin
> > >  Hamburg
> > > Spain
> > >  Madrid
> > >
> > > I tried to apply SOLR-792 to the current trunk but it does not seem to
> be
> > > compatible.
> > > Maybe there is a similar feature existing in the latest builds?
> > >
> > > Thanks & Regards
> > > Eric
> >
> >
>

Re: Tree Faceting in Solr 1.4

Posted by rajini maski <ra...@gmail.com>.
I am also looking out for same feature in Solr and very keen to know whether
it supports this feature of tree faceting... Or we are forced to index in
tree faceting format....like

1/2/3/4
1/2/3
1/2
1

In-case of multilevel faceting it will give only 2 level tree facet is what
i found..

If i give query as : country India and state Karnataka and city
bangalore...All what i want is a facet count  1) for condition above. 2) The
number of states in that Country 3) the number of cities in that state ...

Like => Country: India ,State:Karnataka , City: Bangalore <1>

             State:Karnataka
                      Kerla
                      Tamilnadu
                      Andra Pradesh...and so on....

             City:  Mysore
                      Hubli
                      Mangalore
                      Coorg and so on...


If I am doing
facet=on & facet.field={!ex=State}State & fq={!tag=State}State:Karnataka

All it gives me is Facets on state excluding only that filter query.. But i
was not able to do same on third level ..Like  facet.field= Give me the
counts of  cities also in state Karantaka..
Let me know solution for this...

Regards,
Rajani Maski





On Thu, Jul 22, 2010 at 10:13 PM, Eric Grobler <im...@googlemail.com>wrote:

> Thank you for the link.
>
> I was not aware of the multifaceting syntax - this will enable me to run 1
> less query on the main page!
>
> However this is not a tree faceting feature.
>
> Thanks
> Eric
>
>
>
>
> On Thu, Jul 22, 2010 at 4:51 PM, SR <r....@gmail.com> wrote:
>
> > Perhaps the following article can help:
> >
> http://www.craftyfella.com/2010/01/faceting-and-multifaceting-syntax-in.html
> >
> > -S
> >
> >
> > On Jul 22, 2010, at 5:39 PM, Eric Grobler wrote:
> >
> > > Hi Solr Community
> > >
> > > If I have:
> > > COUNTRY CITY
> > > Germany Berlin
> > > Germany Hamburg
> > > Spain   Madrid
> > >
> > > Can I do faceting like:
> > > Germany
> > >  Berlin
> > >  Hamburg
> > > Spain
> > >  Madrid
> > >
> > > I tried to apply SOLR-792 to the current trunk but it does not seem to
> be
> > > compatible.
> > > Maybe there is a similar feature existing in the latest builds?
> > >
> > > Thanks & Regards
> > > Eric
> >
> >
>

Re: Tree Faceting in Solr 1.4

Posted by Eric Grobler <im...@googlemail.com>.
Thank you for the link.

I was not aware of the multifaceting syntax - this will enable me to run 1
less query on the main page!

However this is not a tree faceting feature.

Thanks
Eric




On Thu, Jul 22, 2010 at 4:51 PM, SR <r....@gmail.com> wrote:

> Perhaps the following article can help:
> http://www.craftyfella.com/2010/01/faceting-and-multifaceting-syntax-in.html
>
> -S
>
>
> On Jul 22, 2010, at 5:39 PM, Eric Grobler wrote:
>
> > Hi Solr Community
> >
> > If I have:
> > COUNTRY CITY
> > Germany Berlin
> > Germany Hamburg
> > Spain   Madrid
> >
> > Can I do faceting like:
> > Germany
> >  Berlin
> >  Hamburg
> > Spain
> >  Madrid
> >
> > I tried to apply SOLR-792 to the current trunk but it does not seem to be
> > compatible.
> > Maybe there is a similar feature existing in the latest builds?
> >
> > Thanks & Regards
> > Eric
>
>

Re: Tree Faceting in Solr 1.4

Posted by SR <r....@gmail.com>.
Perhaps the following article can help: http://www.craftyfella.com/2010/01/faceting-and-multifaceting-syntax-in.html

-S


On Jul 22, 2010, at 5:39 PM, Eric Grobler wrote:

> Hi Solr Community
> 
> If I have:
> COUNTRY CITY
> Germany Berlin
> Germany Hamburg
> Spain   Madrid
> 
> Can I do faceting like:
> Germany
>  Berlin
>  Hamburg
> Spain
>  Madrid
> 
> I tried to apply SOLR-792 to the current trunk but it does not seem to be
> compatible.
> Maybe there is a similar feature existing in the latest builds?
> 
> Thanks & Regards
> Eric