multiple spellchecker components

2008-09-10 Thread Stefan Oestreicher
Hi,
 
I'm currently in the middle of converting my index from the old
spellchecker request handler to the spellcheck component. My index has a
category field and my frontend only allows to search in one category at
once so I have a spellchecker request handler for each category in order
to present only spelling suggestions that are relevant for the current
category (the handlers only differ in the termSourceField).
Unfortunately  I don't quite get how I can achieve that with the new
component. Although the example in the wiki shows how you can configure
multiple components there doesn't seem to be a way to explicitly invoke
one of them on a per request basis (or at least the wiki lacks an
example).
That's my current configuration:
 
searchComponent name=nuspell
class=org.apache.solr.handler.component.SpellCheckComponent
  lst name=spellchecker
  str name=namedefault/str
  str
name=classnameorg.apache.solr.spelling.IndexBasedSpellChecker/str
  str name=fieldspellcheck/str
  /lst
 
  lst name=spellchecker
  str name=namenews/str
  str
name=classnameorg.apache.solr.spelling.IndexBasedSpellChecker/str
  str name=fieldspellcheck_nachrichten/str
  /lst
 /searchComponent

But it seems that only the default spellchecker is actually used. I
tried passing the name like spellcheck.name=news but that didn't work.

What am I missing?
 
TIA,
 
Stefan Oestreicher


query parsing

2008-08-12 Thread Stefan Oestreicher
Hi,

I need to modify the query to search through all fields if no explicit field
has been specified. I know there's the dismax handler but I'd like to use
the standard query syntax.
I implemented that with my own QParserPlugin and QParser and for simple term
queries it works great. I'm using the SolrQueryParser which I get from the
schema to parse the query with an impossible field name as the default field
and then I rewrite the query accordingly.
Unfortunately this doesn't work with phrase queries, the SolrQueryParser
always returns a TermQuery instead of a phrase query.

What am I missing? Is this even a viable approach?

This is a code snippet from a test case (extending AbstractSolrTestCase)
which I used to verify that it's not returning a PhraseQuery:

-8-
SolrQueryParser parser = h.getCore().getSchema().getSolrQueryParser(null);
Query q = parser.parse(baz \foo bar\);
assertTrue( q instanceof BooleanQuery );
BooleanQuery bq = (BooleanQuery)q;
BooleanClause[] cl = bq.getClauses();
assertEquals(2, cl.length);
//this assertion fails
assertTrue(cl[1].getQuery() instanceof PhraseQuery);
-8-

I'm using solr 1.3, r685085.

TIA,
 
Stefan Oestreicher



RE: query parsing

2008-08-12 Thread Stefan Oestreicher
Ah, yes, the FieldType I used was not the one I needed. I completely missed
that. Thank you very much, it's working perfectly now.

thanks,

Stefan Oestreicher

 -Original Message-
 From: Erik Hatcher [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, August 12, 2008 11:46 AM
 To: solr-user@lucene.apache.org
 Subject: Re: query parsing
 
 Solr/Lucene QueryParser returns a TermQuery for phrases 
 that end up only as a single term.  This could happen, for 
 example, if it was using Solr's string field type (which 
 has effectively no analyzer).
 
 I'd guess that you'd want to re-analyze TermQuery's?  (though 
 that sound problematic for many cases)  Or possibly use your 
 own SolrQueryParser subclass and override #getFieldQuery.
 
   Erik
 
 On Aug 12, 2008, at 5:26 AM, Stefan Oestreicher wrote:
 
  Hi,
 
  I need to modify the query to search through all fields if 
 no explicit 
  field has been specified. I know there's the dismax handler but I'd 
  like to use the standard query syntax.
  I implemented that with my own QParserPlugin and QParser and for 
  simple term queries it works great. I'm using the SolrQueryParser 
  which I get from the schema to parse the query with an impossible 
  field name as the default field and then I rewrite the query 
  accordingly.
  Unfortunately this doesn't work with phrase queries, the 
  SolrQueryParser always returns a TermQuery instead of a 
 phrase query.
 
  What am I missing? Is this even a viable approach?
 
  This is a code snippet from a test case (extending
  AbstractSolrTestCase)
  which I used to verify that it's not returning a PhraseQuery:
 
  -8-
  SolrQueryParser parser =
  h.getCore().getSchema().getSolrQueryParser(null);
  Query q = parser.parse(baz \foo bar\); assertTrue( q instanceof 
  BooleanQuery ); BooleanQuery bq = (BooleanQuery)q; 
 BooleanClause[] cl 
  = bq.getClauses(); assertEquals(2, cl.length); //this 
 assertion fails
  assertTrue(cl[1].getQuery() instanceof PhraseQuery);
  -8-
 
  I'm using solr 1.3, r685085.
 
  TIA,
 
  Stefan Oestreicher
 
 



