"Solr Spellchecker Issue: Suggesting 'kothi' Instead of 'kochi'"

24 Views Asked by At

I'm encountering an issue with the Solr spellchecker where it suggests "kothi" instead of the correct term "kochi." Despite having both terms in my index, the spellchecker is providing inaccurate suggestions.

Code and Configuration :

Below is the snippet of spell check configuration in solrConfig.xml file

Configuration

Spellcheck Query and Response:

http://localhost:8983/solr/ihcl/spell?spellcheck=true&spellcheck.build=true&spellcheck.dictionary=ihcl_spellchecker&spellcheck.q=kothi&spellcheck.collate=true

Response..:

{
  "responseHeader":{
    "status":0,
    "QTime":22},
  "command":"build",
  "response":{"numFound":0,"start":0,"numFoundExact":true,"docs":[]
  },
  "spellcheck":{
    "suggestions":[
      "kochi",{
        "numFound":1,
        "startOffset":1,
        "endOffset":6,
        "origFreq":1,
        "suggestion":[{
            "word":"kothi",
            "freq":1}]}],
    "correctlySpelled":false,
    "collations":[]}}

Expected Outcome:

{
  "responseHeader":{
    "status":0,
    "QTime":22},
  "command":"build",
  "response":{"numFound":0,"start":0,"numFoundExact":true,"docs":[]
  },
  "spellcheck":{
    "suggestions":[
      "kochi",{
        "numFound":1,
        "startOffset":1,
        "endOffset":6,
        "origFreq":1,
        "suggestion":[{
            "word":"kochi",
            "freq":1}]}],
    "correctlySpelled":false,
    "collations":[]}}
0

There are 0 best solutions below