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 Bernd Fehling <be...@uni-bielefeld.de> on 2013/05/15 08:52:46 UTC

error while switching from log4j back to slf4j with solr 4.3

Hi list,
while I can't get solr 4.3 with run-jetty-run up and running under eclipse
for debugging I tried to switch back to slf4j and followed
the steps of http://wiki.apache.org/solr/SolrLogging

Unfortunately eclipse bothers me with an error:
The import org.apache.log4j.AppenderSkeleton cannot be resolved
EventAppender.java	
/solr/core/src/java/org/apache/solr/logging/log4j	line 19	Java Problem

log4j-over-slf4j-1.6.6.jar has no class AppenderSkeleton as log4j-1.2.16.jar does.

Any idea how to solve this?

Or how to get log4j with run-jetty-run under eclipse back to work?

Regards,
Bernd


Re: Hierarchical Faceting

Posted by Chris Hostetter <ho...@fucit.org>.
: Subject: Hierarchical Faceting
: References:
:     <15...@uni-bielefeld.de>
: In-Reply-To:
:     <15...@uni-bielefeld.de>

https://people.apache.org/~hossman/#threadhijack
Thread Hijacking on Mailing Lists

When starting a new discussion on a mailing list, please do not reply to 
an existing message, instead start a fresh email.  Even if you change the 
subject line of your email, other mail headers still track which thread 
you replied to and your question is "hidden" in that thread and gets less 
attention.   It makes following discussions in the mailing list archives 
particularly difficult.



-Hoss

Re: Hierarchical Faceting

Posted by "varsha.yadav" <va...@orkash.com>.
Hi,

Thanks Upayavira . But still i am not getting results well.
I have been followinghttp://wiki.apache.org/solr/HierarchicalFaceting
I have hierarchical data for facet . Some documents also have multiple 
hierarchy. like :
Doc#1 London > UK > 51.5
Doc#2 UK >54.0
Doc#3 Indiana > United States > 40.0, London >UK>51.5
Doc#4 United States > 39.7, Washington > United States > 38.8

what can be optimal schema for indexing this data so that i get 
following result by solr query :
1) i want to retrieve hierarchical data count by facet pivot query . ex: 
facet.pivot=country,state
2) I want Lat values wrt every document in query output.ex: Doc#3 
40.0,51.5 . Doc#2 54.0
3) I get direct search query like country:"United states" . state 
:"Washington"

  I think through this i am able to express my requirement along with data .
Please tell me how can i put data index and retreive through query .
I check out solution which you provided me about 
PathHierarchyTokenizerFactory. But along with hierarachy i have to put 
data with name State,district,lat,lon etc. So that i can also access 
direct query on fields.

Thanks
Varsha