facets and filter query

2008-07-22 Thread Stefan Oestreicher
Hi,

I have a category field in my index which I'd like to use as a facet.
However my search frontend only allows you to search in one category at a
time for which I'm using a filter query. Unfortunately the filter query
restricts the facets as well.

My query looks like this:
?q=content:foofq=cat:defaultfl=title,contentfacet=truefacet.field=cat

What I'd like is to search only in the default category but get the result
count of that query for all categories. I thought maybe I can use the
facet.query parameter but this doesn't seem to do what I want, because the
result is the same.

Is there any way to accomplish this with only one request?

I'm using version 1.3 from trunk.

TIA,
 
Stefan Oestreicher



RE: WordDelimiterFilter splits at non-ASCII chars

2008-07-16 Thread Stefan Oestreicher
Yes you're right. I was testing with analysis.jsp but it chokes on multibyte
chars.
I modified the jsp and set the encoding using
request.setCharacterEncoding(UTF-8);
and it's working fine. Bug in analysis.jsp?

thanks,
 
Stefan Oestreicher 

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf 
 Of Yonik Seeley
 Sent: Tuesday, July 15, 2008 6:29 PM
 To: solr-user@lucene.apache.org
 Subject: Re: WordDelimiterFilter splits at non-ASCII chars
 
 On Tue, Jul 15, 2008 at 10:29 AM, Stefan Oestreicher 
 [EMAIL PROTECTED] wrote:
  as I understand the WordDelimiterFilter should split on 
 case changes, 
  word delimiters and changes from character to digit, but it 
 should not 
  differentiate between ASCII and multibyte chars. It does 
 however. The 
  word hälse (german plural of neck) gets split into h, ä and 
  lse, which unfortunately renders this filter quite 
 unusable for me. 
  Am i missing something or is this a bug?
  I'm using solr 1.3 built from trunk.
 
 Look for charset issues in communicating with Solr.  I just 
 tried this with the text field via Solr's analysis.jsp and 
 it works fine.
 
 -Yonik
 



WordDelimiterFilter splits at non-ASCII chars

2008-07-15 Thread Stefan Oestreicher
Hi,

as I understand the WordDelimiterFilter should split on case changes, word
delimiters and changes from character to digit, but it should not
differentiate between ASCII and multibyte chars. It does however. The word
hälse (german plural of neck) gets split into h, ä and lse, which
unfortunately renders this filter quite unusable for me. Am i missing
something or is this a bug?
I'm using solr 1.3 built from trunk.

TIA,
 
Stefan Oestreicher



1.3 maven artifact

2008-06-30 Thread Stefan Oestreicher
Hi,

I just wanted to ask if solr 1.3 is already available as maven artifact? If
it is not could you give me an estimate on when it will be?

TIA,
 
Stefan Oestreicher
 
