Suggestors causing java.lang.NoClassDefFoundError: java.nio.file.Paths is a restricted class error
I am currently running into this error trying to use certain suggestors.
I am mainly copying the examples from here:
Of course I am changing the Directory to GaeDirctory but I am getting this error when the suggestor is trying to build the dictionary like on line 63 of the AutoSuggestTest.
I have successfully used the SpellChecker before but it indexes the dictionary a different way than the suggestors:
try (GaeDirectory directory = new GaeDirectory(indexPhraseName);
GaeDirectory suggestDirectory = new GaeDirectory(indexPhraseSuggestionName)) {
SpellChecker phraseRecommender = new SpellChecker(suggestDirectory);
IndexReader reader = DirectoryReader.open(directory);
phraseRecommender.indexDictionary(new LuceneDictionary(reader, "title"), getIndexWriterConfig(new StandardAnalyzer()), true);
phraseRecommender.close();
reader.close();
} catch (LockObtainFailedException e) {
request.setError("Cannot acquire lock to the :'" + indexPhraseName + "' or '" + indexPhraseSuggestionName + "'. Other indexing operation are executing please try again later.");
} catch (IOException e) {
request.setError("IO exception:'" + indexPhraseName + "' or '" + indexPhraseSuggestionName + "', cause:" + e.getMessage());
}
Any ideas?
The issue is related to the AnalyzingSuggester that is currently experimental. More in depth the AnalyzingSuggester saves something in a file, that action cannot be done in GAE environment.
Until now I didn't provide support for the experimental API of Lucene, but it is something planned.
This issue will be the starting point.
Oh okay, thank you for the insight! Appreciate it and looking forward to what you have planned :)
Of the four it appears the AnalyzingInfixSuggester does work. It is prepared differently so I am assuming that one doesn't save something in a file.
EDIT: I noticed though after using the analyzinginfixsuggester on my index it removes segments and segmenthunks from the datastore pretty much wiping out the index :S
Sorry, one last question. Do you have an estimate on when we can expect these changes? If not I totally understand and if it is a year or longer from now I understand that as well. I was just curious to know. Trying to decide if I should look for another solution as my needs for text searching really need these suggestors.
You are welcome! Now I'm working to this project during my spare time, that's why I don't have a real schedule of all the things to do. By the way I will not upgrade the project to Lucene 6, this will allow me to put more time to work on things like these. LAE will not support Lucene 6 because that version needs Java 8 which is not supported in standard environment, it is supported only in flexible environment (where LAE project is completely useless).