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 Raheel Hasan <ra...@gmail.com> on 2013/05/31 16:37:38 UTC

Spell Checker (DirectSolrSpellChecker) correct settings

Hi guyz, I am new to solr. Here is the thing I have:

When i search "Courtt", I get correct suggestion saying:

------------------------------------------------

"spellcheck": {
    "suggestions": [
      "courtt",
      {
        "numFound": 1,
        "startOffset": 0,
        "endOffset": 6,
        "suggestion": [
          "court"
        ]
      },
      "collation",
      [
        "collationQuery",
        "court",
        "hits",
        53,
        "misspellingsAndCorrections",
        [
          "courtt",
          "court"
        ]
      ]
    ]
  },

------------------------------------------------

But when I try "Provincial Courtt", it gives me no suggestions, instead it
searches for "Provincial" only.


Here is the spell check settings in *solrconfig.xml*:
<searchComponent name="spellcheck" class="solr.SpellCheckComponent">

    <str name="queryAnalyzerFieldType">text_en_splitting</str>

    <!-- a spellchecker built from a field of the main index -->
    <lst name="spellchecker">
      <str name="name">default</str>
      <str name="classname">solr.DirectSolrSpellChecker</str>
      <str name="field">text</str>

      <!-- minimum accuracy needed to be considered a valid spellcheck
suggestion -->
      <float name="accuracy">0.5</float>
      <!-- Require terms to occur in 1% of documents in order to be
included in the dictionary -->
      <float name="thresholdTokenFrequency">.01</float>
      <!-- the spellcheck distance measure used, the default is the
internal levenshtein -->
      <!--<str name="distanceMeasure">internal</str>-->
      <!-- the maximum #edits we consider when enumerating terms: can be 1
or 2 -->
      <int name="maxEdits">1</int>
      <!-- the minimum number of characters the terms should share -->
      <int name="minPrefix">3</int>
      <!-- maximum number of possible matches to review before returning
results -->
      <int name="maxInspections">3</int>
      <!-- minimum length of a query term to be considered for correction
-->
      <int name="minQueryLength">4</int>
      <!-- maximum threshold of documents a query term can appear to be
considered for correction -->
      <float name="maxQueryFrequency">0.01</float>
    </lst>


    <!-- a spellchecker that can break or combine words.  See "/spell"
handler below for usage -->
    <lst name="spellchecker">
      <str name="name">wordbreak</str>
      <str name="classname">solr.WordBreakSolrSpellChecker</str>
      <str name="field">text</str>
      <str name="combineWords">true</str>
      <str name="breakWords">true</str>
      <int name="maxChanges">5</int>
    </lst>
  </searchComponent>

------------------------------------------------

Here is the *requestHandler*:

<requestHandler name="/select" class="solr.SearchHandler">
     <lst name="defaults">
       <str name="echoParams">explicit</str>
       <int name="rows">20</int>
       <str name="df">text</str>

       <!-- Spell checking defaults -->
       <str name="spellcheck">on</str>
       <str name="spellcheck.count">5</str>
       <str name="spellcheck.onlyMorePopular">true</str>
       <str name="spellcheck.maxResultsForSuggest">5</str>
       <str name="spellcheck.alternativeTermCount">2</str>
       <str name="spellcheck.extendedResults">false</str>

       <str name="spellcheck.collate">true</str>
       <str name="spellcheck.maxCollations">3</str>
       <str name="spellcheck.maxCollationTries">3</str>
       <str name="spellcheck.collateExtendedResults">true</str>
     </lst>

     <!-- append spellchecking to our list of components -->
     <arr name="last-components">
       <str>spellcheck</str>
     </arr>

  </requestHandler>



-- 
Regards,
Raheel Hasan

Re: Spell Checker (DirectSolrSpellChecker) correct settings

Posted by Raheel Hasan <ra...@gmail.com>.
Here is the query request string:
http://localhost:8983/solr/......./select?q=Provinci+Courtt&wt=xml&indent=true

So you see, its just simple. Thats because all items are defined in the
solrconfig.xml requestHandler for select, instead of being passed in the
query string. They were all posted in the first msg of this conversation.


----------------»

Here is the idea:

You google up the following: "ok thank alot for the fantastic explaination"
and you see the suggestions: "Did you mean: ok *thanks *alot for the
fantastic *explanation*"

I cant build this without getting corect suggestions...

«--------------





On Mon, Jun 3, 2013 at 8:44 PM, Dyer, James <Ja...@ingramcontent.com>wrote:

> For each fot he 4 cases listed below, can you give your query request
> string (q=...fq=...qt=...etc) and also the spellchecker output?
>
> James Dyer
> Ingram Content Group
> (615) 213-4311
>
>
> -----Original Message-----
> From: Raheel Hasan [mailto:raheelhasan.fsd@gmail.com]
> Sent: Monday, June 03, 2013 10:22 AM
> To: solr-user@lucene.apache.org
> Subject: Re: Spell Checker (DirectSolrSpellChecker) correct settings
>
> Hi, thanks a lot for the reply.
>
> Actually, "Provincial Courtt" is mentioned in many documents (sorry about
> the type earlier).
>
> Secondly, I tried your idea, but not much of help. The issue is very
> microscopic:
>
> 1) When I search for "Provinciaal Courtt" = it only suggests `<str name=
> "courtt">court</str>` and not "Provincial"
> 2) Search for "Provincial Courtt" = returns result for 'Provincial' keyword
> and no suggestion for 'court'.
> 3) Search for "Provinciaal Court" = no suggestion; instead searches for
> "court" and returns result.
> 4) Search for "Provinciall Courtt" = correct suggestions..
>
>
>
>
>
>
> On Mon, Jun 3, 2013 at 7:55 PM, Dyer, James <James.Dyer@ingramcontent.com
> >wrote:
>
> > My first guess is that no documents match the query "provinical court".
> >  Because you have "spellcheck.maxCollationTries" set to a non-zero value,
> > it will not return these as collations unless the correction will return
> > hits.  You can test my theory out by removing
> > "spellcheck.maxCollationTries" from the request and see if it returns
> > "provinical court" as expected.
> >
> > If this isn't it, then give us the full query request and also the full
> > spellcheck response for your failing case.
> >
> > James Dyer
> > Ingram Content Group
> > (615) 213-4311
> >
> >
> > -----Original Message-----
> > From: Raheel Hasan [mailto:raheelhasan.fsd@gmail.com]
> > Sent: Friday, May 31, 2013 9:38 AM
> > To: solr-user@lucene.apache.org
> > Subject: Spell Checker (DirectSolrSpellChecker) correct settings
> >
> > Hi guyz, I am new to solr. Here is the thing I have:
> >
> > When i search "Courtt", I get correct suggestion saying:
> >
> > ------------------------------------------------
> >
> > "spellcheck": {
> >     "suggestions": [
> >       "courtt",
> >       {
> >         "numFound": 1,
> >         "startOffset": 0,
> >         "endOffset": 6,
> >         "suggestion": [
> >           "court"
> >         ]
> >       },
> >       "collation",
> >       [
> >         "collationQuery",
> >         "court",
> >         "hits",
> >         53,
> >         "misspellingsAndCorrections",
> >         [
> >           "courtt",
> >           "court"
> >         ]
> >       ]
> >     ]
> >   },
> >
> > ------------------------------------------------
> >
> > But when I try "Provincial Courtt", it gives me no suggestions, instead
> it
> > searches for "Provincial" only.
> >
> >
> > Here is the spell check settings in *solrconfig.xml*:
> > <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
> >
> >     <str name="queryAnalyzerFieldType">text_en_splitting</str>
> >
> >     <!-- a spellchecker built from a field of the main index -->
> >     <lst name="spellchecker">
> >       <str name="name">default</str>
> >       <str name="classname">solr.DirectSolrSpellChecker</str>
> >       <str name="field">text</str>
> >
> >       <!-- minimum accuracy needed to be considered a valid spellcheck
> > suggestion -->
> >       <float name="accuracy">0.5</float>
> >       <!-- Require terms to occur in 1% of documents in order to be
> > included in the dictionary -->
> >       <float name="thresholdTokenFrequency">.01</float>
> >       <!-- the spellcheck distance measure used, the default is the
> > internal levenshtein -->
> >       <!--<str name="distanceMeasure">internal</str>-->
> >       <!-- the maximum #edits we consider when enumerating terms: can be
> 1
> > or 2 -->
> >       <int name="maxEdits">1</int>
> >       <!-- the minimum number of characters the terms should share -->
> >       <int name="minPrefix">3</int>
> >       <!-- maximum number of possible matches to review before returning
> > results -->
> >       <int name="maxInspections">3</int>
> >       <!-- minimum length of a query term to be considered for correction
> > -->
> >       <int name="minQueryLength">4</int>
> >       <!-- maximum threshold of documents a query term can appear to be
> > considered for correction -->
> >       <float name="maxQueryFrequency">0.01</float>
> >     </lst>
> >
> >
> >     <!-- a spellchecker that can break or combine words.  See "/spell"
> > handler below for usage -->
> >     <lst name="spellchecker">
> >       <str name="name">wordbreak</str>
> >       <str name="classname">solr.WordBreakSolrSpellChecker</str>
> >       <str name="field">text</str>
> >       <str name="combineWords">true</str>
> >       <str name="breakWords">true</str>
> >       <int name="maxChanges">5</int>
> >     </lst>
> >   </searchComponent>
> >
> > ------------------------------------------------
> >
> > Here is the *requestHandler*:
> >
> > <requestHandler name="/select" class="solr.SearchHandler">
> >      <lst name="defaults">
> >        <str name="echoParams">explicit</str>
> >        <int name="rows">20</int>
> >        <str name="df">text</str>
> >
> >        <!-- Spell checking defaults -->
> >        <str name="spellcheck">on</str>
> >        <str name="spellcheck.count">5</str>
> >        <str name="spellcheck.onlyMorePopular">true</str>
> >        <str name="spellcheck.maxResultsForSuggest">5</str>
> >        <str name="spellcheck.alternativeTermCount">2</str>
> >        <str name="spellcheck.extendedResults">false</str>
> >
> >        <str name="spellcheck.collate">true</str>
> >        <str name="spellcheck.maxCollations">3</str>
> >        <str name="spellcheck.maxCollationTries">3</str>
> >        <str name="spellcheck.collateExtendedResults">true</str>
> >      </lst>
> >
> >      <!-- append spellchecking to our list of components -->
> >      <arr name="last-components">
> >        <str>spellcheck</str>
> >      </arr>
> >
> >   </requestHandler>
> >
> >
> >
> > --
> > Regards,
> > Raheel Hasan
> >
> >
>
>
> --
> Regards,
> Raheel Hasan
>
>