On 05/15/2013 10:32 PM, Upayavira wrote:
> Can't you use the PathHierarchyTokenizerFactory mentioned on that page?
> I think it is called descendent-path in the default schema. Won't that
> get you what you want?
>
>    UK/London/Covent Garden
> becomes
>    UK
>    UK/London
>    UK/London/Covent Garden
>
> and
>    India/Maharastra/Pune/Dapodi
> becomes
>    India
>    India/Maharastra
>    India/Maharastra/Pune
>    India/Maharastra/Pune/Dapodi
>
> These fields can be multivalued.
>
> Upayavira
>
> On Wed, May 15, 2013, at 12:29 PM, varsha.yadav wrote:
>> Hi
>>
>> I go through that but i want to index multiple location in single
>> document and a single location have multiple feature/attribute like
>> country,state,district etc. I want  Index and want hierarchical facet
>> result on facet pivot query. One more thing , my document varies may
>> have single ,two ,three.. any number of location.
>>
>>
>> On 05/15/2013 03:55 PM, Upayavira wrote:
>>> http://wiki.apache.org/solr/HierarchicalFaceting
>>>
>>> On Wed, May 15, 2013, at 09:44 AM, varsha.yadav wrote:
>>>> Hi Everyone,
>>>>
>>>> I am working on Hierarchical Faceting. I am indexing location of
>>>> document with their state and district.
>>>>     I would like to find counts of every country with state count and
>>>> district count. I found facet pivot working well to give me count if i
>>>> use single valued fields like
>>>> -------
>>>> <doc>
>>>> <str name="country">india</str>
>>>> <str name="state">maharashtra</str>
>>>> </doc>
>>>> <doc>
>>>> <str name="country">india</str>
>>>> <str name="state">gujrat</str>
>>>> </doc>
>>>> <doc>
>>>> <str name="country">india</str>
>>>> <str name="district">Faridabad</str>
>>>> <str name="state">Haryana</str>
>>>> </doc>
>>>> <doc>
>>>> <str name="country">china</str>
>>>> <str name="district">foshan</str>
>>>> <str name="state">guangdong</str>
>>>> </doc>
>>>> ------------
>>>> I found results that is fine :
>>>> <arr name="country,state,district,event">
>>>> <lst>
>>>> <str name="field">country</str>
>>>> <str name="value">india</str>
>>>> <int name="count">1</int>
>>>> <arr name="pivot">
>>>>
>>>> <lst>
>>>> <str name="field">state</str>
>>>> <str name="value">maharashtra</str>
>>>> <int name="count">1</int>
>>>> <arr name="pivot"></arr>
>>>> <lst>
>>>> <str name="field">state</str>
>>>> <str name="value">Haryana</str>
>>>> <int name="count">1</int>
>>>> <arr name="pivot">
>>>> <lst>
>>>> <str name="field">district</str>
>>>> <str name="value">Faridabad</str>
>>>> <int name="count">1</int>
>>>> </lst>
>>>> </arr>
>>>> </lst>
>>>> </arr>
>>>> </lst>
>>>> </arr>
>>>> </lst>
>>>> <lst>
>>>> <str name="field">country</str>
>>>> <str name="value">china</str>
>>>> <int name="count">1</int>
>>>> <arr name="pivot">
>>>> <lst>
>>>> <str name="field">state</str>
>>>> ....
>>>> </lst>
>>>> </arr>
>>>>
>>>>
>>>> But if my document have multiple location like :
>>>>
>>>> <doc>
>>>> <arr name="location">
>>>> <str>japan|JAPAN|null|</str>
>>>> <str>
>>>> brisbane|Australia|Queensland
>>>> </str>
>>>> <str>
>>>> afghanistan|AFGHANISTAN|null
>>>> </str>
>>>> </arr>
>>>> </doc>
>>>>
>>>> <doc>
>>>> <arr name="location">
>>>> <str>
>>>> afghanistan|AFGHANISTAN|null
>>>> </str>
>>>> </arr>
>>>> </doc>
>>>>
>>>> <doc>
>>>> <arr name="location">
>>>> <str>
>>>> brisbane|Australia|Queensland
>>>> </str>
>>>> </str>
>>>> </arr>
>>>> </doc>
>>>>
>>>>
>>>> Can anyone tell , me how should i put data in solr index to get
>>>> hierarical data.
>>>>
>>>> Thanks
>>>> Varsha
>>
>> -- 
>> Thanks & Regards
>> Varsha
>>


-- 
Thanks & Regards
Varsha


Re: Hierarchical Faceting

Posted by Upayavira <uv...@odoko.co.uk>.
Can't you use the PathHierarchyTokenizerFactory mentioned on that page?
I think it is called descendent-path in the default schema. Won't that
get you what you want?

  UK/London/Covent Garden
becomes
  UK
  UK/London
  UK/London/Covent Garden

and 
  India/Maharastra/Pune/Dapodi
becomes
  India
  India/Maharastra
  India/Maharastra/Pune
  India/Maharastra/Pune/Dapodi

These fields can be multivalued.

Upayavira

