lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r1171572 - in /lucene/dev/branches/branch_3x: ./ lucene/ lucene/backwards/src/test/ solr/ solr/core/src/java/org/apache/solr/spelling/AbstractLuceneSpellChecker.java
Date Fri, 16 Sep 2011 14:09:10 GMT
Author: rmuir
Date: Fri Sep 16 14:09:10 2011
New Revision: 1171572

URL: http://svn.apache.org/viewvc?rev=1171572&view=rev
Log:
LUCENE-3436: don't use deprecated method

Modified:
    lucene/dev/branches/branch_3x/   (props changed)
    lucene/dev/branches/branch_3x/lucene/   (props changed)
    lucene/dev/branches/branch_3x/lucene/backwards/src/test/   (props changed)
    lucene/dev/branches/branch_3x/solr/   (props changed)
    lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/spelling/AbstractLuceneSpellChecker.java

Modified: lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/spelling/AbstractLuceneSpellChecker.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/spelling/AbstractLuceneSpellChecker.java?rev=1171572&r1=1171571&r2=1171572&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/spelling/AbstractLuceneSpellChecker.java
(original)
+++ lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/spelling/AbstractLuceneSpellChecker.java
Fri Sep 16 14:09:10 2011
@@ -26,6 +26,7 @@ import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
 
+import org.apache.lucene.search.spell.SuggestMode;
 import org.apache.lucene.search.spell.SuggestWord;
 import org.apache.lucene.search.spell.SuggestWordFrequencyComparator;
 import org.apache.lucene.search.spell.SuggestWordQueue;
@@ -184,13 +185,14 @@ public abstract class AbstractLuceneSpel
     float theAccuracy = (options.accuracy == Float.MIN_VALUE) ? spellChecker.getAccuracy()
: options.accuracy;
     
     int count = Math.max(options.count, AbstractLuceneSpellChecker.DEFAULT_SUGGESTION_COUNT);
+    SuggestMode mode = options.onlyMorePopular ? SuggestMode.SUGGEST_MORE_POPULAR : SuggestMode.SUGGEST_WHEN_NOT_IN_INDEX;
     for (Token token : options.tokens) {
       String tokenText = new String(token.buffer(), 0, token.length());
       String[] suggestions = spellChecker.suggestSimilar(tokenText,
               count,
             field != null ? reader : null, //workaround LUCENE-1295
             field,
-            options.onlyMorePopular, theAccuracy);
+            mode, theAccuracy);
       if (suggestions.length == 1 && suggestions[0].equals(tokenText)) {
       	//These are spelled the same, continue on
         continue;



Mime
View raw message