--
Dr. Maté GmbH
Stefan Oestreicher / Entwicklung
[EMAIL PROTECTED]
http://www.netdoktor.at
Tel Buero: + 43 1 405 55 75 24
Fax Buero: + 43 1 405 55 75 55
Alser Str. 4 1090 Wien Altes AKH Hof 1 1.6.6



nonexistent filter class in schema.xml

2008-06-26 Thread Stefan Oestreicher
Hi,

if I add a custom filter in the schema xml and the class doesn't exist there
is no solr error. Instead tomcat throws an exception:

SEVERE: Error finishing response
java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at
org.apache.coyote.http11.InternalOutputBuffer.write(InternalOutputBuffer.jav
a:690)

I just ran into this and it took me some time to figure out what exactly is
causing the error. 
It would've been much easier to debug If there would've been an error like
filter class foo.bar.Baz doesn't exist. I guess this issue applies to
other plugins as well.

best regards,
 
Stefan Oestreicher
 
--
Dr. Maté GmbH
Stefan Oestreicher / Entwicklung
[EMAIL PROTECTED]
http://www.netdoktor.at
Tel Buero: + 43 1 405 55 75 24
Fax Buero: + 43 1 405 55 75 55
Alser Str. 4 1090 Wien Altes AKH Hof 1 1.6.6



AW: nonexistent filter class in schema.xml

2008-06-26 Thread Stefan Oestreicher
No, I'm talking about solr token filters. I implemented my own token filter
(org.apache.lucene.analysis.TokenFilter and
org.apache.solr.analysis.BaseTokenFilterFactory) but I misspelled the
classname in the schema.xml and I got that exception. The solr webinterface
didn't respond as well, just a white page, no http response.

best regards,
 
Stefan Oestreicher
 
--
Dr. Maté GmbH
Stefan Oestreicher / Entwicklung
[EMAIL PROTECTED]
http://www.netdoktor.at
Tel Buero: + 43 1 405 55 75 24
Fax Buero: + 43 1 405 55 75 55
Alser Str. 4 1090 Wien Altes AKH Hof 1 1.6.6

-Ursprüngliche Nachricht-
Von: Shalin Shekhar Mangar [mailto:[EMAIL PROTECTED] 
Gesendet: Donnerstag, 26. Juni 2008 12:51
An: solr-user@lucene.apache.org
Betreff: Re: nonexistent filter class in schema.xml

Hi Stefan,

Your exception is originating from tomcat instead of Solr. Are you talking
about adding a ServletFilter (usually declared in web.xml) instead of a
custom Solr filter factory (declared in schema.xml)?

SEVERE: Error finishing response
java.lang.ArrayIndexOutOfBoundsException
   at java.lang.System.arraycopy(Native Method)
   at
org.apache.coyote.http11.InternalOutputBuffer.write(InternalOutputBuffer.jav
a:690)

If I add a undefined class as a filter factory in Solr's schema.xml then I
get a proper ClassNotFoundException.

SEVERE: org.apache.solr.common.SolrException: Error loading class
'my.foo.class'
at
org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:25
5)
...
...
Caused by: java.lang.ClassNotFoundException: my.foo.class

I added a new filter to the text data-type as follows:
fieldType name=text class=solr.TextField positionIncrementGap=100
  analyzer type=index
tokenizer class=solr.WhitespaceTokenizerFactory/
filter class=my.foo.class /
...
...

