Talha,

In your configuration, you have this set:

<str name="spellcheck.maxResultsForSuggest">5</str>

...which means it will consider the query "correctly spelled" and offer no 
suggestions if there are 5 or more results. You could omit this parameter and 
it will always suggest when possible.  

Possibly, a better option would be to add "spellcheck.collateParam.mm=100%" or 
"spellcheck.collateParam.q.op=100%", so when testing collations against the 
index, it will require all the terms to match something.  See 
https://wiki.apache.org/solr/SpellCheckComponent#spellcheck.collateParam.XX for 
more information.

James Dyer
Ingram Content Group

-----Original Message-----
From: talha [mailto:talh...@gmail.com] 
Sent: Wednesday, July 22, 2015 9:34 AM
To: solr-user@lucene.apache.org
Subject: Solr spell check mutliwords

Could not figure out actual reason why my configured Solr spell checker not
giving desire output. In my indexed data query: symphony+mobile has around
3.5K+ docs and spell checker detect it as correctly spelled. When i
miss-spell "symphony" in query: symphony+mobile it showing only results for
"mobile" and spell checker detect this query as correctly spelled. I have
searched this query in different combination. Please find search result stat

Query: symphony 
ResultFound: 1190
SpellChecker: correctly spelled

Query: mobile
ResultFound: 2850
SpellChecker: correctly spelled

Query: simphony
ResultFound: 0
SpellChecker: symphony 
Collation Hits: 1190

Query: symphony+mobile
ResultFound: 3585
SpellChecker: correctly spelled 

Query: simphony+mobile
ResultFound: 2850
SpellChecker: correctly spelled

Query: symphony+mbile
ResultFound: 1190
SpellChecker: correctly spelled 

In last two quries it should suggest something for miss-spelled word
"simphony" and "mbile"

Please find my configuration below. Only spell check configuration are given

solrconfig.xml

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

            <str name="spellcheck">on</str>
            <str name="spellcheck.dictionary">default</str>
            <str name="spellcheck.dictionary">wordbreak</str>
            <str name="spellcheck.extendedResults">true</str>
            <str name="spellcheck.count">5</str>
            <str name="spellcheck.alternativeTermCount">2</str>
            <str name="spellcheck.maxResultsForSuggest">5</str>
            <str name="spellcheck.collate">true</str>
            <str name="spellcheck.collateExtendedResults">true</str>
            <str name="spellcheck.maxCollationTries">5</str>
            <str name="spellcheck.maxCollations">3</str>

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

      <searchComponent name="spellcheck" class="solr.SpellCheckComponent">

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

          <lst name="spellchecker">
            <str name="name">default</str>
            <str name="field">suggest</str>
            <str name="classname">solr.DirectSolrSpellChecker</str>
            <str name="distanceMeasure">internal</str>
            <float name="accuracy">0.5</float>
          </lst>

          <lst name="spellchecker">
            <str name="name">wordbreak</str>
            <str name="field">suggest</str>
            <str name="classname">solr.WordBreakSolrSpellChecker</str>
            <str name="combineWords">true</str>
            <str name="breakWords">true</str>
            <int name="maxChanges">10</int>
            <int name="minBreakLength">5</int>
          </lst>

      </searchComponent>

schema.xml

      <fieldType name="text_suggest" class="solr.TextField"
positionIncrementGap="100">
                  <analyzer>
                    <tokenizer class="solr.UAX29URLEmailTokenizerFactory"/>
                    <filter class="solr.StopFilterFactory" ignoreCase="true"
                            words="stopwords.txt"/>
                    <filter class="solr.LowerCaseFilterFactory"/>
                    <filter class="solr.ASCIIFoldingFilterFactory"/>
                    <filter class="solr.EnglishPossessiveFilterFactory"/>
                  </analyzer>
      </fieldType>



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Solr-spell-check-mutliwords-tp4218580.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to