-- 
Regards,
Raheel Hasan

RE: Spell Checker (DirectSolrSpellChecker) correct settings

Posted by "Dyer, James" <Ja...@ingramcontent.com>.
For each fot he 4 cases listed below, can you give your query request string (q=...fq=...qt=...etc) and also the spellchecker output?

James Dyer
Ingram Content Group
(615) 213-4311


-----Original Message-----
From: Raheel Hasan [mailto:raheelhasan.fsd@gmail.com] 
Sent: Monday, June 03, 2013 10:22 AM
To: solr-user@lucene.apache.org
Subject: Re: Spell Checker (DirectSolrSpellChecker) correct settings

Hi, thanks a lot for the reply.

Actually, "Provincial Courtt" is mentioned in many documents (sorry about
the type earlier).

Secondly, I tried your idea, but not much of help. The issue is very
microscopic:

1) When I search for "Provinciaal Courtt" = it only suggests `<str name=
"courtt">court</str>` and not "Provincial"
2) Search for "Provincial Courtt" = returns result for 'Provincial' keyword
and no suggestion for 'court'.
3) Search for "Provinciaal Court" = no suggestion; instead searches for
"court" and returns result.
4) Search for "Provinciall Courtt" = correct suggestions..






On Mon, Jun 3, 2013 at 7:55 PM, Dyer, James <Ja...@ingramcontent.com>wrote:

