user1965449
user1965449

Reputation: 2931

Solr wordbreak spellchecker breaking words into letters- excessive breaking

I am using Solr wordbreak spellchecker and the issue is that when I search for a term like "mob ile" expecting that the wordbreak spellchecker would actually resutn a suggestion for "mobile" it breaks the search term into letters like "m o b" I have two issues with this behavior.

  1. How can I make Solr combine "mob ile" to mobile?
  2. Not withstanding the fact that my search term "mob ile" is being broken incorrectly into individual letters , I realize that the wordbreak is needed in certain cases, how do I control the wordbreak so that it does not break it into letters like "m o b" which seems like excessive breaking to me ?

Thanks.

Upvotes: 1

Views: 1492

Answers (1)

whomer
whomer

Reputation: 615

Adding parameter minBreakLength to the wordbreak spellcheck component fixes the issue of excessively small strings being created:

   <!-- 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">my_wb_field</str>
  <str name="combineWords">true</str>
  <str name="breakWords">true</str>
  <int name="maxChanges">3</int>
  **<int name="minBreakLength">3</int>**
</lst>

Upvotes: 2

Related Questions