I tried increasing my alternativeTermCount to 5 and enable extended results.
I also added a filter fq parameter to clarify what I mean:

*Querying for "go pro" is good:*

{
  "responseHeader": {
    "status": 0,
    "QTime": 2,
    "params": {
      "q": "go pro",
      "indent": "true",
      "fq": "marchio:\"GO PRO\"",
      "rows": "1",
      "wt": "json",
      "spellcheck.extendedResults": "true",
      "_": "1422485581792"
    }
  },
  "response": {
    "numFound": 27,
    "start": 0,
    "docs": [
      {
        "codice_produttore_s": "DK00150020",
        "codice_s": "5.BAT.27407",
        "id": "27407",
        "marchio": "GO PRO",
        "barcode_interno_s": "185323000958",
        "prezzo_acquisto_d": 16.12,
        "data_aggiornamento_dt": "2012-06-21T00:00:00Z",
        "descrizione": "BATTERIA GO PRO HERO ",
        "prezzo_vendita_d": 39.9,
        "categoria": "Batterie",
        "_version_": 1491583424191791000
      },

     ............

    ]
  },
  "spellcheck": {
    "suggestions": [
      "go pro",
      {
        "numFound": 1,
        "startOffset": 0,
        "endOffset": 6,
        "origFreq": 433,
        "suggestion": [
          {
            "word": "gopro",
            "freq": 2
          }
        ]
      },
      "correctlySpelled",
      false,
      "collation",
      [
        "collationQuery",
        "gopro",
        "hits",
        3,
        "misspellingsAndCorrections",
        [
          "go pro",
          "gopro"
        ]
      ]
    ]
  }
}

While querying for "gopro" is not:

{
  "responseHeader": {
    "status": 0,
    "QTime": 6,
    "params": {
      "q": "gopro",
      "indent": "true",
      "fq": "marchio:\"GO PRO\"",
      "rows": "1",
      "wt": "json",
      "spellcheck.extendedResults": "true",
      "_": "1422485629480"
    }
  },
  "response": {
    "numFound": 3,
    "start": 0,
    "docs": [
      {
        "codice_produttore_s": "DK0030010",
        "codice_s": "5.VID.39163",
        "id": "38814",
        "marchio": "GO PRO",
        "barcode_interno_s": "818279012477",
        "prezzo_acquisto_d": 150.84,
        "data_aggiornamento_dt": "2014-12-24T00:00:00Z",
        "descrizione": "VIDEOCAMERA GO-PRO HERO 3 WHITE NUOVO SLIM",
        "prezzo_vendita_d": 219,
        "categoria": "Fotografia",
        "_version_": 1491583425479442400
      },
............
    ]
  },
  "spellcheck": {
    "suggestions": [
      "gopro",
      {
        "numFound": 1,
        "startOffset": 0,
        "endOffset": 5,
        "origFreq": 2,
        "suggestion": [
          {
            "word": "giro",
            "freq": 6
          }
        ]
      },
      "correctlySpelled",
      false
    ]
  }
}

---

I'd like "go pro" as a suggestion for "gopro" too.



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Suggesting-broken-words-with-solr-WordBreakSolrSpellChecker-tp4182172p4182735.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to