lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <...@thetaphi.de>
Subject RE: svn commit: r1367129 - in /lucene/dev/branches/branch_4x: ./ dev-tools/ lucene/ lucene/analysis/ lucene/analysis/icu/src/java/org/apache/lucene/collation/ lucene/backwards/ lucene/benchmark/ lucene/core/ lucene/demo/ lucene/facet/ lucene/grouping/ luc
Date Mon, 30 Jul 2012 15:58:33 GMT
Thanks! :-)

Uwe

P.S.: The problem was the hash order?

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: yonik@apache.org [mailto:yonik@apache.org]
> Sent: Monday, July 30, 2012 5:47 PM
> To: commits@lucene.apache.org
> Subject: svn commit: r1367129 - in /lucene/dev/branches/branch_4x: ./ dev-
> tools/ lucene/ lucene/analysis/
> lucene/analysis/icu/src/java/org/apache/lucene/collation/ lucene/backwards/
> lucene/benchmark/ lucene/core/ lucene/demo/ lucene/facet/
> lucene/grouping/ luce...
> 
> Author: yonik
> Date: Mon Jul 30 15:46:41 2012
> New Revision: 1367129
> 
> URL: http://svn.apache.org/viewvc?rev=1367129&view=rev
> Log:
> SOLR-3688: fix spellcheck test relying on map order
> 
> Modified:
>     lucene/dev/branches/branch_4x/   (props changed)
>     lucene/dev/branches/branch_4x/dev-tools/   (props changed)
>     lucene/dev/branches/branch_4x/lucene/   (props changed)
>     lucene/dev/branches/branch_4x/lucene/BUILD.txt   (props changed)
>     lucene/dev/branches/branch_4x/lucene/CHANGES.txt   (props changed)
>     lucene/dev/branches/branch_4x/lucene/JRE_VERSION_MIGRATION.txt
> (props changed)
>     lucene/dev/branches/branch_4x/lucene/LICENSE.txt   (props changed)
>     lucene/dev/branches/branch_4x/lucene/MIGRATE.txt   (props changed)
>     lucene/dev/branches/branch_4x/lucene/NOTICE.txt   (props changed)
>     lucene/dev/branches/branch_4x/lucene/README.txt   (props changed)
>     lucene/dev/branches/branch_4x/lucene/analysis/   (props changed)
> 
> lucene/dev/branches/branch_4x/lucene/analysis/icu/src/java/org/apache/luce
> ne/collation/ICUCollationKeyFilterFactory.java   (props changed)
>     lucene/dev/branches/branch_4x/lucene/backwards/   (props changed)
>     lucene/dev/branches/branch_4x/lucene/benchmark/   (props changed)
>     lucene/dev/branches/branch_4x/lucene/build.xml   (props changed)
>     lucene/dev/branches/branch_4x/lucene/common-build.xml   (props
> changed)
>     lucene/dev/branches/branch_4x/lucene/core/   (props changed)
>     lucene/dev/branches/branch_4x/lucene/demo/   (props changed)
>     lucene/dev/branches/branch_4x/lucene/facet/   (props changed)
>     lucene/dev/branches/branch_4x/lucene/grouping/   (props changed)
>     lucene/dev/branches/branch_4x/lucene/highlighter/   (props changed)
>     lucene/dev/branches/branch_4x/lucene/ivy-settings.xml   (props changed)
>     lucene/dev/branches/branch_4x/lucene/join/   (props changed)
>     lucene/dev/branches/branch_4x/lucene/licenses/   (props changed)
>     lucene/dev/branches/branch_4x/lucene/memory/   (props changed)
>     lucene/dev/branches/branch_4x/lucene/misc/   (props changed)
>     lucene/dev/branches/branch_4x/lucene/module-build.xml   (props changed)
>     lucene/dev/branches/branch_4x/lucene/queries/   (props changed)
>     lucene/dev/branches/branch_4x/lucene/queryparser/   (props changed)
>     lucene/dev/branches/branch_4x/lucene/sandbox/   (props changed)
>     lucene/dev/branches/branch_4x/lucene/site/   (props changed)
>     lucene/dev/branches/branch_4x/lucene/spatial/   (props changed)
>     lucene/dev/branches/branch_4x/lucene/suggest/   (props changed)
>     lucene/dev/branches/branch_4x/lucene/test-framework/   (props changed)
>     lucene/dev/branches/branch_4x/lucene/tools/   (props changed)
>     lucene/dev/branches/branch_4x/solr/   (props changed)
>     lucene/dev/branches/branch_4x/solr/CHANGES.txt   (props changed)
>     lucene/dev/branches/branch_4x/solr/LICENSE.txt   (props changed)
>     lucene/dev/branches/branch_4x/solr/NOTICE.txt   (props changed)
>     lucene/dev/branches/branch_4x/solr/README.txt   (props changed)
>     lucene/dev/branches/branch_4x/solr/build.xml   (props changed)
>     lucene/dev/branches/branch_4x/solr/cloud-dev/   (props changed)
>     lucene/dev/branches/branch_4x/solr/common-build.xml   (props changed)
>     lucene/dev/branches/branch_4x/solr/contrib/   (props changed)
>     lucene/dev/branches/branch_4x/solr/core/   (props changed)
> 
> lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/handler/co
> mponent/DummyCustomParamSpellChecker.java
> 
> lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/handler/co
> mponent/SpellCheckComponentTest.java
>     lucene/dev/branches/branch_4x/solr/dev-tools/   (props changed)
>     lucene/dev/branches/branch_4x/solr/example/   (props changed)
>     lucene/dev/branches/branch_4x/solr/lib/   (props changed)
>     lucene/dev/branches/branch_4x/solr/licenses/   (props changed)
>     lucene/dev/branches/branch_4x/solr/licenses/httpclient-LICENSE-ASL.txt
> (props changed)
>     lucene/dev/branches/branch_4x/solr/licenses/httpclient-NOTICE.txt   (props
> changed)
>     lucene/dev/branches/branch_4x/solr/licenses/httpcore-LICENSE-ASL.txt
> (props changed)
>     lucene/dev/branches/branch_4x/solr/licenses/httpcore-NOTICE.txt   (props
> changed)
>     lucene/dev/branches/branch_4x/solr/licenses/httpmime-LICENSE-ASL.txt
> (props changed)
>     lucene/dev/branches/branch_4x/solr/licenses/httpmime-NOTICE.txt   (props
> changed)
>     lucene/dev/branches/branch_4x/solr/scripts/   (props changed)
>     lucene/dev/branches/branch_4x/solr/solrj/   (props changed)
>     lucene/dev/branches/branch_4x/solr/test-framework/   (props changed)
>     lucene/dev/branches/branch_4x/solr/testlogging.properties   (props
> changed)
>     lucene/dev/branches/branch_4x/solr/webapp/   (props changed)
> 
> Modified:
> lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/handler/co
> mponent/DummyCustomParamSpellChecker.java
> URL:
> http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/te
> st/org/apache/solr/handler/component/DummyCustomParamSpellChecker.jav
> a?rev=1367129&r1=1367128&r2=1367129&view=diff
> ================================================================
> ==============
> ---
> lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/handler/co
> mponent/DummyCustomParamSpellChecker.java (original)
> +++ lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/han
> +++ dler/component/DummyCustomParamSpellChecker.java Mon Jul 30
> 15:46:41
> +++ 2012
> @@ -8,8 +8,10 @@ import org.apache.solr.spelling.Spelling  import
> org.apache.solr.spelling.SpellingResult;
> 
>  import java.io.IOException;
> +import java.util.ArrayList;
>  import java.util.Collections;
>  import java.util.Iterator;
> +import java.util.List;
>  /*
>   * Licensed to the Apache Software Foundation (ASF) under one or more
>   * contributor license agreements.  See the NOTICE file distributed with @@ -
> 49,12 +51,20 @@ public class DummyCustomParamSpellChecke
> 
>      SpellingResult result = new SpellingResult();
>      //just spit back out the results
> +
> +    // sort the keys to make ordering predictable
>      Iterator<String> iterator =
> options.customParams.getParameterNamesIterator();
> +    List<String> lst = new ArrayList<String>();
> +    while (iterator.hasNext()) {
> +      lst.add(iterator.next());
> +    }
> +    Collections.sort(lst);
> +
>      int i = 0;
> -    while (iterator.hasNext()){
> -      String name = iterator.next();
> +    for (String name : lst) {
>        String value = options.customParams.get(name);
> -      result.add(new Token(name, i++, i++),  Collections.singletonList(value));
> +      result.add(new Token(name, i, i+1),  Collections.singletonList(value));
> +      i += 2;
>      }
>      return result;
>    }
> 
> Modified:
> lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/handler/co
> mponent/SpellCheckComponentTest.java
> URL:
> http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/te
> st/org/apache/solr/handler/component/SpellCheckComponentTest.java?rev=13
> 67129&r1=1367128&r2=1367129&view=diff
> ================================================================
> ==============
> ---
> lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/handler/co
> mponent/SpellCheckComponentTest.java (original)
> +++ lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/han
> +++ dler/component/SpellCheckComponentTest.java Mon Jul 30 15:46:41 2012
> @@ -100,7 +100,6 @@ public class SpellCheckComponentTest ext
> 
>    @Test
>    public void testPerDictionary() throws Exception {
> -    assumeFalse("This test fails in most cases with Java 8+, looks like it depends
> on order of some HashSet/HashMap whatever",
> Constants.JRE_IS_MINIMUM_JAVA8);
>      assertJQ(req("json.nl","map", "qt",rh,
> SpellCheckComponent.COMPONENT_NAME, "true",
> SpellingParams.SPELLCHECK_BUILD, "true", "q","documemt"
>          , SpellingParams.SPELLCHECK_DICT, "perDict",
> SpellingParams.SPELLCHECK_PREFIX + ".perDict.foo", "bar",
> SpellingParams.SPELLCHECK_PREFIX + ".perDict.bar", "foo")
>         ,"/spellcheck/suggestions/bar=={'numFound':1, 'startOffset':0,
> 'endOffset':1, 'suggestion':['foo']}"



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message