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 Martin <er...@makethembite.com> on 2010/11/17 01:45:16 UTC
Spell Checker
Hi (again)
I am looking at the spell checker options:
http://wiki.apache.org/solr/SpellCheckerRequestHandler#Term_Source_Configura
tion
http://wiki.apache.org/solr/SpellCheckComponent#Use_in_the_Solr_Example
I am looking in my solrconfig.xml and I see one is already in use. I am kind
of confused by this because the recommended spell checker is not default in
my Solr 1.4.1. I have read the documentation but am still fuzzy on what I
should do.
My site uses legal terms and as you can see, some terms don't jive with the
default spell checker so I was hoping to map the spell checker to the body
for referencing dictionary words. I am unclear what approach I should take
and how to start the quest.
Can someone clarify what I should be doing here? Am I on the right track?
Eric
RE: Spell Checker
Posted by Eric Martin <er...@makethembite.com>.
Ah, I thought I was going nuts. Thanks for clarifying about the Wiki.
-----Original Message-----
From: Markus Jelsma [mailto:markus.jelsma@openindex.io]
Sent: Tuesday, November 16, 2010 5:11 PM
To: solr-user@lucene.apache.org
Subject: Re: Spell Checker
> Hi (again)
>
>
>
> I am looking at the spell checker options:
>
>
>
>
http://wiki.apache.org/solr/SpellCheckerRequestHandler#Term_Source_Configur
> a tion
>
>
>
> http://wiki.apache.org/solr/SpellCheckComponent#Use_in_the_Solr_Example
>
>
>
> I am looking in my solrconfig.xml and I see one is already in use. I am
> kind of confused by this because the recommended spell checker is not
> default in my Solr 1.4.1. I have read the documentation but am still fuzzy
> on what I should do.
>
Yes, the wiki on the request handler can be confusing indeed as it discusses
the spellchecker as a request handler instead of a component. Usually,
people
need the spellchecker just as a component in some request handler instead of
a
request handler specifically designed for only spellchecking. I'd forget
about
that wiki and just follow the spellcheck component wiki as it not only
describes the request handler but also the component, and it is being
maintained up to the most recent developments in trunk and branch 3.1.
>
>
> My site uses legal terms and as you can see, some terms don't jive with
the
> default spell checker so I was hoping to map the spell checker to the body
> for referencing dictionary words. I am unclear what approach I should take
> and how to start the quest.
Map the spellchecker to the body of what? I assume the body of your document
where the `main content` is stored. In that case, you'd just follow the wiki
on the component and create a spellchecking fieldType with proper analyzers
(the example allright) and define a spellchecking field that has the
spellcheck
fieldType as type (again, like in the example).
Then you'll need to configure the spellchecking component in your
solrconfig.
The example is, again, what you're looking for. All you need to map your
document's main body to the spellchecker is a copyField directive in your
schema which will copy your body field to the spellcheck field (which has
the
spellcheck fieldType).
The example on the component wiki page should work. Many features have been
added since 1.4.x but the examples should work as expected.
>
>
>
> Can someone clarify what I should be doing here? Am I on the right track?
>
>
>
> Eric
Re: Spell Checker
Posted by Markus Jelsma <ma...@openindex.io>.
> Hi (again)
>
>
>
> I am looking at the spell checker options:
>
>
>
> http://wiki.apache.org/solr/SpellCheckerRequestHandler#Term_Source_Configur
> a tion
>
>
>
> http://wiki.apache.org/solr/SpellCheckComponent#Use_in_the_Solr_Example
>
>
>
> I am looking in my solrconfig.xml and I see one is already in use. I am
> kind of confused by this because the recommended spell checker is not
> default in my Solr 1.4.1. I have read the documentation but am still fuzzy
> on what I should do.
>
Yes, the wiki on the request handler can be confusing indeed as it discusses
the spellchecker as a request handler instead of a component. Usually, people
need the spellchecker just as a component in some request handler instead of a
request handler specifically designed for only spellchecking. I'd forget about
that wiki and just follow the spellcheck component wiki as it not only
describes the request handler but also the component, and it is being
maintained up to the most recent developments in trunk and branch 3.1.
>
>
> My site uses legal terms and as you can see, some terms don't jive with the
> default spell checker so I was hoping to map the spell checker to the body
> for referencing dictionary words. I am unclear what approach I should take
> and how to start the quest.
Map the spellchecker to the body of what? I assume the body of your document
where the `main content` is stored. In that case, you'd just follow the wiki
on the component and create a spellchecking fieldType with proper analyzers
(the example allright) and define a spellchecking field that has the spellcheck
fieldType as type (again, like in the example).
Then you'll need to configure the spellchecking component in your solrconfig.
The example is, again, what you're looking for. All you need to map your
document's main body to the spellchecker is a copyField directive in your
schema which will copy your body field to the spellcheck field (which has the
spellcheck fieldType).
The example on the component wiki page should work. Many features have been
added since 1.4.x but the examples should work as expected.
>
>
>
> Can someone clarify what I should be doing here? Am I on the right track?
>
>
>
> Eric
Re: Spell Checker
Posted by Alexei Martchenko <al...@superdownloads.com.br>.
Config your xml properly, reload your core (or reload solr) then commit.
This spellchecker is configured to build on commit <str
name="buildOnCommit">true</str>. Everytime you commit something, it will
rebuild your dictionary based on the configuration you selected.
2011/8/17 naeluh <na...@gmail.com>
> so I add spellcheck.build=true to solrconfig.xml just anywhere and that
> will
> wrk?
>
> thks very much for your help
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Spell-Checker-tp1914336p3262744.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
--
*Alexei Martchenko* | *CEO* | Superdownloads
alexei@superdownloads.com.br | alexei@martchenko.com.br | (11)
5083.1018/5080.3535/5080.3533
Re: Spell Checker
Posted by Alexei Martchenko <al...@superdownloads.com.br>.
No, if you are trying to build a suggester (what It seems to be) please read
the url I sent you.
You'll need to create the suggester itself <searchComponent
class="solr.SpellCheckComponent" name="suggest">
and the url handler <requestHandler
class="org.apache.solr.handler.component.SearchHandler" name="/suggest">
in your case, to work on that url, just rename it to <requestHandler
class="org.apache.solr.handler.component.SearchHandler" name="/spell">
2011/8/17 naeluh <na...@gmail.com>
> so I add spellcheck.build=true to solrconfig.xml just anywhere and that
> will
> wrk?
>
> thks very much for your help
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Spell-Checker-tp1914336p3262744.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
--
*Alexei Martchenko* | *CEO* | Superdownloads
alexei@superdownloads.com.br | alexei@martchenko.com.br | (11)
5083.1018/5080.3535/5080.3533
Re: Spell Checker
Posted by naeluh <na...@gmail.com>.
so I add spellcheck.build=true to solrconfig.xml just anywhere and that will
wrk?
thks very much for your help
--
View this message in context: http://lucene.472066.n3.nabble.com/Spell-Checker-tp1914336p3262744.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Spell Checker
Posted by Alexei Martchenko <al...@superdownloads.com.br>.
Its not a file, it's a request handler. you add those in the solrconfig.xml
read here plz http://wiki.apache.org/solr/Suggester
2011/8/17 naeluh <na...@gmail.com>
> Hi Dan,
>
> I saw this command -
>
>
> http://localhost:8983/solr/spell?q=ANYTHINGHERE&spellcheck=true&spellcheck.collate=true&spellcheck.build=true
>
> I tried to issue it and got 404 error that I did not have the path
> /solr/spell
> Should I add this file and what type of file is it.
>
> I got to via he post on Drupal - http://drupal.org/node/975132
>
> thanks !
>
> Nick
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Spell-Checker-tp1914336p3262684.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
--
*Alexei Martchenko* | *CEO* | Superdownloads
alexei@superdownloads.com.br | alexei@martchenko.com.br | (11)
5083.1018/5080.3535/5080.3533
RE: Spell Checker
Posted by naeluh <na...@gmail.com>.
Hi Dan,
I saw this command -
http://localhost:8983/solr/spell?q=ANYTHINGHERE&spellcheck=true&spellcheck.collate=true&spellcheck.build=true
I tried to issue it and got 404 error that I did not have the path
/solr/spell
Should I add this file and what type of file is it.
I got to via he post on Drupal - http://drupal.org/node/975132
thanks !
Nick
--
View this message in context: http://lucene.472066.n3.nabble.com/Spell-Checker-tp1914336p3262684.html
Sent from the Solr - User mailing list archive at Nabble.com.
RE: Spell Checker
Posted by Eric Martin <er...@makethembite.com>.
Like a charm Dan, like a charm. I'm going to write this up and post it on
Drupal. Thanks a ton! I have a much better idea of Solr and Did You Mean,
Spell checker
-----Original Message-----
From: Dan Lynn [mailto:dan@danlynn.com]
Sent: Tuesday, November 16, 2010 5:21 PM
To: solr-user@lucene.apache.org
Subject: Re: Spell Checker
See interjected responses below
On 11/16/2010 06:14 PM, Eric Martin wrote:
> Thanks Dan! Few questions:
>
> Use a<copyField> to divert your main text fields to the spell field and
> then configure your spell checker to use the "spell" field to derive the
> spelling index.
Right. A copyField just copies data from one field to another during the
indexing process. You can copy one field to n other fields without
affecting the original.
> This will still keep my current copyfield for the same data, right?
>
> I don't need to rebuild, just reindex.
>
> " After this, you'll need to query a spellcheck-enabled handler with
> spellcheck.build=true or enable spellchecker index builds during
optimize."
If you are using the default solrconfig.xml, a requesthandler should
already be set up for you (but you should need a dedicated one for
production: you can just embed the spell checker component in your
default handler). Just query the example like this:
http://localhost:8983/solr/spell?q=ANYTHINGHERE&spellcheck=true&spellcheck.c
ollate=true&spellcheck.build=true
Note the "spellcheck.build=true" parameter.
Cheers,
Dan
http://twitter.com/danklynn
> Totally lost on that.
>
> I will buy a book here shortly.
>
> -----Original Message-----
> From: Dan Lynn [mailto:dan@danlynn.com]
> Sent: Tuesday, November 16, 2010 5:01 PM
> To: solr-user@lucene.apache.org
> Subject: Re: Spell Checker
>
> I had to deal with spellchecking today a bit. Make sure you are
> performing the analysis step at index-time as such:
>
> schema.xml:
>
> <fieldType name="textSpell" class="solr.TextField"
> positionIncrementGap="100" omitNorms="true">
> <analyzer type="index">
> <tokenizer class="solr.StandardTokenizerFactory"/>
> <filter class="solr.StopFilterFactory" ignoreCase="true"
> words="stopwords.txt"/>
> <filter class="solr.LowerCaseFilterFactory"/>
> <filter class="solr.StandardFilterFactory"/>
> </analyzer>
> <analyzer type="query">
> <tokenizer class="solr.StandardTokenizerFactory"/>
> <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
> ignoreCase="true" expand="true"/>
> <filter class="solr.StopFilterFactory" ignoreCase="true"
> words="stopwords.txt"/>
> <filter class="solr.LowerCaseFilterFactory"/>
> <filter class="solr.StandardFilterFactory"/>
> </analyzer>
> </fieldType>
>
> <fields>
> .....
> <field name="spell" type="textSpell" indexed="true" stored="false"
> multiValued="true"/>
> </fields>
>
> From http://wiki.apache.org/solr/SpellCheckingAnalysis:
>
> Use a<copyField> to divert your main text fields to the spell field
and
> then configure your spell checker to use the "spell" field to derive the
> spelling index.
>
>
> After this, you'll need to query a spellcheck-enabled handler with
> spellcheck.build=true or enable spellchecker index builds during optimize.
>
> Hope this helps,
>
> Dan Lynn
> http://twitter.com/danklynn
>
>
> On 11/16/2010 05:45 PM, Eric Martin wrote:
>> Hi (again)
>>
>>
>>
>> I am looking at the spell checker options:
>>
>>
>>
>>
>
http://wiki.apache.org/solr/SpellCheckerRequestHandler#Term_Source_Configura
>> tion
>>
>>
>>
>> http://wiki.apache.org/solr/SpellCheckComponent#Use_in_the_Solr_Example
>>
>>
>>
>> I am looking in my solrconfig.xml and I see one is already in use. I am
> kind
>> of confused by this because the recommended spell checker is not default
> in
>> my Solr 1.4.1. I have read the documentation but am still fuzzy on what I
>> should do.
>>
>>
>>
>> My site uses legal terms and as you can see, some terms don't jive with
> the
>> default spell checker so I was hoping to map the spell checker to the
body
>> for referencing dictionary words. I am unclear what approach I should
take
>> and how to start the quest.
>>
>>
>>
>> Can someone clarify what I should be doing here? Am I on the right track?
>>
>>
>>
>> Eric
>>
>>
>
RE: Spell Checker
Posted by Eric Martin <er...@makethembite.com>.
Hi:
Ok, I made the changes and have the spell checker build on optimize set to
true. So I guess now, I just reindex. I have to run to class now so I can't
check it for another 30 minutes. Cheers!
-----Original Message-----
From: Dan Lynn [mailto:dan@danlynn.com]
Sent: Tuesday, November 16, 2010 5:21 PM
To: solr-user@lucene.apache.org
Subject: Re: Spell Checker
See interjected responses below
On 11/16/2010 06:14 PM, Eric Martin wrote:
> Thanks Dan! Few questions:
>
> Use a<copyField> to divert your main text fields to the spell field and
> then configure your spell checker to use the "spell" field to derive the
> spelling index.
Right. A copyField just copies data from one field to another during the
indexing process. You can copy one field to n other fields without
affecting the original.
> This will still keep my current copyfield for the same data, right?
>
> I don't need to rebuild, just reindex.
>
> " After this, you'll need to query a spellcheck-enabled handler with
> spellcheck.build=true or enable spellchecker index builds during
optimize."
If you are using the default solrconfig.xml, a requesthandler should
already be set up for you (but you should need a dedicated one for
production: you can just embed the spell checker component in your
default handler). Just query the example like this:
http://localhost:8983/solr/spell?q=ANYTHINGHERE&spellcheck=true&spellcheck.c
ollate=true&spellcheck.build=true
Note the "spellcheck.build=true" parameter.
Cheers,
Dan
http://twitter.com/danklynn
> Totally lost on that.
>
> I will buy a book here shortly.
>
> -----Original Message-----
> From: Dan Lynn [mailto:dan@danlynn.com]
> Sent: Tuesday, November 16, 2010 5:01 PM
> To: solr-user@lucene.apache.org
> Subject: Re: Spell Checker
>
> I had to deal with spellchecking today a bit. Make sure you are
> performing the analysis step at index-time as such:
>
> schema.xml:
>
> <fieldType name="textSpell" class="solr.TextField"
> positionIncrementGap="100" omitNorms="true">
> <analyzer type="index">
> <tokenizer class="solr.StandardTokenizerFactory"/>
> <filter class="solr.StopFilterFactory" ignoreCase="true"
> words="stopwords.txt"/>
> <filter class="solr.LowerCaseFilterFactory"/>
> <filter class="solr.StandardFilterFactory"/>
> </analyzer>
> <analyzer type="query">
> <tokenizer class="solr.StandardTokenizerFactory"/>
> <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
> ignoreCase="true" expand="true"/>
> <filter class="solr.StopFilterFactory" ignoreCase="true"
> words="stopwords.txt"/>
> <filter class="solr.LowerCaseFilterFactory"/>
> <filter class="solr.StandardFilterFactory"/>
> </analyzer>
> </fieldType>
>
> <fields>
> .....
> <field name="spell" type="textSpell" indexed="true" stored="false"
> multiValued="true"/>
> </fields>
>
> From http://wiki.apache.org/solr/SpellCheckingAnalysis:
>
> Use a<copyField> to divert your main text fields to the spell field
and
> then configure your spell checker to use the "spell" field to derive the
> spelling index.
>
>
> After this, you'll need to query a spellcheck-enabled handler with
> spellcheck.build=true or enable spellchecker index builds during optimize.
>
> Hope this helps,
>
> Dan Lynn
> http://twitter.com/danklynn
>
>
> On 11/16/2010 05:45 PM, Eric Martin wrote:
>> Hi (again)
>>
>>
>>
>> I am looking at the spell checker options:
>>
>>
>>
>>
>
http://wiki.apache.org/solr/SpellCheckerRequestHandler#Term_Source_Configura
>> tion
>>
>>
>>
>> http://wiki.apache.org/solr/SpellCheckComponent#Use_in_the_Solr_Example
>>
>>
>>
>> I am looking in my solrconfig.xml and I see one is already in use. I am
> kind
>> of confused by this because the recommended spell checker is not default
> in
>> my Solr 1.4.1. I have read the documentation but am still fuzzy on what I
>> should do.
>>
>>
>>
>> My site uses legal terms and as you can see, some terms don't jive with
> the
>> default spell checker so I was hoping to map the spell checker to the
body
>> for referencing dictionary words. I am unclear what approach I should
take
>> and how to start the quest.
>>
>>
>>
>> Can someone clarify what I should be doing here? Am I on the right track?
>>
>>
>>
>> Eric
>>
>>
>
Re: Spell Checker
Posted by Dan Lynn <da...@danlynn.com>.
See interjected responses below
On 11/16/2010 06:14 PM, Eric Martin wrote:
> Thanks Dan! Few questions:
>
> Use a<copyField> to divert your main text fields to the spell field and
> then configure your spell checker to use the "spell" field to derive the
> spelling index.
Right. A copyField just copies data from one field to another during the
indexing process. You can copy one field to n other fields without
affecting the original.
> This will still keep my current copyfield for the same data, right?
>
> I don't need to rebuild, just reindex.
>
> " After this, you'll need to query a spellcheck-enabled handler with
> spellcheck.build=true or enable spellchecker index builds during optimize."
If you are using the default solrconfig.xml, a requesthandler should
already be set up for you (but you should need a dedicated one for
production: you can just embed the spell checker component in your
default handler). Just query the example like this:
http://localhost:8983/solr/spell?q=ANYTHINGHERE&spellcheck=true&spellcheck.collate=true&spellcheck.build=true
Note the "spellcheck.build=true" parameter.
Cheers,
Dan
http://twitter.com/danklynn
> Totally lost on that.
>
> I will buy a book here shortly.
>
> -----Original Message-----
> From: Dan Lynn [mailto:dan@danlynn.com]
> Sent: Tuesday, November 16, 2010 5:01 PM
> To: solr-user@lucene.apache.org
> Subject: Re: Spell Checker
>
> I had to deal with spellchecking today a bit. Make sure you are
> performing the analysis step at index-time as such:
>
> schema.xml:
>
> <fieldType name="textSpell" class="solr.TextField"
> positionIncrementGap="100" omitNorms="true">
> <analyzer type="index">
> <tokenizer class="solr.StandardTokenizerFactory"/>
> <filter class="solr.StopFilterFactory" ignoreCase="true"
> words="stopwords.txt"/>
> <filter class="solr.LowerCaseFilterFactory"/>
> <filter class="solr.StandardFilterFactory"/>
> </analyzer>
> <analyzer type="query">
> <tokenizer class="solr.StandardTokenizerFactory"/>
> <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
> ignoreCase="true" expand="true"/>
> <filter class="solr.StopFilterFactory" ignoreCase="true"
> words="stopwords.txt"/>
> <filter class="solr.LowerCaseFilterFactory"/>
> <filter class="solr.StandardFilterFactory"/>
> </analyzer>
> </fieldType>
>
> <fields>
> .....
> <field name="spell" type="textSpell" indexed="true" stored="false"
> multiValued="true"/>
> </fields>
>
> From http://wiki.apache.org/solr/SpellCheckingAnalysis:
>
> Use a<copyField> to divert your main text fields to the spell field and
> then configure your spell checker to use the "spell" field to derive the
> spelling index.
>
>
> After this, you'll need to query a spellcheck-enabled handler with
> spellcheck.build=true or enable spellchecker index builds during optimize.
>
> Hope this helps,
>
> Dan Lynn
> http://twitter.com/danklynn
>
>
> On 11/16/2010 05:45 PM, Eric Martin wrote:
>> Hi (again)
>>
>>
>>
>> I am looking at the spell checker options:
>>
>>
>>
>>
> http://wiki.apache.org/solr/SpellCheckerRequestHandler#Term_Source_Configura
>> tion
>>
>>
>>
>> http://wiki.apache.org/solr/SpellCheckComponent#Use_in_the_Solr_Example
>>
>>
>>
>> I am looking in my solrconfig.xml and I see one is already in use. I am
> kind
>> of confused by this because the recommended spell checker is not default
> in
>> my Solr 1.4.1. I have read the documentation but am still fuzzy on what I
>> should do.
>>
>>
>>
>> My site uses legal terms and as you can see, some terms don't jive with
> the
>> default spell checker so I was hoping to map the spell checker to the body
>> for referencing dictionary words. I am unclear what approach I should take
>> and how to start the quest.
>>
>>
>>
>> Can someone clarify what I should be doing here? Am I on the right track?
>>
>>
>>
>> Eric
>>
>>
>
RE: Spell Checker
Posted by Eric Martin <er...@makethembite.com>.
Thanks Dan! Few questions:
Use a<copyField> to divert your main text fields to the spell field and
then configure your spell checker to use the "spell" field to derive the
spelling index.
This will still keep my current copyfield for the same data, right?
I don't need to rebuild, just reindex.
" After this, you'll need to query a spellcheck-enabled handler with
spellcheck.build=true or enable spellchecker index builds during optimize."
Totally lost on that.
I will buy a book here shortly.
-----Original Message-----
From: Dan Lynn [mailto:dan@danlynn.com]
Sent: Tuesday, November 16, 2010 5:01 PM
To: solr-user@lucene.apache.org
Subject: Re: Spell Checker
I had to deal with spellchecking today a bit. Make sure you are
performing the analysis step at index-time as such:
schema.xml:
<fieldType name="textSpell" class="solr.TextField"
positionIncrementGap="100" omitNorms="true">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.StandardFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
ignoreCase="true" expand="true"/>
<filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.StandardFilterFactory"/>
</analyzer>
</fieldType>
<fields>
.....
<field name="spell" type="textSpell" indexed="true" stored="false"
multiValued="true"/>
</fields>
From http://wiki.apache.org/solr/SpellCheckingAnalysis:
Use a<copyField> to divert your main text fields to the spell field and
then configure your spell checker to use the "spell" field to derive the
spelling index.
After this, you'll need to query a spellcheck-enabled handler with
spellcheck.build=true or enable spellchecker index builds during optimize.
Hope this helps,
Dan Lynn
http://twitter.com/danklynn
On 11/16/2010 05:45 PM, Eric Martin wrote:
> Hi (again)
>
>
>
> I am looking at the spell checker options:
>
>
>
>
http://wiki.apache.org/solr/SpellCheckerRequestHandler#Term_Source_Configura
> tion
>
>
>
> http://wiki.apache.org/solr/SpellCheckComponent#Use_in_the_Solr_Example
>
>
>
> I am looking in my solrconfig.xml and I see one is already in use. I am
kind
> of confused by this because the recommended spell checker is not default
in
> my Solr 1.4.1. I have read the documentation but am still fuzzy on what I
> should do.
>
>
>
> My site uses legal terms and as you can see, some terms don't jive with
the
> default spell checker so I was hoping to map the spell checker to the body
> for referencing dictionary words. I am unclear what approach I should take
> and how to start the quest.
>
>
>
> Can someone clarify what I should be doing here? Am I on the right track?
>
>
>
> Eric
>
>
Re: Spell Checker
Posted by Dan Lynn <da...@danlynn.com>.
I had to deal with spellchecking today a bit. Make sure you are
performing the analysis step at index-time as such:
schema.xml:
<fieldType name="textSpell" class="solr.TextField"
positionIncrementGap="100" omitNorms="true">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.StandardFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
ignoreCase="true" expand="true"/>
<filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.StandardFilterFactory"/>
</analyzer>
</fieldType>
<fields>
.....
<field name="spell" type="textSpell" indexed="true" stored="false"
multiValued="true"/>
</fields>
From http://wiki.apache.org/solr/SpellCheckingAnalysis:
Use a<copyField> to divert your main text fields to the spell field and then configure your spell checker to use the "spell" field to derive the spelling index.
After this, you'll need to query a spellcheck-enabled handler with
spellcheck.build=true or enable spellchecker index builds during optimize.
Hope this helps,
Dan Lynn
http://twitter.com/danklynn
On 11/16/2010 05:45 PM, Eric Martin wrote:
> Hi (again)
>
>
>
> I am looking at the spell checker options:
>
>
>
> http://wiki.apache.org/solr/SpellCheckerRequestHandler#Term_Source_Configura
> tion
>
>
>
> http://wiki.apache.org/solr/SpellCheckComponent#Use_in_the_Solr_Example
>
>
>
> I am looking in my solrconfig.xml and I see one is already in use. I am kind
> of confused by this because the recommended spell checker is not default in
> my Solr 1.4.1. I have read the documentation but am still fuzzy on what I
> should do.
>
>
>
> My site uses legal terms and as you can see, some terms don't jive with the
> default spell checker so I was hoping to map the spell checker to the body
> for referencing dictionary words. I am unclear what approach I should take
> and how to start the quest.
>
>
>
> Can someone clarify what I should be doing here? Am I on the right track?
>
>
>
> Eric
>
>