/** * check the existence of the given word in the index * * @param indexPath index path's * @param word String to check * @return * @throws IOException */ private boolean checkExistingWord(String indexPath, String word) throws IOException { File file = new File(indexPath); FSDirectory directory = FSDirectory.getDirectory(file); SpellChecker spellChecker = new SpellChecker(directory); return spellChecker.exist(word); }