Multiple search components in one handler - ie spellchecker

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

Multiple search components in one handler - ie spellchecker

Andrew Nagy-2
Hello - I am attempting to add the spellCheck component in my "search" requesthandler so when a users does a search, they get the results and spelling corrections all in one query just like the way the facets work.

I am having some trouble accomplishing this - can anyone point me to documentation (other than http://wiki.apache.org/solr/SpellCheckComponent) on how to do this or an example solrconfig that would do this correctly?

My guess is there is something preventing this from happening since the requesthandler tag is loading the search component and not the spellchecker component?

Thanks and sorry if my message is a bit vague

Andrew

Reply | Threaded
Open this post in threaded view
|

Re: Multiple search components in one handler - ie spellchecker

Geoffrey Young


Andrew Nagy wrote:
> Hello - I am attempting to add the spellCheck component in my
> "search" requesthandler so when a users does a search, they get the
> results and spelling corrections all in one query just like the way
> the facets work.
>
> I am having some trouble accomplishing this - can anyone point me to
> documentation (other than
> http://wiki.apache.org/solr/SpellCheckComponent) on how to do this or
> an example solrconfig that would do this correctly?

http://mail-archives.apache.org/mod_mbox/lucene-solr-user/200806.mbox/%3C44705.76.117.81.167.1214515546.squirrel@...%3E

in general, just add the

   <arr name="last-components">
     <str>spellcheck</str>
   </arr>

bit to your existing handler after following setup in the twiki docs.

you can ignore the part about the exceptions, as that has been fixed in
trunk.

HTH

--Geoff
Reply | Threaded
Open this post in threaded view
|

RE: Multiple search components in one handler - ie spellchecker

Andrew Nagy-2
Thanks for getting back to me Geoff.  Although, that is pretty much what I have.  Maybe if I show my solrconfig someone might be able to point out what I have incorrect?  The problem is that nothing related to the spelling options are show in the results, just the normal expected search results.  Here is my query:
http://localhost:8080/solr/select?q=*:*&rows=1&spellcheck=true&spellcheck.q=scandanava&spellcheck.build=true

    <searchComponent name="spellcheck" class="org.apache.solr.handler.component.SpellCheckComponent">
      <lst name="spellchecker">
        <str name="field">allfields</str>
        <str name="accuracy">0.7</str> <!-- 0.5 is the default setting -->
        <str name="spellcheckIndexDir">./spellchecker</str>
      </lst>
      <str name="queryAnalyzerFieldType">text</str>
    </searchComponent>
    <queryConverter name="queryConverter" class="org.apache.solr.spelling.SpellingQueryConverter"/>
    <requestHandler name="/search" class="org.apache.solr.handler.component.SearchHandler">
      <lst name="defaults">
        <str name="echoParams">explicit</str>
      </lst>
      <arr name="last-components">
        <str>spellcheck</str>
        <!--<str>elevator</str>-->
      </arr>
    </requestHandler>

________________________________________
From: Geoffrey Young [[hidden email]]
Sent: Friday, July 25, 2008 2:13 PM
To: [hidden email]
Subject: Re: Multiple search components in one handler - ie spellchecker

Andrew Nagy wrote:
> Hello - I am attempting to add the spellCheck component in my
> "search" requesthandler so when a users does a search, they get the
> results and spelling corrections all in one query just like the way
> the facets work.
>
> I am having some trouble accomplishing this - can anyone point me to
> documentation (other than
> http://wiki.apache.org/solr/SpellCheckComponent) on how to do this or
> an example solrconfig that would do this correctly?

http://mail-archives.apache.org/mod_mbox/lucene-solr-user/200806.mbox/%3C44705.76.117.81.167.1214515546.squirrel@...%3E

in general, just add the

   <arr name="last-components">
     <str>spellcheck</str>
   </arr>

bit to your existing handler after following setup in the twiki docs.

you can ignore the part about the exceptions, as that has been fixed in
trunk.

HTH

--Geoff
Reply | Threaded
Open this post in threaded view
|

Re: Multiple search components in one handler - ie spellchecker

Geoffrey Young


Andrew Nagy wrote:
> Thanks for getting back to me Geoff.  Although, that is pretty much
> what I have.  Maybe if I show my solrconfig someone might be able to
> point out what I have incorrect?  The problem is that nothing related
> to the spelling options are show in the results, just the normal
> expected search results.

right.  the spellcheck component does not issue a separate query *after*
running the spellcheck, it merely offers suggestions in parallel with
your existing query.

the results are more like

   "below are the results for $query.  did you mean $suggestions?"

HTH

--Geoff


Reply | Threaded
Open this post in threaded view
|

RE: Multiple search components in one handler - ie spellchecker

Andrew Nagy-2
Exactly - however the spellcheck component is not working for my setup.  The spelling suggestions never show in the response.  I think I have the solrconfig setup incorrectly.  Also my solr/data/spell index that is created is empty.  Something is not configured correctly, any ideas?

Andrew
________________________________________
From: Geoffrey Young [[hidden email]]
Sent: Friday, July 25, 2008 3:04 PM
To: [hidden email]
Subject: Re: Multiple search components in one handler - ie spellchecker

Andrew Nagy wrote:
> Thanks for getting back to me Geoff.  Although, that is pretty much
> what I have.  Maybe if I show my solrconfig someone might be able to
> point out what I have incorrect?  The problem is that nothing related
> to the spelling options are show in the results, just the normal
> expected search results.

right.  the spellcheck component does not issue a separate query *after*
running the spellcheck, it merely offers suggestions in parallel with
your existing query.

the results are more like

   "below are the results for $query.  did you mean $suggestions?"

HTH

--Geoff


Reply | Threaded
Open this post in threaded view
|

Re: Multiple search components in one handler - ie spellchecker

Shalin Shekhar Mangar
On Sat, Jul 26, 2008 at 12:37 AM, Andrew Nagy <[hidden email]>
wrote:

> Exactly - however the spellcheck component is not working for my setup.
>  The spelling suggestions never show in the response.  I think I have the
> solrconfig setup incorrectly.  Also my solr/data/spell index that is created
> is empty.  Something is not configured correctly, any ideas?
>
> Andrew
> ________________________________________
> From: Geoffrey Young [[hidden email]]
> Sent: Friday, July 25, 2008 3:04 PM
> To: [hidden email]
> Subject: Re: Multiple search components in one handler - ie spellchecker
>
> Andrew Nagy wrote:
> > Thanks for getting back to me Geoff.  Although, that is pretty much
> > what I have.  Maybe if I show my solrconfig someone might be able to
> > point out what I have incorrect?  The problem is that nothing related
> > to the spelling options are show in the results, just the normal
> > expected search results.
>
> right.  the spellcheck component does not issue a separate query *after*
> running the spellcheck, it merely offers suggestions in parallel with
> your existing query.
>
> the results are more like
>
>   "below are the results for $query.  did you mean $suggestions?"
>
> HTH
>
> --Geoff
>
>
>
Is the allfields in your spell checker configuration in your schema.xml? Can
you see the spellcheckIndexDir created inside the Solr's data directory?

--
Regards,
Shalin Shekhar Mangar.
Reply | Threaded
Open this post in threaded view
|

RE: SpellCheckComponent problems (was: Multiple search components in one handler - ie spellchecker)

Andrew Nagy-2
Shalin - yes the allfields field exists in my schema.xml file.  It is a field that has all of the text from all of the fields concatenated together into one field.

My spellCheckIndexDir is created and has 2 segment files, but I think the index is empty.  When I initiate the 1st spellcheck.build=true ... the results load immediately ... I would imagine some time delay as it builds the index.

Any other ideas?

Andrew

> -----Original Message-----
> From: Shalin Shekhar Mangar [mailto:[hidden email]]
> Sent: Friday, July 25, 2008 3:35 PM
> To: [hidden email]
> Subject: Re: Multiple search components in one handler - ie
> spellchecker
>
> On Sat, Jul 26, 2008 at 12:37 AM, Andrew Nagy
> <[hidden email]>
> wrote:
>
> > Exactly - however the spellcheck component is not working for my
> setup.
> >  The spelling suggestions never show in the response.  I think I have
> the
> > solrconfig setup incorrectly.  Also my solr/data/spell index that is
> created
> > is empty.  Something is not configured correctly, any ideas?
> >
> > Andrew
> > ________________________________________
> > From: Geoffrey Young [[hidden email]]
> > Sent: Friday, July 25, 2008 3:04 PM
> > To: [hidden email]
> > Subject: Re: Multiple search components in one handler - ie
> spellchecker
> >
> > Andrew Nagy wrote:
> > > Thanks for getting back to me Geoff.  Although, that is pretty much
> > > what I have.  Maybe if I show my solrconfig someone might be able
> to
> > > point out what I have incorrect?  The problem is that nothing
> related
> > > to the spelling options are show in the results, just the normal
> > > expected search results.
> >
> > right.  the spellcheck component does not issue a separate query
> *after*
> > running the spellcheck, it merely offers suggestions in parallel with
> > your existing query.
> >
> > the results are more like
> >
> >   "below are the results for $query.  did you mean $suggestions?"
> >
> > HTH
> >
> > --Geoff
> >
> >
> >
> Is the allfields in your spell checker configuration in your
> schema.xml? Can
> you see the spellcheckIndexDir created inside the Solr's data
> directory?
>
> --
> Regards,
> Shalin Shekhar Mangar.
Reply | Threaded
Open this post in threaded view
|

Re: SpellCheckComponent problems (was: Multiple search components in one handler - ie spellchecker)

Shalin Shekhar Mangar
Can you show us the query you are issuing? Make sure you add spellcheck=true
to the query as a parameter to turn on spell checking.

On Mon, Jul 28, 2008 at 6:16 PM, Andrew Nagy <[hidden email]>wrote:

> Shalin - yes the allfields field exists in my schema.xml file.  It is a
> field that has all of the text from all of the fields concatenated together
> into one field.
>
> My spellCheckIndexDir is created and has 2 segment files, but I think the
> index is empty.  When I initiate the 1st spellcheck.build=true ... the
> results load immediately ... I would imagine some time delay as it builds
> the index.
>
> Any other ideas?
>
> Andrew
>
> > -----Original Message-----
> > From: Shalin Shekhar Mangar [mailto:[hidden email]]
> > Sent: Friday, July 25, 2008 3:35 PM
> > To: [hidden email]
> > Subject: Re: Multiple search components in one handler - ie
> > spellchecker
> >
> > On Sat, Jul 26, 2008 at 12:37 AM, Andrew Nagy
> > <[hidden email]>
> > wrote:
> >
> > > Exactly - however the spellcheck component is not working for my
> > setup.
> > >  The spelling suggestions never show in the response.  I think I have
> > the
> > > solrconfig setup incorrectly.  Also my solr/data/spell index that is
> > created
> > > is empty.  Something is not configured correctly, any ideas?
> > >
> > > Andrew
> > > ________________________________________
> > > From: Geoffrey Young [[hidden email]]
> > > Sent: Friday, July 25, 2008 3:04 PM
> > > To: [hidden email]
> > > Subject: Re: Multiple search components in one handler - ie
> > spellchecker
> > >
> > > Andrew Nagy wrote:
> > > > Thanks for getting back to me Geoff.  Although, that is pretty much
> > > > what I have.  Maybe if I show my solrconfig someone might be able
> > to
> > > > point out what I have incorrect?  The problem is that nothing
> > related
> > > > to the spelling options are show in the results, just the normal
> > > > expected search results.
> > >
> > > right.  the spellcheck component does not issue a separate query
> > *after*
> > > running the spellcheck, it merely offers suggestions in parallel with
> > > your existing query.
> > >
> > > the results are more like
> > >
> > >   "below are the results for $query.  did you mean $suggestions?"
> > >
> > > HTH
> > >
> > > --Geoff
> > >
> > >
> > >
> > Is the allfields in your spell checker configuration in your
> > schema.xml? Can
> > you see the spellcheckIndexDir created inside the Solr's data
> > directory?
> >
> > --
> > Regards,
> > Shalin Shekhar Mangar.
>



--
Regards,
Shalin Shekhar Mangar.
Reply | Threaded
Open this post in threaded view
|

RE: SpellCheckComponent problems (was: Multiple search components in one handler - ie spellchecker)

Andrew Nagy-2
> -----Original Message-----
> From: Shalin Shekhar Mangar [mailto:[hidden email]]
> Sent: Monday, July 28, 2008 10:09 AM
> To: [hidden email]
> Subject: Re: SpellCheckComponent problems (was: Multiple search
> components in one handler - ie spellchecker)
>
> Can you show us the query you are issuing? Make sure you add
> spellcheck=true
> to the query as a parameter to turn on spell checking.

http://localhost:8080/solr/select?q=*:*&spellcheck=true&spellcheck.q=scandanava&spellcheck.build=true

Shows this:
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">73</int>
</lst>
<result name="response" numFound="7650" start="0">
...
</result>
</response>

Andrew
Reply | Threaded
Open this post in threaded view
|

Re: SpellCheckComponent problems (was: Multiple search components in one handler - ie spellchecker)

Shalin Shekhar Mangar
Hi Andrew,

Your configuration which you specified in the earlier thread looks fine.
Your query is also ok. The complete lack of spell check results in the
response you pasted suggests that the SpellCheckComponent is not added to
the SearchHandler's list of components.

Can you check your solrconfig.xml again? I'm sorry but it doesn't seem like
a problem with the spell checker itself. Also check if there are any
exceptions in the Solr log/console.

On Mon, Jul 28, 2008 at 8:32 PM, Andrew Nagy <[hidden email]>wrote:

> > -----Original Message-----
> > From: Shalin Shekhar Mangar [mailto:[hidden email]]
> > Sent: Monday, July 28, 2008 10:09 AM
> > To: [hidden email]
> > Subject: Re: SpellCheckComponent problems (was: Multiple search
> > components in one handler - ie spellchecker)
> >
> > Can you show us the query you are issuing? Make sure you add
> > spellcheck=true
> > to the query as a parameter to turn on spell checking.
>
>
> http://localhost:8080/solr/select?q=*:*&spellcheck=true&spellcheck.q=scandanava&spellcheck.build=true
>
> Shows this:
> <response>
> <lst name="responseHeader">
> <int name="status">0</int>
> <int name="QTime">73</int>
> </lst>
> <result name="response" numFound="7650" start="0">
> ...
> </result>
> </response>
>
> Andrew
>



--
Regards,
Shalin Shekhar Mangar.
Reply | Threaded
Open this post in threaded view
|

RE: SpellCheckComponent problems (was: Multiple search components in one handler - ie spellchecker)

Andrew Nagy-2
I was just reviewing the solr logs and I noticed the following:

Jul 28, 2008 11:52:01 AM org.apache.solr.common.SolrException log
SEVERE: org.apache.solr.common.SolrException: Error loading class 'org.apache.solr.handler.component.SpellCheckComponent'

It looks like the SpellCheckComponent is not getting loaded.  What could cause this?  Im running the july25 nightly build.

Here is a list of the libs from my /tmp/jetty/webapp/WEB-INF/lib dir:
-rw-r--r--  1 root root  84199 Jul 25 08:14 apache-solr-common-nightly.jar
-rw-r--r--  1 root root 889903 Jul 25 08:14 apache-solr-nightly.jar
-rw-r--r--  1 root root  46725 May 10  2007 commons-codec-1.3.jar
-rw-r--r--  1 root root  22017 Jan  6  2008 commons-csv-1.0-SNAPSHOT-r609327.jar
-rw-r--r--  1 root root  53082 Mar  1  2007 commons-fileupload-1.2.jar
-rw-r--r--  1 root root 305001 Sep 11  2007 commons-httpclient-3.1.jar
-rw-r--r--  1 root root  83613 Jun 15  2007 commons-io-1.3.1.jar
-rw-r--r--  1 root root  38015 Jun 14  2007 commons-logging-1.0.4.jar
-rw-r--r--  1 root root 249154 Sep 21  2007 junit-4.3.jar
-rw-r--r--  1 root root 115101 Jun 19 13:46 lucene-analyzers-2.4-dev.jar
-rw-r--r--  1 root root 730352 Jun 19 13:46 lucene-core-2.4-dev.jar
-rw-r--r--  1 root root  87390 Jun 19 13:46 lucene-highlighter-2.4-dev.jar
-rw-r--r--  1 root root  32693 Jun 19 13:46 lucene-queries-2.4-dev.jar
-rw-r--r--  1 root root  91029 Jun 19 13:46 lucene-snowball-2.4-dev.jar
-rw-r--r--  1 root root  18422 Jun 19 13:46 lucene-spellchecker-2.4-dev.jar
-rw-r--r--  1 root root 179348 Jun 14  2007 stax-1.2.0-dev.jar
-rw-r--r--  1 root root  25863 Jun 14  2007 stax-api-1.0.jar
-rw-r--r--  1 root root 128475 Jun 14  2007 stax-utils.jar

could I be missing a jar?

Thanks
Andrew

> -----Original Message-----
> From: Shalin Shekhar Mangar [mailto:[hidden email]]
> Sent: Monday, July 28, 2008 11:24 AM
> To: [hidden email]
> Subject: Re: SpellCheckComponent problems (was: Multiple search
> components in one handler - ie spellchecker)
>
> Hi Andrew,
>
> Your configuration which you specified in the earlier thread looks
> fine.
> Your query is also ok. The complete lack of spell check results in the
> response you pasted suggests that the SpellCheckComponent is not added
> to
> the SearchHandler's list of components.
>
> Can you check your solrconfig.xml again? I'm sorry but it doesn't seem
> like
> a problem with the spell checker itself. Also check if there are any
> exceptions in the Solr log/console.
>
> On Mon, Jul 28, 2008 at 8:32 PM, Andrew Nagy
> <[hidden email]>wrote:
>
> > > -----Original Message-----
> > > From: Shalin Shekhar Mangar [mailto:[hidden email]]
> > > Sent: Monday, July 28, 2008 10:09 AM
> > > To: [hidden email]
> > > Subject: Re: SpellCheckComponent problems (was: Multiple search
> > > components in one handler - ie spellchecker)
> > >
> > > Can you show us the query you are issuing? Make sure you add
> > > spellcheck=true
> > > to the query as a parameter to turn on spell checking.
> >
> >
> >
> http://localhost:8080/solr/select?q=*:*&spellcheck=true&spellcheck.q=sc
> andanava&spellcheck.build=true
> >
> > Shows this:
> > <response>
> > <lst name="responseHeader">
> > <int name="status">0</int>
> > <int name="QTime">73</int>
> > </lst>
> > <result name="response" numFound="7650" start="0">
> > ...
> > </result>
> > </response>
> >
> > Andrew
> >
>
>
>
> --
> Regards,
> Shalin Shekhar Mangar.
Reply | Threaded
Open this post in threaded view
|

Re: SpellCheckComponent problems (was: Multiple search components in one handler - ie spellchecker)

Shalin Shekhar Mangar
No, SpellCheckComponent was in the nightly long before July 25. There must
be a stack trace after that error message. Can you post that?

On Mon, Jul 28, 2008 at 9:26 PM, Andrew Nagy <[hidden email]>wrote:

> I was just reviewing the solr logs and I noticed the following:
>
> Jul 28, 2008 11:52:01 AM org.apache.solr.common.SolrException log
> SEVERE: org.apache.solr.common.SolrException: Error loading class
> 'org.apache.solr.handler.component.SpellCheckComponent'
>
> It looks like the SpellCheckComponent is not getting loaded.  What could
> cause this?  Im running the july25 nightly build.
>
> Here is a list of the libs from my /tmp/jetty/webapp/WEB-INF/lib dir:
> -rw-r--r--  1 root root  84199 Jul 25 08:14 apache-solr-common-nightly.jar
> -rw-r--r--  1 root root 889903 Jul 25 08:14 apache-solr-nightly.jar
> -rw-r--r--  1 root root  46725 May 10  2007 commons-codec-1.3.jar
> -rw-r--r--  1 root root  22017 Jan  6  2008
> commons-csv-1.0-SNAPSHOT-r609327.jar
> -rw-r--r--  1 root root  53082 Mar  1  2007 commons-fileupload-1.2.jar
> -rw-r--r--  1 root root 305001 Sep 11  2007 commons-httpclient-3.1.jar
> -rw-r--r--  1 root root  83613 Jun 15  2007 commons-io-1.3.1.jar
> -rw-r--r--  1 root root  38015 Jun 14  2007 commons-logging-1.0.4.jar
> -rw-r--r--  1 root root 249154 Sep 21  2007 junit-4.3.jar
> -rw-r--r--  1 root root 115101 Jun 19 13:46 lucene-analyzers-2.4-dev.jar
> -rw-r--r--  1 root root 730352 Jun 19 13:46 lucene-core-2.4-dev.jar
> -rw-r--r--  1 root root  87390 Jun 19 13:46 lucene-highlighter-2.4-dev.jar
> -rw-r--r--  1 root root  32693 Jun 19 13:46 lucene-queries-2.4-dev.jar
> -rw-r--r--  1 root root  91029 Jun 19 13:46 lucene-snowball-2.4-dev.jar
> -rw-r--r--  1 root root  18422 Jun 19 13:46 lucene-spellchecker-2.4-dev.jar
> -rw-r--r--  1 root root 179348 Jun 14  2007 stax-1.2.0-dev.jar
> -rw-r--r--  1 root root  25863 Jun 14  2007 stax-api-1.0.jar
> -rw-r--r--  1 root root 128475 Jun 14  2007 stax-utils.jar
>
> could I be missing a jar?
>
> Thanks
> Andrew
>
> > -----Original Message-----
> > From: Shalin Shekhar Mangar [mailto:[hidden email]]
> > Sent: Monday, July 28, 2008 11:24 AM
> > To: [hidden email]
> > Subject: Re: SpellCheckComponent problems (was: Multiple search
> > components in one handler - ie spellchecker)
> >
> > Hi Andrew,
> >
> > Your configuration which you specified in the earlier thread looks
> > fine.
> > Your query is also ok. The complete lack of spell check results in the
> > response you pasted suggests that the SpellCheckComponent is not added
> > to
> > the SearchHandler's list of components.
> >
> > Can you check your solrconfig.xml again? I'm sorry but it doesn't seem
> > like
> > a problem with the spell checker itself. Also check if there are any
> > exceptions in the Solr log/console.
> >
> > On Mon, Jul 28, 2008 at 8:32 PM, Andrew Nagy
> > <[hidden email]>wrote:
> >
> > > > -----Original Message-----
> > > > From: Shalin Shekhar Mangar [mailto:[hidden email]]
> > > > Sent: Monday, July 28, 2008 10:09 AM
> > > > To: [hidden email]
> > > > Subject: Re: SpellCheckComponent problems (was: Multiple search
> > > > components in one handler - ie spellchecker)
> > > >
> > > > Can you show us the query you are issuing? Make sure you add
> > > > spellcheck=true
> > > > to the query as a parameter to turn on spell checking.
> > >
> > >
> > >
> > http://localhost:8080/solr/select?q=*:*&spellcheck=true&spellcheck.q=sc
> > andanava&spellcheck.build=true
> > >
> > > Shows this:
> > > <response>
> > > <lst name="responseHeader">
> > > <int name="status">0</int>
> > > <int name="QTime">73</int>
> > > </lst>
> > > <result name="response" numFound="7650" start="0">
> > > ...
> > > </result>
> > > </response>
> > >
> > > Andrew
> > >
> >
> >
> >
> > --
> > Regards,
> > Shalin Shekhar Mangar.
>



--
Regards,
Shalin Shekhar Mangar.
Reply | Threaded
Open this post in threaded view
|

RE: SpellCheckComponent problems (was: Multiple search components in one handler - ie spellchecker)

Andrew Nagy-2
Hmm ... sorry, that was the output of a java program that uses solr that I ran and noticed the error.  That error doesn't happen when I start solr.  Sorry for the confusion.

I just changed my schema to have a dedicated field for spelling called "spelling" and I created a new field type for the spellcheck component called "textSpell".
Here is the segment of my solrconfig.xml:

<searchComponent name="spellcheck" class="org.apache.solr.handler.component.SpellCheckComponent">
  <lst name="spellchecker">
    <str name="field">spelling</str>
    <str name="accuracy">0.7</str> <!-- 0.5 is the default setting -->
    <str name="spellcheckIndexDir">./spellchecker</str>
  </lst>
  <str name="queryAnalyzerFieldType">textSpell</str>
</searchComponent>
<queryConverter name="queryConverter" class="org.apache.solr.spelling.SpellingQueryConverter"/>
<requestHandler name="/search" class="org.apache.solr.handler.component.SearchHandler">
  <lst name="defaults">
    <str name="echoParams">explicit</str>
  </lst>
  <arr name="last-components">
    <str>spellcheck</str>
    <!--<str>elevator</str>-->
  </arr>
</requestHandler>

I will need to reindex my documents again - I will check to see if that has any effect on my problem.

Andrew


> -----Original Message-----
> From: Shalin Shekhar Mangar [mailto:[hidden email]]
> Sent: Monday, July 28, 2008 12:07 PM
> To: [hidden email]
> Subject: Re: SpellCheckComponent problems (was: Multiple search
> components in one handler - ie spellchecker)
>
> No, SpellCheckComponent was in the nightly long before July 25. There
> must
> be a stack trace after that error message. Can you post that?
>
> On Mon, Jul 28, 2008 at 9:26 PM, Andrew Nagy
> <[hidden email]>wrote:
>
> > I was just reviewing the solr logs and I noticed the following:
> >
> > Jul 28, 2008 11:52:01 AM org.apache.solr.common.SolrException log
> > SEVERE: org.apache.solr.common.SolrException: Error loading class
> > 'org.apache.solr.handler.component.SpellCheckComponent'
> >
> > It looks like the SpellCheckComponent is not getting loaded.  What
> could
> > cause this?  Im running the july25 nightly build.
> >
> > Here is a list of the libs from my /tmp/jetty/webapp/WEB-INF/lib dir:
> > -rw-r--r--  1 root root  84199 Jul 25 08:14 apache-solr-common-
> nightly.jar
> > -rw-r--r--  1 root root 889903 Jul 25 08:14 apache-solr-nightly.jar
> > -rw-r--r--  1 root root  46725 May 10  2007 commons-codec-1.3.jar
> > -rw-r--r--  1 root root  22017 Jan  6  2008
> > commons-csv-1.0-SNAPSHOT-r609327.jar
> > -rw-r--r--  1 root root  53082 Mar  1  2007 commons-fileupload-
> 1.2.jar
> > -rw-r--r--  1 root root 305001 Sep 11  2007 commons-httpclient-
> 3.1.jar
> > -rw-r--r--  1 root root  83613 Jun 15  2007 commons-io-1.3.1.jar
> > -rw-r--r--  1 root root  38015 Jun 14  2007 commons-logging-1.0.4.jar
> > -rw-r--r--  1 root root 249154 Sep 21  2007 junit-4.3.jar
> > -rw-r--r--  1 root root 115101 Jun 19 13:46 lucene-analyzers-2.4-
> dev.jar
> > -rw-r--r--  1 root root 730352 Jun 19 13:46 lucene-core-2.4-dev.jar
> > -rw-r--r--  1 root root  87390 Jun 19 13:46 lucene-highlighter-2.4-
> dev.jar
> > -rw-r--r--  1 root root  32693 Jun 19 13:46 lucene-queries-2.4-
> dev.jar
> > -rw-r--r--  1 root root  91029 Jun 19 13:46 lucene-snowball-2.4-
> dev.jar
> > -rw-r--r--  1 root root  18422 Jun 19 13:46 lucene-spellchecker-2.4-
> dev.jar
> > -rw-r--r--  1 root root 179348 Jun 14  2007 stax-1.2.0-dev.jar
> > -rw-r--r--  1 root root  25863 Jun 14  2007 stax-api-1.0.jar
> > -rw-r--r--  1 root root 128475 Jun 14  2007 stax-utils.jar
> >
> > could I be missing a jar?
> >
> > Thanks
> > Andrew
> >
> > > -----Original Message-----
> > > From: Shalin Shekhar Mangar [mailto:[hidden email]]
> > > Sent: Monday, July 28, 2008 11:24 AM
> > > To: [hidden email]
> > > Subject: Re: SpellCheckComponent problems (was: Multiple search
> > > components in one handler - ie spellchecker)
> > >
> > > Hi Andrew,
> > >
> > > Your configuration which you specified in the earlier thread looks
> > > fine.
> > > Your query is also ok. The complete lack of spell check results in
> the
> > > response you pasted suggests that the SpellCheckComponent is not
> added
> > > to
> > > the SearchHandler's list of components.
> > >
> > > Can you check your solrconfig.xml again? I'm sorry but it doesn't
> seem
> > > like
> > > a problem with the spell checker itself. Also check if there are
> any
> > > exceptions in the Solr log/console.
> > >
> > > On Mon, Jul 28, 2008 at 8:32 PM, Andrew Nagy
> > > <[hidden email]>wrote:
> > >
> > > > > -----Original Message-----
> > > > > From: Shalin Shekhar Mangar [mailto:[hidden email]]
> > > > > Sent: Monday, July 28, 2008 10:09 AM
> > > > > To: [hidden email]
> > > > > Subject: Re: SpellCheckComponent problems (was: Multiple search
> > > > > components in one handler - ie spellchecker)
> > > > >
> > > > > Can you show us the query you are issuing? Make sure you add
> > > > > spellcheck=true
> > > > > to the query as a parameter to turn on spell checking.
> > > >
> > > >
> > > >
> > >
> http://localhost:8080/solr/select?q=*:*&spellcheck=true&spellcheck.q=sc
> > > andanava&spellcheck.build=true
> > > >
> > > > Shows this:
> > > > <response>
> > > > <lst name="responseHeader">
> > > > <int name="status">0</int>
> > > > <int name="QTime">73</int>
> > > > </lst>
> > > > <result name="response" numFound="7650" start="0">
> > > > ...
> > > > </result>
> > > > </response>
> > > >
> > > > Andrew
> > > >
> > >
> > >
> > >
> > > --
> > > Regards,
> > > Shalin Shekhar Mangar.
> >
>
>
>
> --
> Regards,
> Shalin Shekhar Mangar.
Reply | Threaded
Open this post in threaded view
|

RE: SpellCheckComponent problems (was: Multiple search components in one handler - ie spellchecker)

Andrew Nagy-2
In reply to this post by Shalin Shekhar Mangar
Well I will include the stack trace for the aforementioned error:

Jul 28, 2008 12:20:17 PM org.apache.solr.common.SolrException log
SEVERE: org.apache.solr.common.SolrException: Error loading class 'org.apache.solr.handler.component.SpellCheckComponent'
        at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:227)
        at org.apache.solr.core.SolrResourceLoader.newInstance(SolrResourceLoader.java:232)
        at org.apache.solr.util.plugin.AbstractPluginLoader.create(AbstractPluginLoader.java:83)
        at org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:140)
        at org.apache.solr.core.SolrCore.loadSearchComponents(SolrCore.java:565)
        at org.apache.solr.core.SolrCore.<init>(SolrCore.java:371)
        at org.solrmarc.marc.MarcImporter.<init>(MarcImporter.java:95)
        at org.solrmarc.marc.MarcImporter.main(MarcImporter.java:559)
Caused by: java.lang.ClassNotFoundException: org.apache.solr.handler.component.SpellCheckComponent
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:580)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:242)
        at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:211)
        ... 7 more

