lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SOLR-2509) spellcheck: StringIndexOutOfBoundsException: String index out of range: -1
Date Mon, 05 Dec 2011 22:34:40 GMT

    [ https://issues.apache.org/jira/browse/SOLR-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13163114#comment-13163114
] 

Yonik Seeley commented on SOLR-2509:
------------------------------------

bq. Indeed, this test scenario was added during a refactoring (r1022768) with no JIRA # or
bug mentioned at all in the comments. 

My commit :-)

The commit comment said "tests: fix resource leaks and simplify", and hopefully that's all
I did!

Looking back wrt pixma, it looks like I replaced this:
{code}
-  @Test
-  public void testCollate2() throws Exception {
-    SolrCore core = h.getCore();
-    SearchComponent speller = core.getSearchComponent("spellcheck");
-    assertTrue("speller is null and it shouldn't be", speller != null);
-
-    ModifiableSolrParams params = new ModifiableSolrParams();
-    params.add(CommonParams.QT, "spellCheckCompRH");
-    params.add(SpellCheckComponent.SPELLCHECK_BUILD, "true");
-    params.add(CommonParams.Q, "pixma-a-b-c-d-e-f-g");
-    params.add(SpellCheckComponent.COMPONENT_NAME, "true");
-    params.add(SpellCheckComponent.SPELLCHECK_COLLATE, "true");
-
-    SolrRequestHandler handler = core.getRequestHandler("spellCheckCompRH");
-    SolrQueryResponse rsp = new SolrQueryResponse();
-    rsp.add("responseHeader", new SimpleOrderedMap());
-    handler.handleRequest(new LocalSolrQueryRequest(core, params), rsp);
-    NamedList values = rsp.getValues();
-    NamedList spellCheck = (NamedList) values.get("spellcheck");
-    NamedList suggestions = (NamedList) spellCheck.get("suggestions");
-    String collation = (String) suggestions.get("collation");
-    assertEquals("pixmaa", collation);
-  }
{code}

With this:

{code}
+    assertJQ(req("json.nl","map", "qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", "q","pixma-a-b-c-d-e-f-g",
SpellCheckComponent.SPELLCHECK_COLLATE, "true")
+       ,"/spellcheck/suggestions/collation=='pixmaa'"
+    );
{code}

                
> spellcheck: StringIndexOutOfBoundsException: String index out of range: -1
> --------------------------------------------------------------------------
>
>                 Key: SOLR-2509
>                 URL: https://issues.apache.org/jira/browse/SOLR-2509
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 3.1
>         Environment: Debian Lenny
> JAVA Version "1.6.0_20"
>            Reporter: Thomas Gambier
>            Assignee: Erick Erickson
>            Priority: Blocker
>         Attachments: SOLR-2509.patch, SOLR-2509.patch, document.xml, schema.xml, solrconfig.xml
>
>
> Hi,
> I'm a french user of SOLR and i've encountered a problem since i've installed SOLR 3.1.
> I've got an error with this query : 
> cle_frbr:"LYSROUGE1149-73190"
> *SEE COMMENTS BELOW*
> I've tested to escape the minus char and the query worked :
> cle_frbr:"LYSROUGE1149(BACKSLASH)-73190"
> But, strange fact, if i change one letter in my query it works :
> cle_frbr:"LASROUGE1149-73190"
> I've tested the same query on SOLR 1.4 and it works !
> Can someone test the query on next line on a 3.1 SOLR version and tell me if he have
the same problem ? 
> yourfield:"LYSROUGE1149-73190"
> Where do the problem come from ?
> Thank you by advance for your help.
> Tom

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


Mime
View raw message