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 "Villemos, Gert" <ge...@logica.com> on 2009/09/17 15:40:53 UTC

Spell checking not working

I'm trying to setup a spell checker but failing misserably. I would like
to have a spell check based on actual values injected into the index
from other fields. The configuration is shown below.
 
After indexing and running a query with 'spellcheck.build=true' I can
see that the spellcheck index files updates, i.e. data must is being
injected. I can also see that the injected documents have 'spell'
fields, such as 'spell=closed'. I would therefore expect that a search
for 'clo' would return these as suggestions.
 
But I have tried the queries;
    [url]/solr/select?qt=huginn&q=clo&spellcheck=true
    [url]/solr/select?qt=huginn&q=clo*&spellcheck=true
    [url]/solr/select?qt=huginn&spell:clo&spellcheck=true
    [url]/solr/select?qt=huginn&spell:clo*&spellcheck=true
 
With no effect. I do not get any hits back. What am I doing wrong?
 
Cheers,
Gert.
 
 
 
 
 
------------------ SCHEMA.XML
-----------------------------------------------------------------
 
<fieldType name="testSpell" class="solr.TextField"
positionIncrementGap="100">
    <analyzer>
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
    </analyzer>
</types>
 
 
<fields>
    ...
    <field name="ieStatus" type="text" indexed="true" stored="true"
multiValued="true"/> 
    <field name="spell" type="textSpell" indexed="true" stored="true"
multiValued="true"/> 
</fields>
 
<copyField source="ieStatus" dest="spell"/>
 
 
 
 
 
------------------ SOLRCONFIG.XML
-----------------------------------------------------------
 
<requestHanlder name="huginn" class="solr.SearchHandler" default="true">
    <lst name="defaults">
        ... [setup as dismax handler]]
    <lst>
 
    <arr name="last-components">
        <str>spellcheck</str>
    </arr>
</requestHandler>
 
 
<searchComponent name="spellcheck" class="solr.SpellCheckComponent">
 
    <str name="queryAnalyzerFieldType">textSpell</str>
 
    <lst name="spellchecker">
        <str name="name">default</str>
        <str name="field">spell</str>
        <str name="spellCheckIndexDir">./spellcheck/default</str>
        <str name="accuracy">0.5</str>
    </lst>
</searchComponent>
 
 
 


Please help Logica to respect the environment by not printing this email  / Pour contribuer comme Logica au respect de l'environnement, merci de ne pas imprimer ce mail /  Bitte drucken Sie diese Nachricht nicht aus und helfen Sie so Logica dabei, die Umwelt zu sch�tzen. /  Por favor ajude a Logica a respeitar o ambiente nao imprimindo este correio electronico.



This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.


RE: Spell checking not working

Posted by "Villemos, Gert" <ge...@logica.com>.
I typed in the configuration manually and made a mistake. In the actual configuration the field is named correctly, i.e. this is unfortunately not the mistake.

I have attached my configuration files to make sure the same mistake doesn't happen again.

Any ideas anyone?

Gert.




-----Original Message-----
From: Avlesh Singh [mailto:avlesh@gmail.com] 
Sent: Donnerstag, 17. September 2009 19:21
To: solr-user@lucene.apache.org
Subject: Re: Spell checking not working

A typo, I think is the reason ...

<fieldType name="testSpell" class="solr.TextField"
> positionIncrementGap="100">

<field name="spell" type="textSpell" indexed="true" stored="true"
> multiValued="true"/>
>

In the fieldType definition the field name is "testSpell" but the field
called "spell" uses a type called "textSpell".
Please revert back if this is not the reason.

Cheers
Avlesh

On Thu, Sep 17, 2009 at 7:10 PM, Villemos, Gert <ge...@logica.com>wrote:

> I'm trying to setup a spell checker but failing misserably. I would like
> to have a spell check based on actual values injected into the index
> from other fields. The configuration is shown below.
>
> After indexing and running a query with 'spellcheck.build=true' I can
> see that the spellcheck index files updates, i.e. data must is being
> injected. I can also see that the injected documents have 'spell'
> fields, such as 'spell=closed'. I would therefore expect that a search
> for 'clo' would return these as suggestions.
>
> But I have tried the queries;
>    [url]/solr/select?qt=huginn&q=clo&spellcheck=true
>    [url]/solr/select?qt=huginn&q=clo*&spellcheck=true
>    [url]/solr/select?qt=huginn&spell:clo&spellcheck=true
>    [url]/solr/select?qt=huginn&spell:clo*&spellcheck=true
>
> With no effect. I do not get any hits back. What am I doing wrong?
>
> Cheers,
> Gert.
>
>
>
>
>
> ------------------ SCHEMA.XML
> -----------------------------------------------------------------
>
> <fieldType name="testSpell" class="solr.TextField"
> positionIncrementGap="100">
>    <analyzer>
>        <tokenizer class="solr.StandardTokenizerFactory"/>
>        <filter class="solr.LowerCaseFilterFactory"/>
>        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
>    </analyzer>
> </types>
>
>
> <fields>
>    ...
>    <field name="ieStatus" type="text" indexed="true" stored="true"
> multiValued="true"/>
>    <field name="spell" type="textSpell" indexed="true" stored="true"
> multiValued="true"/>
> </fields>
>
> <copyField source="ieStatus" dest="spell"/>
>
>
>
>
>
> ------------------ SOLRCONFIG.XML
> -----------------------------------------------------------
>
> <requestHanlder name="huginn" class="solr.SearchHandler" default="true">
>    <lst name="defaults">
>        ... [setup as dismax handler]]
>    <lst>
>
>    <arr name="last-components">
>        <str>spellcheck</str>
>    </arr>
> </requestHandler>
>
>
> <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
>
>    <str name="queryAnalyzerFieldType">textSpell</str>
>
>    <lst name="spellchecker">
>        <str name="name">default</str>
>        <str name="field">spell</str>
>        <str name="spellCheckIndexDir">./spellcheck/default</str>
>        <str name="accuracy">0.5</str>
>    </lst>
> </searchComponent>
>
>
>
>
>
> Please help Logica to respect the environment by not printing this email  /
> Pour contribuer comme Logica au respect de l'environnement, merci de ne pas
> imprimer ce mail /  Bitte drucken Sie diese Nachricht nicht aus und helfen
> Sie so Logica dabei, die Umwelt zu schützen. /  Por favor ajude a Logica a
> respeitar o ambiente nao imprimindo este correio electronico.
>
>
>
> This e-mail and any attachment is for authorised use by the intended
> recipient(s) only. It may contain proprietary material, confidential
> information and/or be subject to legal privilege. It should not be copied,
> disclosed to, retained or used by, any other party. If you are not an
> intended recipient then please promptly delete this e-mail and any
> attachment and all copies and inform the sender. Thank you.
>
>