The line 95 of MarcImporter.java (the solr import program I am using) is the instantiation of SolrCore.  So maybe somehow the spellCheckComponent is not getting loaded?

This is the error output I get thrown by instantiating SolrCore:
org.apache.solr.common.SolrException: Unknown Search Component: spellcheck
        at org.apache.solr.core.SolrCore.getSearchComponent(SolrCore.java:597)
        at org.apache.solr.handler.component.SearchHandler.inform(SearchHandler.java:107)
        at org.apache.solr.core.SolrResourceLoader.inform(SolrResourceLoader.java:264)
        at org.apache.solr.core.SolrCore.<init>(SolrCore.java:398)
        at org.solrmarc.marc.MarcImporter.<init>(MarcImporter.java:95)
        at org.solrmarc.marc.MarcImporter.main(MarcImporter.java:559)

Andrew

> -----Original Message-----
> From: Shalin Shekhar Mangar [mailto:[hidden email]]
> Sent: Monday, July 28, 2008 12:07 PM
> To: [hidden email]
> Subject: Re: SpellCheckComponent problems (was: Multiple search
> components in one handler - ie spellchecker)
>
> No, SpellCheckComponent was in the nightly long before July 25. There
> must
> be a stack trace after that error message. Can you post that?
>
> On Mon, Jul 28, 2008 at 9:26 PM, Andrew Nagy
> <[hidden email]>wrote:
>
> > I was just reviewing the solr logs and I noticed the following:
> >
> > Jul 28, 2008 11:52:01 AM org.apache.solr.common.SolrException log
> > SEVERE: org.apache.solr.common.SolrException: Error loading class
> > 'org.apache.solr.handler.component.SpellCheckComponent'
> >
> > It looks like the SpellCheckComponent is not getting loaded.  What
> could
> > cause this?  Im running the july25 nightly build.
> >
> > Here is a list of the libs from my /tmp/jetty/webapp/WEB-INF/lib dir:
> > -rw-r--r--  1 root root  84199 Jul 25 08:14 apache-solr-common-
> nightly.jar
> > -rw-r--r--  1 root root 889903 Jul 25 08:14 apache-solr-nightly.jar
> > -rw-r--r--  1 root root  46725 May 10  2007 commons-codec-1.3.jar
> > -rw-r--r--  1 root root  22017 Jan  6  2008
> > commons-csv-1.0-SNAPSHOT-r609327.jar
> > -rw-r--r--  1 root root  53082 Mar  1  2007 commons-fileupload-
> 1.2.jar
> > -rw-r--r--  1 root root 305001 Sep 11  2007 commons-httpclient-
> 3.1.jar
> > -rw-r--r--  1 root root  83613 Jun 15  2007 commons-io-1.3.1.jar
> > -rw-r--r--  1 root root  38015 Jun 14  2007 commons-logging-1.0.4.jar
> > -rw-r--r--  1 root root 249154 Sep 21  2007 junit-4.3.jar
> > -rw-r--r--  1 root root 115101 Jun 19 13:46 lucene-analyzers-2.4-
> dev.jar
> > -rw-r--r--  1 root root 730352 Jun 19 13:46 lucene-core-2.4-dev.jar
> > -rw-r--r--  1 root root  87390 Jun 19 13:46 lucene-highlighter-2.4-
> dev.jar
> > -rw-r--r--  1 root root  32693 Jun 19 13:46 lucene-queries-2.4-
> dev.jar
> > -rw-r--r--  1 root root  91029 Jun 19 13:46 lucene-snowball-2.4-
> dev.jar
> > -rw-r--r--  1 root root  18422 Jun 19 13:46 lucene-spellchecker-2.4-
> dev.jar
> > -rw-r--r--  1 root root 179348 Jun 14  2007 stax-1.2.0-dev.jar
> > -rw-r--r--  1 root root  25863 Jun 14  2007 stax-api-1.0.jar
> > -rw-r--r--  1 root root 128475 Jun 14  2007 stax-utils.jar
> >
> > could I be missing a jar?
> >
> > Thanks
> > Andrew
> >
> > > -----Original Message-----
> > > From: Shalin Shekhar Mangar [mailto:[hidden email]]
> > > Sent: Monday, July 28, 2008 11:24 AM
> > > To: [hidden email]
> > > Subject: Re: SpellCheckComponent problems (was: Multiple search
> > > components in one handler - ie spellchecker)
> > >
> > > Hi Andrew,
> > >
> > > Your configuration which you specified in the earlier thread looks
> > > fine.
> > > Your query is also ok. The complete lack of spell check results in
> the
> > > response you pasted suggests that the SpellCheckComponent is not
> added
> > > to
> > > the SearchHandler's list of components.
> > >
> > > Can you check your solrconfig.xml again? I'm sorry but it doesn't
> seem
> > > like
> > > a problem with the spell checker itself. Also check if there are
> any
> > > exceptions in the Solr log/console.
> > >
> > > On Mon, Jul 28, 2008 at 8:32 PM, Andrew Nagy
> > > <[hidden email]>wrote:
> > >
> > > > > -----Original Message-----
> > > > > From: Shalin Shekhar Mangar [mailto:[hidden email]]
> > > > > Sent: Monday, July 28, 2008 10:09 AM
> > > > > To: [hidden email]
> > > > > Subject: Re: SpellCheckComponent problems (was: Multiple search
> > > > > components in one handler - ie spellchecker)
> > > > >
> > > > > Can you show us the query you are issuing? Make sure you add
> > > > > spellcheck=true
> > > > > to the query as a parameter to turn on spell checking.
> > > >
> > > >
> > > >
> > >
> http://localhost:8080/solr/select?q=*:*&spellcheck=true&spellcheck.q=sc
> > > andanava&spellcheck.build=true
> > > >
> > > > Shows this:
> > > > <response>
> > > > <lst name="responseHeader">
> > > > <int name="status">0</int>
> > > > <int name="QTime">73</int>
> > > > </lst>
> > > > <result name="response" numFound="7650" start="0">
> > > > ...
> > > > </result>
> > > > </response>
> > > >
> > > > Andrew
> > > >
> > >
> > >
> > >
> > > --
> > > Regards,
> > > Shalin Shekhar Mangar.
> >
>
>
>
> --
> Regards,
> Shalin Shekhar Mangar.
Reply | Threaded
Open this post in threaded view
|

