diff --git a/CHANGES.txt b/CHANGES.txt index 9b07bd7f627..0a6912d2726 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -305,6 +305,7 @@ New Features Also includes ability to add your own SolrSpellChecker implementation that plugs in. See http://wiki.apache.org/solr/SpellCheckComponent for more details (Shalin Shekhar Mangar, Bojan Smid, gsingers) +53a. SOLR-679: Added accessor methods to Lucene based spell checkers (gsingers) 54. SOLR-423: Added Request Handler close hook notification so that RequestHandlers can be notified when a core is closing. (gsingers, ryan) diff --git a/src/java/org/apache/solr/handler/component/SpellCheckComponent.java b/src/java/org/apache/solr/handler/component/SpellCheckComponent.java index adc36a8df8d..5fc2bc74022 100644 --- a/src/java/org/apache/solr/handler/component/SpellCheckComponent.java +++ b/src/java/org/apache/solr/handler/component/SpellCheckComponent.java @@ -25,6 +25,7 @@ import java.util.HashMap; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.Map; +import java.util.Collections; import java.util.concurrent.ConcurrentHashMap; import java.util.logging.Level; import java.util.logging.Logger; @@ -347,6 +348,10 @@ public class SpellCheckComponent extends SearchComponent implements SolrCoreAwar } } + public Map getSpellCheckers() { + return Collections.unmodifiableMap(spellCheckers); + } + // /////////////////////////////////////////// // / SolrInfoMBean // ////////////////////////////////////////// diff --git a/src/java/org/apache/solr/spelling/AbstractLuceneSpellChecker.java b/src/java/org/apache/solr/spelling/AbstractLuceneSpellChecker.java index afd844483e2..9ac396e9a4e 100644 --- a/src/java/org/apache/solr/spelling/AbstractLuceneSpellChecker.java +++ b/src/java/org/apache/solr/spelling/AbstractLuceneSpellChecker.java @@ -168,4 +168,42 @@ public abstract class AbstractLuceneSpellChecker extends SolrSpellChecker { index = new RAMDirectory(); } } + + /* + * @return the Accuracy used for the Spellchecker + * */ + public float getAccuracy() { + return accuracy; + } + + /* + * @return the Field used + * + * */ + public String getField() { + return field; + } + + /* + * + * @return the FieldType name. + * */ + public String getFieldTypeName() { + return fieldTypeName; + } + + + /* + * @return the Index directory + * */ + public String getIndexDir() { + return indexDir; + } + + /* + * @return the location of the source + * */ + public String getSourceLocation() { + return sourceLocation; + } } diff --git a/src/java/org/apache/solr/spelling/FileBasedSpellChecker.java b/src/java/org/apache/solr/spelling/FileBasedSpellChecker.java index b463177feda..d617c78efe1 100644 --- a/src/java/org/apache/solr/spelling/FileBasedSpellChecker.java +++ b/src/java/org/apache/solr/spelling/FileBasedSpellChecker.java @@ -129,5 +129,8 @@ public class FileBasedSpellChecker extends AbstractLuceneSpellChecker { } } } - + + public String getCharacterEncoding() { + return characterEncoding; + } } diff --git a/src/java/org/apache/solr/spelling/IndexBasedSpellChecker.java b/src/java/org/apache/solr/spelling/IndexBasedSpellChecker.java index 787ba6fc3ae..a416dcbf490 100644 --- a/src/java/org/apache/solr/spelling/IndexBasedSpellChecker.java +++ b/src/java/org/apache/solr/spelling/IndexBasedSpellChecker.java @@ -108,4 +108,9 @@ public class IndexBasedSpellChecker extends AbstractLuceneSpellChecker { //reload the source initSourceReader(); } + + + public float getThreshold() { + return threshold; + } }