> My first guess is that no documents match the query "provinical court".
>  Because you have "spellcheck.maxCollationTries" set to a non-zero value,
> it will not return these as collations unless the correction will return
> hits.  You can test my theory out by removing
> "spellcheck.maxCollationTries" from the request and see if it returns
> "provinical court" as expected.
>
> If this isn't it, then give us the full query request and also the full
> spellcheck response for your failing case.
>
> James Dyer
> Ingram Content Group
> (615) 213-4311
>
>
> -----Original Message-----
> From: Raheel Hasan [mailto:raheelhasan.fsd@gmail.com]
> Sent: Friday, May 31, 2013 9:38 AM
> To: solr-user@lucene.apache.org
> Subject: Spell Checker (DirectSolrSpellChecker) correct settings
>
> Hi guyz, I am new to solr. Here is the thing I have:
>
> When i search "Courtt", I get correct suggestion saying:
>
> ------------------------------------------------
>
> "spellcheck": {
>     "suggestions": [
>       "courtt",
>       {
>         "numFound": 1,
>         "startOffset": 0,
>         "endOffset": 6,
>         "suggestion": [
>           "court"
>         ]
>       },
>       "collation",
>       [
>         "collationQuery",
>         "court",
>         "hits",
>         53,
>         "misspellingsAndCorrections",
>         [
>           "courtt",
>           "court"
>         ]
>       ]
>     ]
>   },
>
> ------------------------------------------------
>
> But when I try "Provincial Courtt", it gives me no suggestions, instead it
> searches for "Provincial" only.
>
>
> Here is the spell check settings in *solrconfig.xml*:
> <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
>
>     <str name="queryAnalyzerFieldType">text_en_splitting</str>
>
>     <!-- a spellchecker built from a field of the main index -->
>     <lst name="spellchecker">
>       <str name="name">default</str>
>       <str name="classname">solr.DirectSolrSpellChecker</str>
>       <str name="field">text</str>
>
>       <!-- minimum accuracy needed to be considered a valid spellcheck
> suggestion -->
>       <float name="accuracy">0.5</float>
>       <!-- Require terms to occur in 1% of documents in order to be
> included in the dictionary -->
>       <float name="thresholdTokenFrequency">.01</float>
>       <!-- the spellcheck distance measure used, the default is the
> internal levenshtein -->
>       <!--<str name="distanceMeasure">internal</str>-->
>       <!-- the maximum #edits we consider when enumerating terms: can be 1
> or 2 -->
>       <int name="maxEdits">1</int>
>       <!-- the minimum number of characters the terms should share -->
>       <int name="minPrefix">3</int>
>       <!-- maximum number of possible matches to review before returning
> results -->
>       <int name="maxInspections">3</int>
>       <!-- minimum length of a query term to be considered for correction
> -->
>       <int name="minQueryLength">4</int>
>       <!-- maximum threshold of documents a query term can appear to be
> considered for correction -->
>       <float name="maxQueryFrequency">0.01</float>
>     </lst>
>
>
>     <!-- a spellchecker that can break or combine words.  See "/spell"
> handler below for usage -->
>     <lst name="spellchecker">
>       <str name="name">wordbreak</str>
>       <str name="classname">solr.WordBreakSolrSpellChecker</str>
>       <str name="field">text</str>
>       <str name="combineWords">true</str>
>       <str name="breakWords">true</str>
>       <int name="maxChanges">5</int>
>     </lst>
>   </searchComponent>
>
> ------------------------------------------------
>
> Here is the *requestHandler*:
>
> <requestHandler name="/select" class="solr.SearchHandler">
>      <lst name="defaults">
>        <str name="echoParams">explicit</str>
>        <int name="rows">20</int>
>        <str name="df">text</str>
>
>        <!-- Spell checking defaults -->
>        <str name="spellcheck">on</str>
>        <str name="spellcheck.count">5</str>
>        <str name="spellcheck.onlyMorePopular">true</str>
>        <str name="spellcheck.maxResultsForSuggest">5</str>
>        <str name="spellcheck.alternativeTermCount">2</str>
>        <str name="spellcheck.extendedResults">false</str>
>
>        <str name="spellcheck.collate">true</str>
>        <str name="spellcheck.maxCollations">3</str>
>        <str name="spellcheck.maxCollationTries">3</str>
>        <str name="spellcheck.collateExtendedResults">true</str>
>      </lst>
>
>      <!-- append spellchecking to our list of components -->
>      <arr name="last-components">
>        <str>spellcheck</str>
>      </arr>
>
>   </requestHandler>
>
>
>
> --
> Regards,
> Raheel Hasan
>
>


-- 
Regards,
Raheel Hasan


Re: Spell Checker (DirectSolrSpellChecker) correct settings

Posted by Raheel Hasan <ra...@gmail.com>.
Hi, thanks a lot for the reply.

Actually, "Provincial Courtt" is mentioned in many documents (sorry about
the type earlier).

Secondly, I tried your idea, but not much of help. The issue is very
microscopic:

1) When I search for "Provinciaal Courtt" = it only suggests `<str name=
"courtt">court</str>` and not "Provincial"
2) Search for "Provincial Courtt" = returns result for 'Provincial' keyword
and no suggestion for 'court'.
3) Search for "Provinciaal Court" = no suggestion; instead searches for
"court" and returns result.
4) Search for "Provinciall Courtt" = correct suggestions..






On Mon, Jun 3, 2013 at 7:55 PM, Dyer, James <Ja...@ingramcontent.com>wrote:

> My first guess is that no documents match the query "provinical court".
>  Because you have "spellcheck.maxCollationTries" set to a non-zero value,
> it will not return these as collations unless the correction will return
> hits.  You can test my theory out by removing
> "spellcheck.maxCollationTries" from the request and see if it returns
> "provinical court" as expected.
>
> If this isn't it, then give us the full query request and also the full
> spellcheck response for your failing case.
>
> James Dyer
> Ingram Content Group
> (615) 213-4311
>
>
> -----Original Message-----
> From: Raheel Hasan [mailto:raheelhasan.fsd@gmail.com]
> Sent: Friday, May 31, 2013 9:38 AM
> To: solr-user@lucene.apache.org
> Subject: Spell Checker (DirectSolrSpellChecker) correct settings
>
> Hi guyz, I am new to solr. Here is the thing I have:
>
> When i search "Courtt", I get correct suggestion saying:
>
> ------------------------------------------------
>
> "spellcheck": {
>     "suggestions": [
>       "courtt",
>       {
>         "numFound": 1,
>         "startOffset": 0,
>         "endOffset": 6,
>         "suggestion": [
>           "court"
>         ]
>       },
>       "collation",
>       [
>         "collationQuery",
>         "court",
>         "hits",
>         53,
>         "misspellingsAndCorrections",
>         [
>           "courtt",
>           "court"
>         ]
>       ]
>     ]
>   },
>
> ------------------------------------------------
>
> But when I try "Provincial Courtt", it gives me no suggestions, instead it
> searches for "Provincial" only.
>
>
> Here is the spell check settings in *solrconfig.xml*:
> <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
>
>     <str name="queryAnalyzerFieldType">text_en_splitting</str>
>
>     <!-- a spellchecker built from a field of the main index -->
>     <lst name="spellchecker">
>       <str name="name">default</str>
>       <str name="classname">solr.DirectSolrSpellChecker</str>
>       <str name="field">text</str>
>
>       <!-- minimum accuracy needed to be considered a valid spellcheck
> suggestion -->
>       <float name="accuracy">0.5</float>
>       <!-- Require terms to occur in 1% of documents in order to be
> included in the dictionary -->
>       <float name="thresholdTokenFrequency">.01</float>
>       <!-- the spellcheck distance measure used, the default is the
> internal levenshtein -->
>       <!--<str name="distanceMeasure">internal</str>-->
>       <!-- the maximum #edits we consider when enumerating terms: can be 1
> or 2 -->
>       <int name="maxEdits">1</int>
>       <!-- the minimum number of characters the terms should share -->
>       <int name="minPrefix">3</int>
>       <!-- maximum number of possible matches to review before returning
> results -->
>       <int name="maxInspections">3</int>
>       <!-- minimum length of a query term to be considered for correction
> -->
>       <int name="minQueryLength">4</int>
>       <!-- maximum threshold of documents a query term can appear to be
> considered for correction -->
>       <float name="maxQueryFrequency">0.01</float>
>     </lst>
>
>
>     <!-- a spellchecker that can break or combine words.  See "/spell"
> handler below for usage -->
>     <lst name="spellchecker">
>       <str name="name">wordbreak</str>
>       <str name="classname">solr.WordBreakSolrSpellChecker</str>
>       <str name="field">text</str>
>       <str name="combineWords">true</str>
>       <str name="breakWords">true</str>
>       <int name="maxChanges">5</int>
>     </lst>
>   </searchComponent>
>
> ------------------------------------------------
>
> Here is the *requestHandler*:
>
> <requestHandler name="/select" class="solr.SearchHandler">
>      <lst name="defaults">
>        <str name="echoParams">explicit</str>
>        <int name="rows">20</int>
>        <str name="df">text</str>
>
>        <!-- Spell checking defaults -->
>        <str name="spellcheck">on</str>
>        <str name="spellcheck.count">5</str>
>        <str name="spellcheck.onlyMorePopular">true</str>
>        <str name="spellcheck.maxResultsForSuggest">5</str>
>        <str name="spellcheck.alternativeTermCount">2</str>
>        <str name="spellcheck.extendedResults">false</str>
>
>        <str name="spellcheck.collate">true</str>
>        <str name="spellcheck.maxCollations">3</str>
>        <str name="spellcheck.maxCollationTries">3</str>
>        <str name="spellcheck.collateExtendedResults">true</str>
>      </lst>
>
>      <!-- append spellchecking to our list of components -->
>      <arr name="last-components">
>        <str>spellcheck</str>
>      </arr>
>
>   </requestHandler>
>
>
>
> --
> Regards,
> Raheel Hasan
>
>


-- 
Regards,
Raheel Hasan