Please help Logica to respect the environment by not printing this email  / Pour contribuer comme Logica au respect de l'environnement, merci de ne pas imprimer ce mail /  Bitte drucken Sie diese Nachricht nicht aus und helfen Sie so Logica dabei, die Umwelt zu schützen. /  Por favor ajude a Logica a respeitar o ambiente nao imprimindo este correio electronico.



This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.


Re: Spell checking not working

Posted by Avlesh Singh <av...@gmail.com>.
A typo, I think is the reason ...

<fieldType name="testSpell" class="solr.TextField"
> positionIncrementGap="100">

<field name="spell" type="textSpell" indexed="true" stored="true"
> multiValued="true"/>
>

In the fieldType definition the field name is "testSpell" but the field
called "spell" uses a type called "textSpell".
Please revert back if this is not the reason.

Cheers
Avlesh

On Thu, Sep 17, 2009 at 7:10 PM, Villemos, Gert <ge...@logica.com>wrote:

> I'm trying to setup a spell checker but failing misserably. I would like
> to have a spell check based on actual values injected into the index
> from other fields. The configuration is shown below.
>
> After indexing and running a query with 'spellcheck.build=true' I can
> see that the spellcheck index files updates, i.e. data must is being
> injected. I can also see that the injected documents have 'spell'
> fields, such as 'spell=closed'. I would therefore expect that a search
> for 'clo' would return these as suggestions.
>
> But I have tried the queries;
>    [url]/solr/select?qt=huginn&q=clo&spellcheck=true
>    [url]/solr/select?qt=huginn&q=clo*&spellcheck=true
>    [url]/solr/select?qt=huginn&spell:clo&spellcheck=true
>    [url]/solr/select?qt=huginn&spell:clo*&spellcheck=true
>
> With no effect. I do not get any hits back. What am I doing wrong?
>
> Cheers,
> Gert.
>
>
>
>
>
> ------------------ SCHEMA.XML
> -----------------------------------------------------------------
>
> <fieldType name="testSpell" class="solr.TextField"
> positionIncrementGap="100">
>    <analyzer>
>        <tokenizer class="solr.StandardTokenizerFactory"/>
>        <filter class="solr.LowerCaseFilterFactory"/>
>        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
>    </analyzer>
> </types>
>
>
> <fields>
>    ...
>    <field name="ieStatus" type="text" indexed="true" stored="true"
> multiValued="true"/>
>    <field name="spell" type="textSpell" indexed="true" stored="true"
> multiValued="true"/>
> </fields>
>
> <copyField source="ieStatus" dest="spell"/>
>
>
>
>
>
> ------------------ SOLRCONFIG.XML
> -----------------------------------------------------------
>
> <requestHanlder name="huginn" class="solr.SearchHandler" default="true">
>    <lst name="defaults">
>        ... [setup as dismax handler]]
>    <lst>
>
>    <arr name="last-components">
>        <str>spellcheck</str>
>    </arr>
> </requestHandler>
>
>
> <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
>
>    <str name="queryAnalyzerFieldType">textSpell</str>
>
>    <lst name="spellchecker">
>        <str name="name">default</str>
>        <str name="field">spell</str>
>        <str name="spellCheckIndexDir">./spellcheck/default</str>
>        <str name="accuracy">0.5</str>
>    </lst>
> </searchComponent>
>
>
>
>
>
> Please help Logica to respect the environment by not printing this email  /
> Pour contribuer comme Logica au respect de l'environnement, merci de ne pas
> imprimer ce mail /  Bitte drucken Sie diese Nachricht nicht aus und helfen
> Sie so Logica dabei, die Umwelt zu schützen. /  Por favor ajude a Logica a
> respeitar o ambiente nao imprimindo este correio electronico.
>
>
>
> This e-mail and any attachment is for authorised use by the intended
> recipient(s) only. It may contain proprietary material, confidential
> information and/or be subject to legal privilege. It should not be copied,
> disclosed to, retained or used by, any other party. If you are not an
> intended recipient then please promptly delete this e-mail and any
> attachment and all copies and inform the sender. Thank you.
>
>