On Thu, Jun 26, 2008 at 3:44 PM, Stefan Oestreicher
[EMAIL PROTECTED] wrote:

 Sorry, i completely forgot...
 I built from trunk, so it's 1.3. Revision 666555.

 best regards,

 Stefan Oestreicher

 --
 Dr. Maté GmbH
 Stefan Oestreicher / Entwicklung
 [EMAIL PROTECTED]
 http://www.netdoktor.at
 Tel Buero: + 43 1 405 55 75 24
 Fax Buero: + 43 1 405 55 75 55
 Alser Str. 4 1090 Wien Altes AKH Hof 1 1.6.6

 -Ursprüngliche Nachricht-
 Von: Shalin Shekhar Mangar [mailto:[EMAIL PROTECTED]
 Gesendet: Donnerstag, 26. Juni 2008 12:07
 An: solr-user@lucene.apache.org
 Betreff: Re: nonexistent filter class in schema.xml

 Can you tell us what version of Solr are you using?

 On Thu, Jun 26, 2008 at 2:41 PM, Stefan Oestreicher  
 [EMAIL PROTECTED] wrote:

  Hi,
 
  if I add a custom filter in the schema xml and the class doesn't 
  exist there is no solr error. Instead tomcat throws an exception:
 
  SEVERE: Error finishing response
  java.lang.ArrayIndexOutOfBoundsException
 at java.lang.System.arraycopy(Native Method)
 at
 
  org.apache.coyote.http11.InternalOutputBuffer.write(InternalOutputBu
  ff
  er.jav
  a:690)
 
  I just ran into this and it took me some time to figure out what 
  exactly is causing the error.
  It would've been much easier to debug If there would've been an 
  error like filter class foo.bar.Baz doesn't exist. I guess this 
  issue applies to other plugins as well.
 
  best regards,
 
  Stefan Oestreicher
 
  --
  Dr. Maté GmbH
  Stefan Oestreicher / Entwicklung
  [EMAIL PROTECTED]
  http://www.netdoktor.at
  Tel Buero: + 43 1 405 55 75 24
  Fax Buero: + 43 1 405 55 75 55
  Alser Str. 4 1090 Wien Altes AKH Hof 1 1.6.6
 
 


 --
 Regards,
 Shalin Shekhar Mangar.




--
Regards,
Shalin Shekhar Mangar.



Re: Problems finding solr/home using JNDI on tomcat

2008-06-13 Thread Stefan Oestreicher
Hi,

I'm using tomcat5.5 too. I believe you need to specify override to be true.

Context docBase=/solr/solr.war debug=1 crossContext=true
   Environment name=solr/home type=java.lang.String 
value=/solr/example/solr/ override=true
/Context

HTH,

mit freundlichen Grüßen,
 
Stefan Oestreicher
 
--
Dr. Maté GmbH
Stefan Oestreicher / Entwicklung
[EMAIL PROTECTED]
http://www.netdoktor.at
Tel Buero: + 43 1 405 55 75 24
Fax Buero: + 43 1 405 55 75 55
Alser Str. 4 1090 Wien Altes AKH Hof 1 1.6.6

-Ursprüngliche Nachricht-
Von: Kjeld Froberg [mailto:[EMAIL PROTECTED] 
Gesendet: Freitag, 13. Juni 2008 11:22
An: solr-user@lucene.apache.org
Betreff: Problems finding solr/home using JNDI on tomcat

Hi

I'm using solr 1.2.0 on a Tomcat 5.5 engine And have copied a solr.xml in
catalina_home/conf/hostname

Context docBase=/solr/solr.war debug=1 crossContext=true
   Environment name=solr/home type=java.lang.String 
value=/solr/example/solr/
/Context

And Tomcat certainly reads the solr.xml file, because solr is deployed fine.
However it cannot find the environment property, because there is a
javax.naming.NoInitialContextException when trying to lookup the JNDI name.

13-06-2008 10:24:46 org.apache.solr.servlet.SolrDispatchFilter init
INFO: SolrDispatchFilter.init()
13-06-2008 10:24:46 org.apache.solr.core.Config getInstanceDir
INFO: JNDI not configured for Solr (NoInitialContextEx)
13-06-2008 10:24:46 org.apache.solr.core.Config getInstanceDir

Any suggestions for how to solve that?

Regards
Kjeld



Re: Problems finding solr/home using JNDI on tomcat

2008-06-13 Thread Stefan Oestreicher
Unfortunately I'm neither a solr nor a tomcat expert.

My setup is as follows:

solr.xml in /etc/tomcat5.5/Catalina/hostname/solr.xml

Context docBase=/data/java/archives/solr-1.3-dev.war debug=0
crossContext=0
Environment name=solr/home type=java.lang.String
value=/data/java/solr override=true /
/Context

And my CATALINA_HOME is /data/java/dev02

Is your solr.home writable by tomcat and outside of CATALINA_HOME? 

HTH,

Stefan Oestreicher
 
--
Dr. Maté GmbH
Stefan Oestreicher / Entwicklung
[EMAIL PROTECTED]
http://www.netdoktor.at
Tel Buero: + 43 1 405 55 75 24
Fax Buero: + 43 1 405 55 75 55
Alser Str. 4 1090 Wien Altes AKH Hof 1 1.6.6

-Ursprüngliche Nachricht-
Von: Kjeld Froberg [mailto:[EMAIL PROTECTED] 
Gesendet: Freitag, 13. Juni 2008 11:42
An: solr-user@lucene.apache.org
Betreff: Re: Problems finding solr/home using JNDI on tomcat

Hi,
Same problem.

Contextfile:
Context docBase=/solr/solr.war debug=1 crossContext=true
   Environment name=solr/home type=java.lang.String 
value=/solr/example/solr override=true/ /Context

Output.

13-06-2008 11:36:20 org.apache.solr.servlet.SolrDispatchFilter init
INFO: SolrDispatchFilter.init()
13-06-2008 11:36:20 org.apache.solr.core.Config getInstanceDir
INFO: JNDI not configured for Solr (NoInitialContextEx)
13-06-2008 11:36:20 org.apache.solr.core.Config getInstanceDir

Regards
Kjeld


Stefan Oestreicher skrev:
  Hi,

  I'm using tomcat5.5 too. I believe you need to specify override to be
true.

  Context docBase=/solr/solr.war debug=1 crossContext=true
 Environment name=solr/home type=java.lang.String
  value=/solr/example/solr/ override=true
  /Context

  HTH,

  mit freundlichen Grüßen,

  Stefan Oestreicher

  --
  Dr. Maté GmbH
  Stefan Oestreicher / Entwicklung
  [EMAIL PROTECTED]
  http://www.netdoktor.at
  Tel Buero: + 43 1 405 55 75 24
  Fax Buero: + 43 1 405 55 75 55
  Alser Str. 4 1090 Wien Altes AKH Hof 1 1.6.6

  -Ursprüngliche Nachricht-
  Von: Kjeld Froberg [mailto:[EMAIL PROTECTED]
  Gesendet: Freitag, 13. Juni 2008 11:22
  An: solr-user@lucene.apache.org
  Betreff: Problems finding solr/home using JNDI on tomcat

  Hi

  I'm using solr 1.2.0 on a Tomcat 5.5 engine And have copied a solr.xml in
  catalina_home/conf/hostname

  Context docBase=/solr/solr.war debug=1 crossContext=true
 Environment name=solr/home type=java.lang.String
  value=/solr/example/solr/
  /Context

  And Tomcat certainly reads the solr.xml file, because solr is deployed
fine.
  However it cannot find the environment property, because there is a
  javax.naming.NoInitialContextException when trying to lookup the JNDI
name.

  13-06-2008 10:24:46 org.apache.solr.servlet.SolrDispatchFilter init
  INFO: SolrDispatchFilter.init()
  13-06-2008 10:24:46 org.apache.solr.core.Config getInstanceDir
  INFO: JNDI not configured for Solr (NoInitialContextEx)
  13-06-2008 10:24:46 org.apache.solr.core.Config getInstanceDir

  Any suggestions for how to solve that?

  Regards
  Kjeld




range query highlighting

2008-06-11 Thread Stefan Oestreicher
Hi,

I'm using solr built from trunk and highlighting for range queries doesn't
work.
If I search for 2008 everything works as expected but if I search for
[2000 TO 2008] nothing gets highlighted.
The field I'm searching on is a TextField and I've confirmed that the query
and index analyzers are working as expected. 
I didn't find anything in the issue tracker about this. 

Any ideas?

TIA,
 
Stefan Oestreicher
 
--
Dr. Maté GmbH
Stefan Oestreicher / Entwicklung
[EMAIL PROTECTED]
http://www.netdoktor.at
Tel Buero: + 43 1 405 55 75 24
Fax Buero: + 43 1 405 55 75 55
Alser Str. 4 1090 Wien Altes AKH Hof 1 1.6.6



phrase highlighting

2008-06-02 Thread Stefan Oestreicher
Hi,

in order to use phrase highlighting I built a war from the current svn
trunk.
(http://www.nabble.com/-jira--Commented:-(SOLR-553)-Highlighter-does-not-mat
ch-phrase-queries-correctly-p17234014.html) It deployed without problems and
the info section in the admin panel correctly (?) reports the solr version
as Solr Implementation Version: 1.3-dev.

However there's no difference at all if I use hl.usePhraseHighlighter=true
in my select request, phrase terms are still highlighted individually.

What am I missing?

best regards,
 
Stefan Oestreicher
 
--
Dr. Maté GmbH
Stefan Oestreicher / Entwicklung
[EMAIL PROTECTED]
http://www.netdoktor.at
Tel Buero: + 43 1 405 55 75 24
Fax Buero: + 43 1 405 55 75 55
Alser Str. 4 1090 Wien Altes AKH Hof 1 1.6.6



AW: phrase highlighting

2008-06-02 Thread Stefan Oestreicher
I see, thanks for the fast response,
 
Stefan Oestreicher
 
--
Dr. Maté GmbH
Stefan Oestreicher / Entwicklung
[EMAIL PROTECTED]
http://www.netdoktor.at
Tel Buero: + 43 1 405 55 75 24
Fax Buero: + 43 1 405 55 75 55
Alser Str. 4 1090 Wien Altes AKH Hof 1 1.6.6

-Ursprüngliche Nachricht-
Von: Brian Whitman [mailto:[EMAIL PROTECTED] 
Gesendet: Montag, 02. Juni 2008 15:57
An: solr-user@lucene.apache.org
Betreff: Re: phrase highlighting


On Jun 2, 2008, at 9:51 AM, Stefan Oestreicher wrote:
 (http://www.nabble.com/-jira--Commented:-(SOLR-553)-Highlighter-does-n
 ot-mat
 ch-phrase-queries-correctly-p17234014.html) It deployed without 
 problems and the info section in the admin panel correctly (?) reports 
 the solr version as Solr Implementation Version: 1.3-dev.

 However there's no difference at all if I use 
 hl.usePhraseHighlighter=true
 in my select request, phrase terms are still highlighted individually.



That's a different issue, SOLR-553 was to fix the bug that  
highlighting would return snips that did not match the query at all  
(e.g. a query for a b c would return a snip that just had spana/ 
span and nothing else.)

You want SOLR-575, which is about joining the spans across the  
highlight. It's more of a display fix (although I don't understand the  
internals of lucene enough to know how hard it would be to implement.)

https://issues.apache.org/jira/browse/SOLR-575





wildcard highlighting

2008-05-30 Thread Stefan Oestreicher
Hi,

I've started to play around with Solr and I'm quite impressed with its
performance and features. However it seems to me that highlighting of
wildcard terms is not supported, which is somewhat disappointing. Are there
any plans to support that or did I miss something?

best regards,
 
Stefan Oestreicher
 
--
Dr. Maté GmbH
Stefan Oestreicher / Entwicklung
[EMAIL PROTECTED]
http://www.netdoktor.at
Tel Buero: + 43 1 405 55 75 24
Fax Buero: + 43 1 405 55 75 55
Alser Str. 4 1090 Wien Altes AKH Hof 1 1.6.6