RE: Spell Checker (DirectSolrSpellChecker) correct settings

Posted by "Dyer, James" <Ja...@ingramcontent.com>.
My first guess is that no documents match the query "provinical court".  Because you have "spellcheck.maxCollationTries" set to a non-zero value, it will not return these as collations unless the correction will return hits.  You can test my theory out by removing "spellcheck.maxCollationTries" from the request and see if it returns "provinical court" as expected.

If this isn't it, then give us the full query request and also the full spellcheck response for your failing case.

James Dyer
Ingram Content Group
(615) 213-4311


-----Original Message-----
From: Raheel Hasan [mailto:raheelhasan.fsd@gmail.com] 
Sent: Friday, May 31, 2013 9:38 AM
To: solr-user@lucene.apache.org
Subject: Spell Checker (DirectSolrSpellChecker) correct settings

Hi guyz, I am new to solr. Here is the thing I have:

When i search "Courtt", I get correct suggestion saying:

------------------------------------------------

"spellcheck": {
    "suggestions": [
      "courtt",
      {
        "numFound": 1,
        "startOffset": 0,
        "endOffset": 6,
        "suggestion": [
          "court"
        ]
      },
      "collation",
      [
        "collationQuery",
        "court",
        "hits",
        53,
        "misspellingsAndCorrections",
        [
          "courtt",
          "court"
        ]
      ]
    ]
  },

------------------------------------------------

But when I try "Provincial Courtt", it gives me no suggestions, instead it
searches for "Provincial" only.


Here is the spell check settings in *solrconfig.xml*:
<searchComponent name="spellcheck" class="solr.SpellCheckComponent">

    <str name="queryAnalyzerFieldType">text_en_splitting</str>

    <!-- a spellchecker built from a field of the main index -->
    <lst name="spellchecker">
      <str name="name">default</str>
      <str name="classname">solr.DirectSolrSpellChecker</str>
      <str name="field">text</str>

      <!-- minimum accuracy needed to be considered a valid spellcheck
suggestion -->
      <float name="accuracy">0.5</float>
      <!-- Require terms to occur in 1% of documents in order to be
included in the dictionary -->
      <float name="thresholdTokenFrequency">.01</float>
      <!-- the spellcheck distance measure used, the default is the
internal levenshtein -->
      <!--<str name="distanceMeasure">internal</str>-->
      <!-- the maximum #edits we consider when enumerating terms: can be 1
or 2 -->
      <int name="maxEdits">1</int>
      <!-- the minimum number of characters the terms should share -->
      <int name="minPrefix">3</int>
      <!-- maximum number of possible matches to review before returning
results -->
      <int name="maxInspections">3</int>
      <!-- minimum length of a query term to be considered for correction
-->
      <int name="minQueryLength">4</int>
      <!-- maximum threshold of documents a query term can appear to be
considered for correction -->
      <float name="maxQueryFrequency">0.01</float>
    </lst>


    <!-- a spellchecker that can break or combine words.  See "/spell"
handler below for usage -->
    <lst name="spellchecker">
      <str name="name">wordbreak</str>
      <str name="classname">solr.WordBreakSolrSpellChecker</str>
      <str name="field">text</str>
      <str name="combineWords">true</str>
      <str name="breakWords">true</str>
      <int name="maxChanges">5</int>
    </lst>
  </searchComponent>

------------------------------------------------

Here is the *requestHandler*:

<requestHandler name="/select" class="solr.SearchHandler">
     <lst name="defaults">
       <str name="echoParams">explicit</str>
       <int name="rows">20</int>
       <str name="df">text</str>

       <!-- Spell checking defaults -->
       <str name="spellcheck">on</str>
       <str name="spellcheck.count">5</str>
       <str name="spellcheck.onlyMorePopular">true</str>
       <str name="spellcheck.maxResultsForSuggest">5</str>
       <str name="spellcheck.alternativeTermCount">2</str>
       <str name="spellcheck.extendedResults">false</str>

       <str name="spellcheck.collate">true</str>
       <str name="spellcheck.maxCollations">3</str>
       <str name="spellcheck.maxCollationTries">3</str>
       <str name="spellcheck.collateExtendedResults">true</str>
     </lst>

     <!-- append spellchecking to our list of components -->
     <arr name="last-components">
       <str>spellcheck</str>
     </arr>

  </requestHandler>



-- 
Regards,
Raheel Hasan


Re: Spell Checker (DirectSolrSpellChecker) correct settings

Posted by Raheel Hasan <ra...@gmail.com>.
Let me repeat the issue in brief:

When i search "*Courtt*", I get correct suggestion. But when I try "*Provincial
Courtt*", it gives me no suggestions, instead it searches for "Provincial"
only.

All the config done in my test project is in the original email.
Any help would be great...

Thanks a lot.



On Mon, Jun 3, 2013 at 1:33 PM, Raheel Hasan <ra...@gmail.com>wrote:

> anyone?
>
>
> On Fri, May 31, 2013 at 7:37 PM, Raheel Hasan <ra...@gmail.com>wrote:
>
>> Hi guyz, I am new to solr. Here is the thing I have:
>>
>> When i search "Courtt", I get correct suggestion saying:
>>
>> ------------------------------------------------
>>
>> "spellcheck": {
>>     "suggestions": [
>>       "courtt",
>>       {
>>         "numFound": 1,
>>         "startOffset": 0,
>>         "endOffset": 6,
>>         "suggestion": [
>>           "court"
>>         ]
>>       },
>>       "collation",
>>       [
>>         "collationQuery",
>>         "court",
>>         "hits",
>>         53,
>>         "misspellingsAndCorrections",
>>         [
>>           "courtt",
>>           "court"
>>         ]
>>       ]
>>     ]
>>   },
>>
>> ------------------------------------------------
>>
>> But when I try "Provincial Courtt", it gives me no suggestions, instead
>> it searches for "Provincial" only.
>>
>>
>> Here is the spell check settings in *solrconfig.xml*:
>> <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
>>
>>     <str name="queryAnalyzerFieldType">text_en_splitting</str>
>>
>>     <!-- a spellchecker built from a field of the main index -->
>>     <lst name="spellchecker">
>>       <str name="name">default</str>
>>       <str name="classname">solr.DirectSolrSpellChecker</str>
>>       <str name="field">text</str>
>>
>>       <!-- minimum accuracy needed to be considered a valid spellcheck
>> suggestion -->
>>       <float name="accuracy">0.5</float>
>>       <!-- Require terms to occur in 1% of documents in order to be
>> included in the dictionary -->
>>       <float name="thresholdTokenFrequency">.01</float>
>>       <!-- the spellcheck distance measure used, the default is the
>> internal levenshtein -->
>>       <!--<str name="distanceMeasure">internal</str>-->
>>       <!-- the maximum #edits we consider when enumerating terms: can be
>> 1 or 2 -->
>>       <int name="maxEdits">1</int>
>>       <!-- the minimum number of characters the terms should share -->
>>       <int name="minPrefix">3</int>
>>       <!-- maximum number of possible matches to review before returning
>> results -->
>>       <int name="maxInspections">3</int>
>>       <!-- minimum length of a query term to be considered for correction
>> -->
>>       <int name="minQueryLength">4</int>
>>       <!-- maximum threshold of documents a query term can appear to be
>> considered for correction -->
>>       <float name="maxQueryFrequency">0.01</float>
>>     </lst>
>>
>>
>>     <!-- a spellchecker that can break or combine words.  See "/spell"
>> handler below for usage -->
>>     <lst name="spellchecker">
>>       <str name="name">wordbreak</str>
>>       <str name="classname">solr.WordBreakSolrSpellChecker</str>
>>       <str name="field">text</str>
>>       <str name="combineWords">true</str>
>>       <str name="breakWords">true</str>
>>       <int name="maxChanges">5</int>
>>     </lst>
>>   </searchComponent>
>>
>> ------------------------------------------------
>>
>> Here is the *requestHandler*:
>>
>> <requestHandler name="/select" class="solr.SearchHandler">
>>      <lst name="defaults">
>>        <str name="echoParams">explicit</str>
>>        <int name="rows">20</int>
>>        <str name="df">text</str>
>>
>>        <!-- Spell checking defaults -->
>>        <str name="spellcheck">on</str>
>>        <str name="spellcheck.count">5</str>
>>        <str name="spellcheck.onlyMorePopular">true</str>
>>        <str name="spellcheck.maxResultsForSuggest">5</str>
>>        <str name="spellcheck.alternativeTermCount">2</str>
>>        <str name="spellcheck.extendedResults">false</str>
>>
>>        <str name="spellcheck.collate">true</str>
>>        <str name="spellcheck.maxCollations">3</str>
>>        <str name="spellcheck.maxCollationTries">3</str>
>>        <str name="spellcheck.collateExtendedResults">true</str>
>>      </lst>
>>
>>      <!-- append spellchecking to our list of components -->
>>      <arr name="last-components">
>>        <str>spellcheck</str>
>>      </arr>
>>
>>   </requestHandler>
>>
>>
>>
>> --
>> Regards,
>> Raheel Hasan
>>
>
>
>
> --
> Regards,
> Raheel Hasan
>



