[prev in list] [next in list] [prev in thread] [next in thread] 

List:       solr-user
Subject:    Spell Checker (DirectSolrSpellChecker) correct settings
From:       Raheel Hasan <raheelhasan.fsd () gmail ! com>
Date:       2013-05-31 14:37:38
Message-ID: CALDWS-wy0cEqkCaO8EvLnWgXSV1hExd-NA358UMf7vsqcRbEKw () mail ! gmail ! com
[Download RAW message or body]


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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic