Saturday, March 17, 2018

FW: SpellCheck Reload

-----Original Message-----
From: Sadiki Latty [mailto:slatty@uottawa.ca]
Sent: 16 March 2018 17:54
To: solr-user@lucene.apache.org
Subject: RE: SpellCheck Reload

Thanks Alessandro, I'll give this a try next time. I ended up deleting the
spell folder after trying the reload option without success. Next time I
will try the reload then build method you suggested.

Thanks again for the info.

-----Original Message-----
From: Alessandro Benedetti [mailto:a.benedetti@sease.io]
Sent: March-15-18 1:34 PM
To: solr-user@lucene.apache.org
Subject: RE: SpellCheck Reload

Hi Sadiki,
the kind of spellchecker you are using built an auxiliary Lucene index as a
support data structure.
That is going to be used to provide the spellcheck suggestions.

"My question is, does "reloading the dictionary" mean completely erasing the
current dictionary and starting from scratch (which is what I want)? "

What you want is re-build the spellchecker.
In the case of the the IndexBasedSpellChecker, the index is used to build
the dictionary.
When the spellchecker is initialized a reader is opened from the latest
index version available.

if in the meantime your index has changed and commits have happened, just
building the spellchecker *should* use the old reader :

@Override
public void build(SolrCore core, SolrIndexSearcher searcher) throws
IOException {
IndexReader reader = null;
if (sourceLocation == null) {
// Load from Solr's index
reader = searcher.getIndexReader();
} else {
// Load from Lucene index at given sourceLocation
reader = this.reader;
}

This means your dictionary is not going to see any substantial changes.

So what you need to do is :

1) reload the spellchecker -> which will initialise again the source for the
dictionary to the latest index commit
2) re-build the dictionary



Cheers







-----
---------------
Alessandro Benedetti
Search Consultant, R&D Software Engineer, Director Sease Ltd. - www.sease.io
--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

No comments:

Post a Comment