-- 
Regards,
Raheel Hasan

Re: Spell Checker (DirectSolrSpellChecker) correct settings

Posted by Raheel Hasan <ra...@gmail.com>.
anyone?


On Fri, May 31, 2013 at 7:37 PM, Raheel Hasan <ra...@gmail.com>wrote:

> Hi guyz, I am new to solr. Here is the thing I have:
>
> When i search "Courtt", I get correct suggestion saying:
>
> ------------------------------------------------
>
> "spellcheck": {
>     "suggestions": [
>       "courtt",
>       {
>         "numFound": 1,
>         "startOffset": 0,
>         "endOffset": 6,
>         "suggestion": [
>           "court"
>         ]
>       },
>       "collation",
>       [
>         "collationQuery",
>         "court",
>         "hits",
>         53,
>         "misspellingsAndCorrections",
>         [
>           "courtt",
>           "court"
>         ]
>       ]
>     ]
>   },
>
> ------------------------------------------------
>
> But when I try "Provincial Courtt", it gives me no suggestions, instead it
> searches for "Provincial" only.
>
>
> Here is the spell check settings in *solrconfig.xml*:
> <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
>
>     <str name="queryAnalyzerFieldType">text_en_splitting</str>
>
>     <!-- a spellchecker built from a field of the main index -->
>     <lst name="spellchecker">
>       <str name="name">default</str>
>       <str name="classname">solr.DirectSolrSpellChecker</str>
>       <str name="field">text</str>
>
>       <!-- minimum accuracy needed to be considered a valid spellcheck
> suggestion -->
>       <float name="accuracy">0.5</float>
>       <!-- Require terms to occur in 1% of documents in order to be
> included in the dictionary -->
>       <float name="thresholdTokenFrequency">.01</float>
>       <!-- the spellcheck distance measure used, the default is the
> internal levenshtein -->
>       <!--<str name="distanceMeasure">internal</str>-->
>       <!-- the maximum #edits we consider when enumerating terms: can be 1
> or 2 -->
>       <int name="maxEdits">1</int>
>       <!-- the minimum number of characters the terms should share -->
>       <int name="minPrefix">3</int>
>       <!-- maximum number of possible matches to review before returning
> results -->
>       <int name="maxInspections">3</int>
>       <!-- minimum length of a query term to be considered for correction
> -->
>       <int name="minQueryLength">4</int>
>       <!-- maximum threshold of documents a query term can appear to be
> considered for correction -->
>       <float name="maxQueryFrequency">0.01</float>
>     </lst>
>
>
>     <!-- a spellchecker that can break or combine words.  See "/spell"
> handler below for usage -->
>     <lst name="spellchecker">
>       <str name="name">wordbreak</str>
>       <str name="classname">solr.WordBreakSolrSpellChecker</str>
>       <str name="field">text</str>
>       <str name="combineWords">true</str>
>       <str name="breakWords">true</str>
>       <int name="maxChanges">5</int>
>     </lst>
>   </searchComponent>
>
> ------------------------------------------------
>
> Here is the *requestHandler*:
>
> <requestHandler name="/select" class="solr.SearchHandler">
>      <lst name="defaults">
>        <str name="echoParams">explicit</str>
>        <int name="rows">20</int>
>        <str name="df">text</str>
>
>        <!-- Spell checking defaults -->
>        <str name="spellcheck">on</str>
>        <str name="spellcheck.count">5</str>
>        <str name="spellcheck.onlyMorePopular">true</str>
>        <str name="spellcheck.maxResultsForSuggest">5</str>
>        <str name="spellcheck.alternativeTermCount">2</str>
>        <str name="spellcheck.extendedResults">false</str>
>
>        <str name="spellcheck.collate">true</str>
>        <str name="spellcheck.maxCollations">3</str>
>        <str name="spellcheck.maxCollationTries">3</str>
>        <str name="spellcheck.collateExtendedResults">true</str>
>      </lst>
>
>      <!-- append spellchecking to our list of components -->
>      <arr name="last-components">
>        <str>spellcheck</str>
>      </arr>
>
>   </requestHandler>
>
>
>
> --
> Regards,
> Raheel Hasan
>



-- 
Regards,
Raheel Hasan