Lucene SpellCheck Doesn't Index 2 Letter Words
<p>I'm using Lucene for spellcheck operation. But it doesn't index 2 letter words. It seems a common problem about Lucene spellcheck.</p>

<p>This is my index method:</p>

<pre><code>    String fileName = "words.txt";

    Dictionary dictionary = null;
    try {
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(new File(fileName)), "UTF-8"));
        dictionary = new PlainTextDictionary(bufferedReader);
    } catch (UnsupportedEncodingException e) {
        e.printStackTrace();
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    } 

    SpellChecker spell = null;
    try {
        Directory directory = FSDirectory.open(spellCheckerPath);
        spell = new SpellChecker(directory);
        spell .setAccuracy(0.5f);
    } catch (IOException e) {
        e.printStackTrace();
    }

    IndexWriterConfig indexWriterConfig = new IndexWriterConfig(Version.LUCENE_4_10_2, new StandardAnalyzer());
    indexWriterConfig.setOpenMode(OpenMode.CREATE_OR_APPEND);
    try {
        spell.indexDictionary(dictionary, indexWriterConfig, true);
        spell.close();
    } catch (IOException e) {
        e.printStackTrace();
    }
</code></pre>

<p>Now, this method works for 3 or more letter words. But, it can't index 2 letter words. I read about stopWords. I tried to give empty StopWords to StandardAnalyzer as parameter; but it didnn't work. (Also, I tried to search with Luke, it can't find it)</p>

<p>I need to use 4.10.2 version of Lucene. I appreciate any help.</p>