Re: SpellCheckComponent problems (was: Multiple search components in one handler - ie spellchecker)

Shalin Shekhar Mangar
Well that means the nightly solr jar you are using is older than you think
it is. Try running solr normally without the program and see if you can get
it working.

On Mon, Jul 28, 2008 at 9:54 PM, Andrew Nagy <[hidden email]>wrote:

> Well I will include the stack trace for the aforementioned error:
>
> Jul 28, 2008 12:20:17 PM org.apache.solr.common.SolrException log
> SEVERE: org.apache.solr.common.SolrException: Error loading class
> 'org.apache.solr.handler.component.SpellCheckComponent'
>         at
> org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:227)
>        at
> org.apache.solr.core.SolrResourceLoader.newInstance(SolrResourceLoader.java:232)
>        at
> org.apache.solr.util.plugin.AbstractPluginLoader.create(AbstractPluginLoader.java:83)
>        at
> org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:140)
>        at
> org.apache.solr.core.SolrCore.loadSearchComponents(SolrCore.java:565)
>        at org.apache.solr.core.SolrCore.<init>(SolrCore.java:371)
>        at org.solrmarc.marc.MarcImporter.<init>(MarcImporter.java:95)
>        at org.solrmarc.marc.MarcImporter.main(MarcImporter.java:559)
> Caused by: java.lang.ClassNotFoundException:
> org.apache.solr.handler.component.SpellCheckComponent
>        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>        at java.security.AccessController.doPrivileged(Native Method)
>        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>        at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:580)
>        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
>        at java.lang.Class.forName0(Native Method)
>        at java.lang.Class.forName(Class.java:242)
>        at
> org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:211)
>        ... 7 more
>
> The line 95 of MarcImporter.java (the solr import program I am using) is
> the instantiation of SolrCore.  So maybe somehow the spellCheckComponent is
> not getting loaded?
>
> This is the error output I get thrown by instantiating SolrCore:
> org.apache.solr.common.SolrException: Unknown Search Component: spellcheck
>        at
> org.apache.solr.core.SolrCore.getSearchComponent(SolrCore.java:597)
>        at
> org.apache.solr.handler.component.SearchHandler.inform(SearchHandler.java:107)
>        at
> org.apache.solr.core.SolrResourceLoader.inform(SolrResourceLoader.java:264)
>        at org.apache.solr.core.SolrCore.<init>(SolrCore.java:398)
>        at org.solrmarc.marc.MarcImporter.<init>(MarcImporter.java:95)
>        at org.solrmarc.marc.MarcImporter.main(MarcImporter.java:559)
>
> Andrew
>
> > -----Original Message-----
> > From: Shalin Shekhar Mangar [mailto:[hidden email]]
> > Sent: Monday, July 28, 2008 12:07 PM
> > To: [hidden email]
> > Subject: Re: SpellCheckComponent problems (was: Multiple search
> > components in one handler - ie spellchecker)
> >
> > No, SpellCheckComponent was in the nightly long before July 25. There
> > must
> > be a stack trace after that error message. Can you post that?
> >
> > On Mon, Jul 28, 2008 at 9:26 PM, Andrew Nagy
> > <[hidden email]>wrote:
> >
> > > I was just reviewing the solr logs and I noticed the following:
> > >
> > > Jul 28, 2008 11:52:01 AM org.apache.solr.common.SolrException log
> > > SEVERE: org.apache.solr.common.SolrException: Error loading class
> > > 'org.apache.solr.handler.component.SpellCheckComponent'
> > >
> > > It looks like the SpellCheckComponent is not getting loaded.  What
> > could
> > > cause this?  Im running the july25 nightly build.
> > >
> > > Here is a list of the libs from my /tmp/jetty/webapp/WEB-INF/lib dir:
> > > -rw-r--r--  1 root root  84199 Jul 25 08:14 apache-solr-common-
> > nightly.jar
> > > -rw-r--r--  1 root root 889903 Jul 25 08:14 apache-solr-nightly.jar
> > > -rw-r--r--  1 root root  46725 May 10  2007 commons-codec-1.3.jar
> > > -rw-r--r--  1 root root  22017 Jan  6  2008
> > > commons-csv-1.0-SNAPSHOT-r609327.jar
> > > -rw-r--r--  1 root root  53082 Mar  1  2007 commons-fileupload-
> > 1.2.jar
> > > -rw-r--r--  1 root root 305001 Sep 11  2007 commons-httpclient-
> > 3.1.jar
> > > -rw-r--r--  1 root root  83613 Jun 15  2007 commons-io-1.3.1.jar
> > > -rw-r--r--  1 root root  38015 Jun 14  2007 commons-logging-1.0.4.jar
> > > -rw-r--r--  1 root root 249154 Sep 21  2007 junit-4.3.jar
> > > -rw-r--r--  1 root root 115101 Jun 19 13:46 lucene-analyzers-2.4-
> > dev.jar
> > > -rw-r--r--  1 root root 730352 Jun 19 13:46 lucene-core-2.4-dev.jar
> > > -rw-r--r--  1 root root  87390 Jun 19 13:46 lucene-highlighter-2.4-
> > dev.jar
> > > -rw-r--r--  1 root root  32693 Jun 19 13:46 lucene-queries-2.4-
> > dev.jar
> > > -rw-r--r--  1 root root  91029 Jun 19 13:46 lucene-snowball-2.4-
> > dev.jar
> > > -rw-r--r--  1 root root  18422 Jun 19 13:46 lucene-spellchecker-2.4-
> > dev.jar
> > > -rw-r--r--  1 root root 179348 Jun 14  2007 stax-1.2.0-dev.jar
> > > -rw-r--r--  1 root root  25863 Jun 14  2007 stax-api-1.0.jar
> > > -rw-r--r--  1 root root 128475 Jun 14  2007 stax-utils.jar
> > >
> > > could I be missing a jar?
> > >
> > > Thanks
> > > Andrew
> > >
> > > > -----Original Message-----
> > > > From: Shalin Shekhar Mangar [mailto:[hidden email]]
> > > > Sent: Monday, July 28, 2008 11:24 AM
> > > > To: [hidden email]
> > > > Subject: Re: SpellCheckComponent problems (was: Multiple search
> > > > components in one handler - ie spellchecker)
> > > >
> > > > Hi Andrew,
> > > >
> > > > Your configuration which you specified in the earlier thread looks
> > > > fine.
> > > > Your query is also ok. The complete lack of spell check results in
> > the
> > > > response you pasted suggests that the SpellCheckComponent is not
> > added
> > > > to
> > > > the SearchHandler's list of components.
> > > >
> > > > Can you check your solrconfig.xml again? I'm sorry but it doesn't
> > seem
> > > > like
> > > > a problem with the spell checker itself. Also check if there are
> > any
> > > > exceptions in the Solr log/console.
> > > >
> > > > On Mon, Jul 28, 2008 at 8:32 PM, Andrew Nagy
> > > > <[hidden email]>wrote:
> > > >
> > > > > > -----Original Message-----
> > > > > > From: Shalin Shekhar Mangar [mailto:[hidden email]]
> > > > > > Sent: Monday, July 28, 2008 10:09 AM
> > > > > > To: [hidden email]
> > > > > > Subject: Re: SpellCheckComponent problems (was: Multiple search
> > > > > > components in one handler - ie spellchecker)
> > > > > >
> > > > > > Can you show us the query you are issuing? Make sure you add
> > > > > > spellcheck=true
> > > > > > to the query as a parameter to turn on spell checking.
> > > > >
> > > > >
> > > > >
> > > >
> > http://localhost:8080/solr/select?q=*:*&spellcheck=true&spellcheck.q=sc
> > > > andanava&spellcheck.build=true
> > > > >
> > > > > Shows this:
> > > > > <response>
> > > > > <lst name="responseHeader">
> > > > > <int name="status">0</int>
> > > > > <int name="QTime">73</int>
> > > > > </lst>
> > > > > <result name="response" numFound="7650" start="0">
> > > > > ...
> > > > > </result>
> > > > > </response>
> > > > >
> > > > > Andrew
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Regards,
> > > > Shalin Shekhar Mangar.
> > >
> >
> >
> >
> > --
> > Regards,
> > Shalin Shekhar Mangar.
>



--
Regards,
Shalin Shekhar Mangar.
Reply | Threaded
Open this post in threaded view
|

RE: SpellCheckComponent problems (was: Multiple search components in one handler - ie spellchecker)

Andrew Nagy-2
> -----Original Message-----
> From: Shalin Shekhar Mangar [mailto:[hidden email]]
> Sent: Monday, July 28, 2008 12:38 PM
> To: [hidden email]
> Subject: Re: SpellCheckComponent problems (was: Multiple search
> components in one handler - ie spellchecker)
>
> Well that means the nightly solr jar you are using is older than you
> think
> it is. Try running solr normally without the program and see if you can
> get
> it working.

Well my import program has an older copy of the solr libs ...  so we can ignore that problem.

However my problem still stands when I run solr normally from my July25 snapshot.  There are no errors - and no output to the solr logs when I post a query.

Have you or anyone been able to successfully add the spellcheckcomponent to the default select searchhandler?


Thanks
Andrew