On Wed, May 15, 2013, at 12:29 PM, varsha.yadav wrote:
> Hi
> 
> I go through that but i want to index multiple location in single 
> document and a single location have multiple feature/attribute like 
> country,state,district etc. I want  Index and want hierarchical facet 
> result on facet pivot query. One more thing , my document varies may 
> have single ,two ,three.. any number of location.
> 
> 
> On 05/15/2013 03:55 PM, Upayavira wrote:
> > http://wiki.apache.org/solr/HierarchicalFaceting
> >
> > On Wed, May 15, 2013, at 09:44 AM, varsha.yadav wrote:
> >> Hi Everyone,
> >>
> >> I am working on Hierarchical Faceting. I am indexing location of
> >> document with their state and district.
> >>    I would like to find counts of every country with state count and
> >> district count. I found facet pivot working well to give me count if i
> >> use single valued fields like
> >> -------
> >> <doc>
> >> <str name="country">india</str>
> >> <str name="state">maharashtra</str>
> >> </doc>
> >> <doc>
> >> <str name="country">india</str>
> >> <str name="state">gujrat</str>
> >> </doc>
> >> <doc>
> >> <str name="country">india</str>
> >> <str name="district">Faridabad</str>
> >> <str name="state">Haryana</str>
> >> </doc>
> >> <doc>
> >> <str name="country">china</str>
> >> <str name="district">foshan</str>
> >> <str name="state">guangdong</str>
> >> </doc>
> >> ------------
> >> I found results that is fine :
> >> <arr name="country,state,district,event">
> >> <lst>
> >> <str name="field">country</str>
> >> <str name="value">india</str>
> >> <int name="count">1</int>
> >> <arr name="pivot">
> >>
> >> <lst>
> >> <str name="field">state</str>
> >> <str name="value">maharashtra</str>
> >> <int name="count">1</int>
> >> <arr name="pivot"></arr>
> >> <lst>
> >> <str name="field">state</str>
> >> <str name="value">Haryana</str>
> >> <int name="count">1</int>
> >> <arr name="pivot">
> >> <lst>
> >> <str name="field">district</str>
> >> <str name="value">Faridabad</str>
> >> <int name="count">1</int>
> >> </lst>
> >> </arr>
> >> </lst>
> >> </arr>
> >> </lst>
> >> </arr>
> >> </lst>
> >> <lst>
> >> <str name="field">country</str>
> >> <str name="value">china</str>
> >> <int name="count">1</int>
> >> <arr name="pivot">
> >> <lst>
> >> <str name="field">state</str>
> >> ....
> >> </lst>
> >> </arr>
> >>
> >>
> >> But if my document have multiple location like :
> >>
> >> <doc>
> >> <arr name="location">
> >> <str>japan|JAPAN|null|</str>
> >> <str>
> >> brisbane|Australia|Queensland
> >> </str>
> >> <str>
> >> afghanistan|AFGHANISTAN|null
> >> </str>
> >> </arr>
> >> </doc>
> >>
> >> <doc>
> >> <arr name="location">
> >> <str>
> >> afghanistan|AFGHANISTAN|null
> >> </str>
> >> </arr>
> >> </doc>
> >>
> >> <doc>
> >> <arr name="location">
> >> <str>
> >> brisbane|Australia|Queensland
> >> </str>
> >> </str>
> >> </arr>
> >> </doc>
> >>
> >>
> >> Can anyone tell , me how should i put data in solr index to get
> >> hierarical data.
> >>
> >> Thanks
> >> Varsha
> 
> 
> -- 
> Thanks & Regards
> Varsha
> 

Re: Hierarchical Faceting

Posted by "varsha.yadav" <va...@orkash.com>.
Hi

I go through that but i want to index multiple location in single 
document and a single location have multiple feature/attribute like 
country,state,district etc. I want  Index and want hierarchical facet 
result on facet pivot query. One more thing , my document varies may 
have single ,two ,three.. any number of location.


