Skip to content

Apache Lucene open-source search software

LUCENE-3662: add note

Robert Muir7c7c7bd0777f
diff --git a/modules/suggest/src/java/org/apache/lucene/search/spell/LuceneLevenshteinDistance.java b/modules/suggest/src/java/org/apache/lucene/search/spell/LuceneLevenshteinDistance.java
index 5bb6bb4087f..151ae7c425b 100644
--- a/modules/suggest/src/java/org/apache/lucene/search/spell/LuceneLevenshteinDistance.java
+++ b/modules/suggest/src/java/org/apache/lucene/search/spell/LuceneLevenshteinDistance.java
@@ -45,6 +45,12 @@ public final class LuceneLevenshteinDistance implements StringDistance {
IntsRef otherPoints;
int n;
int d[][]; // cost array
+
+ // NOTE: if we cared, we could 3*m space instead of m*n space, similar to
+ // what LevenshteinDistance does, except cycling thru a ring of three
+ // horizontal cost arrays... but this comparator is never actually used by
+ // DirectSpellChecker, its only used for merging results from multiple shards
+ // in "distributed spellcheck", and its inefficient in other ways too...
// cheaper to do this up front once
targetPoints = toIntsRef(target);