On 05/15/2013 03:55 PM, Upayavira wrote:
> http://wiki.apache.org/solr/HierarchicalFaceting
>
> On Wed, May 15, 2013, at 09:44 AM, varsha.yadav wrote:
>> Hi Everyone,
>>
>> I am working on Hierarchical Faceting. I am indexing location of
>> document with their state and district.
>>    I would like to find counts of every country with state count and
>> district count. I found facet pivot working well to give me count if i
>> use single valued fields like
>> -------
>> <doc>
>> <str name="country">india</str>
>> <str name="state">maharashtra</str>
>> </doc>
>> <doc>
>> <str name="country">india</str>
>> <str name="state">gujrat</str>
>> </doc>
>> <doc>
>> <str name="country">india</str>
>> <str name="district">Faridabad</str>
>> <str name="state">Haryana</str>
>> </doc>
>> <doc>
>> <str name="country">china</str>
>> <str name="district">foshan</str>
>> <str name="state">guangdong</str>
>> </doc>
>> ------------
>> I found results that is fine :
>> <arr name="country,state,district,event">
>> <lst>
>> <str name="field">country</str>
>> <str name="value">india</str>
>> <int name="count">1</int>
>> <arr name="pivot">
>>
>> <lst>
>> <str name="field">state</str>
>> <str name="value">maharashtra</str>
>> <int name="count">1</int>
>> <arr name="pivot"></arr>
>> <lst>
>> <str name="field">state</str>
>> <str name="value">Haryana</str>
>> <int name="count">1</int>
>> <arr name="pivot">
>> <lst>
>> <str name="field">district</str>
>> <str name="value">Faridabad</str>
>> <int name="count">1</int>
>> </lst>
>> </arr>
>> </lst>
>> </arr>
>> </lst>
>> </arr>
>> </lst>
>> <lst>
>> <str name="field">country</str>
>> <str name="value">china</str>
>> <int name="count">1</int>
>> <arr name="pivot">
>> <lst>
>> <str name="field">state</str>
>> ....
>> </lst>
>> </arr>
>>
>>
>> But if my document have multiple location like :
>>
>> <doc>
>> <arr name="location">
>> <str>japan|JAPAN|null|</str>
>> <str>
>> brisbane|Australia|Queensland
>> </str>
>> <str>
>> afghanistan|AFGHANISTAN|null
>> </str>
>> </arr>
>> </doc>
>>
>> <doc>
>> <arr name="location">
>> <str>
>> afghanistan|AFGHANISTAN|null
>> </str>
>> </arr>
>> </doc>
>>
>> <doc>
>> <arr name="location">
>> <str>
>> brisbane|Australia|Queensland
>> </str>
>> </str>
>> </arr>
>> </doc>
>>
>>
>> Can anyone tell , me how should i put data in solr index to get
>> hierarical data.
>>
>> Thanks
>> Varsha


-- 
Thanks & Regards
Varsha


Re: Hierarchical Faceting

Posted by Upayavira <uv...@odoko.co.uk>.
http://wiki.apache.org/solr/HierarchicalFaceting

On Wed, May 15, 2013, at 09:44 AM, varsha.yadav wrote:
> Hi Everyone,
> 
> I am working on Hierarchical Faceting. I am indexing location of 
> document with their state and district.
>   I would like to find counts of every country with state count and 
> district count. I found facet pivot working well to give me count if i 
> use single valued fields like
> -------
> <doc>
> <str name="country">india</str>
> <str name="state">maharashtra</str>
> </doc>
> <doc>
> <str name="country">india</str>
> <str name="state">gujrat</str>
> </doc>
> <doc>
> <str name="country">india</str>
> <str name="district">Faridabad</str>
> <str name="state">Haryana</str>
> </doc>
> <doc>
> <str name="country">china</str>
> <str name="district">foshan</str>
> <str name="state">guangdong</str>
> </doc>
> ------------
> I found results that is fine :
> <arr name="country,state,district,event">
> <lst>
> <str name="field">country</str>
> <str name="value">india</str>
> <int name="count">1</int>
> <arr name="pivot">
> 
> <lst>
> <str name="field">state</str>
> <str name="value">maharashtra</str>
> <int name="count">1</int>
> <arr name="pivot"></arr>
> <lst>
> <str name="field">state</str>
> <str name="value">Haryana</str>
> <int name="count">1</int>
> <arr name="pivot">
> <lst>
> <str name="field">district</str>
> <str name="value">Faridabad</str>
> <int name="count">1</int>
> </lst>
> </arr>
> </lst>
> </arr>
> </lst>
> </arr>
> </lst>
> <lst>
> <str name="field">country</str>
> <str name="value">china</str>
> <int name="count">1</int>
> <arr name="pivot">
> <lst>
> <str name="field">state</str>
> ....
> </lst>
> </arr>
> 
> 
> But if my document have multiple location like :
> 
> <doc>
> <arr name="location">
> <str>japan|JAPAN|null|</str>
> <str>
> brisbane|Australia|Queensland
> </str>
> <str>
> afghanistan|AFGHANISTAN|null
> </str>
> </arr>
> </doc>
> 
> <doc>
> <arr name="location">
> <str>
> afghanistan|AFGHANISTAN|null
> </str>
> </arr>
> </doc>
> 
> <doc>
> <arr name="location">
> <str>
> brisbane|Australia|Queensland
> </str>
> </str>
> </arr>
> </doc>
> 
> 
> Can anyone tell , me how should i put data in solr index to get 
> hierarical data.
> 
> Thanks
> Varsha

Hierarchical Faceting

Posted by "varsha.yadav" <va...@orkash.com>.
Hi Everyone,

I am working on Hierarchical Faceting. I am indexing location of 
document with their state and district.
  I would like to find counts of every country with state count and 
district count. I found facet pivot working well to give me count if i 
use single valued fields like
-------
<doc>
<str name="country">india</str>
<str name="state">maharashtra</str>
</doc>
<doc>
<str name="country">india</str>
<str name="state">gujrat</str>
</doc>
<doc>
<str name="country">india</str>
<str name="district">Faridabad</str>
<str name="state">Haryana</str>
</doc>
<doc>
<str name="country">china</str>
<str name="district">foshan</str>
<str name="state">guangdong</str>
</doc>
------------
I found results that is fine :
<arr name="country,state,district,event">
<lst>
<str name="field">country</str>
<str name="value">india</str>
<int name="count">1</int>
<arr name="pivot">

<lst>
<str name="field">state</str>
<str name="value">maharashtra</str>
<int name="count">1</int>
<arr name="pivot"></arr>
<lst>
<str name="field">state</str>
<str name="value">Haryana</str>
<int name="count">1</int>
<arr name="pivot">
<lst>
<str name="field">district</str>
<str name="value">Faridabad</str>
<int name="count">1</int>
</lst>
</arr>
</lst>
</arr>
</lst>
</arr>
</lst>
<lst>
<str name="field">country</str>
<str name="value">china</str>
<int name="count">1</int>
<arr name="pivot">
<lst>
<str name="field">state</str>
....
</lst>
</arr>


But if my document have multiple location like :

<doc>
<arr name="location">
<str>japan|JAPAN|null|</str>
<str>
brisbane|Australia|Queensland
</str>
<str>
afghanistan|AFGHANISTAN|null
</str>
</arr>
</doc>

<doc>
<arr name="location">
<str>
afghanistan|AFGHANISTAN|null
</str>
</arr>
</doc>

<doc>
<arr name="location">
<str>
brisbane|Australia|Queensland
</str>
</str>
</arr>
</doc>


Can anyone tell , me how should i put data in solr index to get 
hierarical data.

Thanks
Varsha

Re: error while switching from log4j back to slf4j with solr 4.3

Posted by Shawn Heisey <so...@elyograg.org>.
On 5/17/2013 12:25 AM, Bernd Fehling wrote:
> Actually there is no "real" container in my eclipse debugging env :-(
> /opt/indigo/eclipse/configuration/org.eclipse.osgi/bundles/884/1/.cp/lib/jetty-webapp-8.1.2.v20120308.jar
> 
> Then it should be copied to lib/ext of eclipse/run-jetty-run
> "java.​class.​path" - /opt/indigo/eclipse/configuration/org.eclipse.osgi/bundles/884/1/.cp/lib/ext ?
> 
> or "java.​ext.​dirs" - /usr/java/packages/lib/ext ?
> 
> or "rjrwebapp" - /srv/www/solr/workspace_juno_solr_4_3_0/TestSolr/webapp/lib/ext ?

It just has to be somewhere in the classpath at the point where slf4j
gets initialized.  If your current location is working for you, you can
stick with it, but just be aware that it might stop working if the war
gets re-extracted.

Thanks,
Shawn


Re: error while switching from log4j back to slf4j with solr 4.3

Posted by Bernd Fehling <be...@uni-bielefeld.de>.

Am 16.05.2013 17:19, schrieb Shawn Heisey:
> On 5/16/2013 3:24 AM, Bernd Fehling wrote:
>> OK, solved.
>> I have now run-jetty-run with log4j running.
>> Just copied log4j libs from example/lib/ext to webapp/WEB-INF/classes and
>> set -Dlog4j.configuration in run-jetty-run VM classpath.
> 
> The location where you copied those files is in the extracted .war file, and may get automatically wiped out at some point in the future,
> especially by an upgrade.  It would be better to copy them to the external lib directory for your container.  For jetty, that's lib/ext ... it
> is likely to be different for other containers.

Actually there is no "real" container in my eclipse debugging env :-(
/opt/indigo/eclipse/configuration/org.eclipse.osgi/bundles/884/1/.cp/lib/jetty-webapp-8.1.2.v20120308.jar

Then it should be copied to lib/ext of eclipse/run-jetty-run
"java.​class.​path" - /opt/indigo/eclipse/configuration/org.eclipse.osgi/bundles/884/1/.cp/lib/ext ?

or "java.​ext.​dirs" - /usr/java/packages/lib/ext ?

or "rjrwebapp" - /srv/www/solr/workspace_juno_solr_4_3_0/TestSolr/webapp/lib/ext ?

Can't follow you

Thanks,
Bernd

Re: error while switching from log4j back to slf4j with solr 4.3

Posted by Shawn Heisey <so...@elyograg.org>.
On 5/16/2013 3:24 AM, Bernd Fehling wrote:
> OK, solved.
> I have now run-jetty-run with log4j running.
> Just copied log4j libs from example/lib/ext to webapp/WEB-INF/classes and
> set -Dlog4j.configuration in run-jetty-run VM classpath.

The location where you copied those files is in the extracted .war file, 
and may get automatically wiped out at some point in the future, 
especially by an upgrade.  It would be better to copy them to the 
external lib directory for your container.  For jetty, that's lib/ext 
... it is likely to be different for other containers.

Thanks,
Shawn


Re: error while switching from log4j back to slf4j with solr 4.3

Posted by Bernd Fehling <be...@uni-bielefeld.de>.
OK, solved.
I have now run-jetty-run with log4j running.
Just copied log4j libs from example/lib/ext to webapp/WEB-INF/classes and
set -Dlog4j.configuration in run-jetty-run VM classpath.

Thanks,
Bernd

Am 15.05.2013 16:31, schrieb Shawn Heisey:
> On 5/15/2013 12:52 AM, Bernd Fehling wrote:
>> while I can't get solr 4.3 with run-jetty-run up and running under eclipse
>> for debugging I tried to switch back to slf4j and followed
>> the steps of http://wiki.apache.org/solr/SolrLogging
>>
>> Unfortunately eclipse bothers me with an error:
>> The import org.apache.log4j.AppenderSkeleton cannot be resolved
>> EventAppender.java	
>> /solr/core/src/java/org/apache/solr/logging/log4j	line 19	Java Problem
>>
>> log4j-over-slf4j-1.6.6.jar has no class AppenderSkeleton as log4j-1.2.16.jar does.
> 
> Can you please send a listing of the directory where you have your slf4j
> jars and the full exception stacktrace from your log?  Please use a
> paste website, such as pastie.org.
> 
> Thanks,
> Shawn
> 

Re: error while switching from log4j back to slf4j with solr 4.3

Posted by Shawn Heisey <so...@elyograg.org>.
On 5/15/2013 12:52 AM, Bernd Fehling wrote:
> while I can't get solr 4.3 with run-jetty-run up and running under eclipse
> for debugging I tried to switch back to slf4j and followed
> the steps of http://wiki.apache.org/solr/SolrLogging
> 
> Unfortunately eclipse bothers me with an error:
> The import org.apache.log4j.AppenderSkeleton cannot be resolved
> EventAppender.java	
> /solr/core/src/java/org/apache/solr/logging/log4j	line 19	Java Problem
> 
> log4j-over-slf4j-1.6.6.jar has no class AppenderSkeleton as log4j-1.2.16.jar does.

Can you please send a listing of the directory where you have your slf4j
jars and the full exception stacktrace from your log?  Please use a
paste website, such as pastie.org.

Thanks,
Shawn