Index: solr/core/src/test/org/apache/solr/handler/DocumentAnalysisRequestHandlerTest.java =================================================================== --- solr/core/src/test/org/apache/solr/handler/DocumentAnalysisRequestHandlerTest.java (revision 1175454) +++ solr/core/src/test/org/apache/solr/handler/DocumentAnalysisRequestHandlerTest.java (working copy) @@ -17,6 +17,7 @@ package org.apache.solr.handler; +import org.apache.lucene.analysis.MockTokenizer; import org.apache.solr.client.solrj.request.DocumentAnalysisRequest; import org.apache.solr.common.SolrInputDocument; import org.apache.solr.common.SolrInputField; @@ -252,8 +253,8 @@ NamedList> whitetokResult = documentResult.get("whitetok"); assertNotNull("an analysis for the 'whitetok' field should be returned", whitetokResult); queryResult = whitetokResult.get("query"); - tokenList = (List) queryResult.get("org.apache.lucene.analysis.core.WhitespaceTokenizer"); - assertNotNull("Expecting the 'WhitespaceTokenizer' to be applied on the query for the 'whitetok' field", tokenList); + tokenList = (List) queryResult.get(MockTokenizer.class.getName()); + assertNotNull("Expecting the 'MockTokenizer' to be applied on the query for the 'whitetok' field", tokenList); assertEquals("Query has only one token", 1, tokenList.size()); assertToken(tokenList.get(0), new TokenInfo("JUMPING", null, "word", 0, 7, 1, new int[]{1}, null, false)); indexResult = whitetokResult.get("index"); Index: solr/core/src/test/org/apache/solr/handler/FieldAnalysisRequestHandlerTest.java =================================================================== --- solr/core/src/test/org/apache/solr/handler/FieldAnalysisRequestHandlerTest.java (revision 1175454) +++ solr/core/src/test/org/apache/solr/handler/FieldAnalysisRequestHandlerTest.java (working copy) @@ -17,6 +17,7 @@ package org.apache.solr.handler; +import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.core.WhitespaceTokenizer; import org.apache.solr.common.params.AnalysisParams; @@ -261,10 +262,10 @@ indexPart = whitetok.get("index"); assertNotNull("expecting an index token analysis for field 'whitetok'", indexPart); - assertEquals("expecting only WhitespaceTokenizer to be applied", 1, indexPart.size()); - tokenList = indexPart.get(WhitespaceTokenizer.class.getName()); - assertNotNull("expecting only WhitespaceTokenizer to be applied", tokenList); - assertEquals("expecting WhitespaceTokenizer to produce 10 tokens", 10, tokenList.size()); + assertEquals("expecting only MockTokenizer to be applied", 1, indexPart.size()); + tokenList = indexPart.get(MockTokenizer.class.getName()); + assertNotNull("expecting only MockTokenizer to be applied", tokenList); + assertEquals("expecting MockTokenizer to produce 10 tokens", 10, tokenList.size()); assertToken(tokenList.get(0), new TokenInfo("the", null, "word", 0, 3, 1, new int[]{1}, null, false)); assertToken(tokenList.get(1), new TokenInfo("quick", null, "word", 4, 9, 2, new int[]{2}, null, false)); assertToken(tokenList.get(2), new TokenInfo("red", null, "word", 10, 13, 3, new int[]{3}, null, false)); @@ -278,10 +279,10 @@ queryPart = whitetok.get("query"); assertNotNull("expecting a query token analysis for field 'whitetok'", queryPart); - assertEquals("expecting only WhitespaceTokenizer to be applied", 1, queryPart.size()); - tokenList = queryPart.get(WhitespaceTokenizer.class.getName()); - assertNotNull("expecting only WhitespaceTokenizer to be applied", tokenList); - assertEquals("expecting WhitespaceTokenizer to produce 2 tokens", 2, tokenList.size()); + assertEquals("expecting only MockTokenizer to be applied", 1, queryPart.size()); + tokenList = queryPart.get(MockTokenizer.class.getName()); + assertNotNull("expecting only MockTokenizer to be applied", tokenList); + assertEquals("expecting MockTokenizer to produce 2 tokens", 2, tokenList.size()); assertToken(tokenList.get(0), new TokenInfo("fox", null, "word", 0, 3, 1, new int[]{1}, null, false)); assertToken(tokenList.get(1), new TokenInfo("brown", null, "word", 4, 9, 2, new int[]{2}, null, false)); @@ -328,8 +329,8 @@ assertEquals(" whátëvêr ", indexPart.get("org.apache.lucene.analysis.charfilter.HTMLStripCharFilter")); assertEquals(" whatever ", indexPart.get("org.apache.lucene.analysis.charfilter.MappingCharFilter")); - List tokenList = (List)indexPart.get("org.apache.lucene.analysis.core.WhitespaceTokenizer"); - assertNotNull("Expecting WhitespaceTokenizer analysis breakdown", tokenList); + List tokenList = (List)indexPart.get(MockTokenizer.class.getName()); + assertNotNull("Expecting MockTokenizer analysis breakdown", tokenList); assertEquals(tokenList.size(), 1); assertToken(tokenList.get(0), new TokenInfo("whatever", null, "word", 12, 20, 1, new int[]{1}, null, false)); } @@ -353,8 +354,8 @@ NamedList> indexPart = textType.get("index"); assertNotNull("expecting an index token analysis for field type 'skutype1'", indexPart); - List tokenList = indexPart.get("org.apache.lucene.analysis.core.WhitespaceTokenizer"); - assertNotNull("Expcting WhitespaceTokenizer analysis breakdown", tokenList); + List tokenList = indexPart.get(MockTokenizer.class.getName()); + assertNotNull("Expcting MockTokenizer analysis breakdown", tokenList); assertEquals(4, tokenList.size()); assertToken(tokenList.get(0), new TokenInfo("hi,", null, "word", 0, 3, 1, new int[]{1}, null, false)); assertToken(tokenList.get(1), new TokenInfo("3456-12", null, "word", 4, 11, 2, new int[]{2}, null, false)); Index: solr/core/src/test-files/solr/conf/schema-required-fields.xml =================================================================== --- solr/core/src/test-files/solr/conf/schema-required-fields.xml (revision 1175454) +++ solr/core/src/test-files/solr/conf/schema-required-fields.xml (working copy) @@ -76,7 +76,7 @@ - + @@ -135,7 +135,7 @@ - + @@ -146,7 +146,7 @@ - + @@ -157,13 +157,13 @@ - + - + @@ -180,58 +180,58 @@ - + - + - + - + - + - + - + - + @@ -242,12 +242,12 @@ - + - + @@ -256,12 +256,12 @@ - + - + @@ -270,7 +270,7 @@ - + @@ -280,7 +280,7 @@ --> - + @@ -293,7 +293,7 @@ - + Index: solr/core/src/test-files/solr/conf/schema.xml =================================================================== --- solr/core/src/test-files/solr/conf/schema.xml (revision 1175454) +++ solr/core/src/test-files/solr/conf/schema.xml (working copy) @@ -86,7 +86,7 @@ - + @@ -95,7 +95,7 @@ - + @@ -103,7 +103,7 @@ - + @@ -165,7 +165,7 @@ - + @@ -176,7 +176,7 @@ - + @@ -187,19 +187,19 @@ - + - + - + @@ -223,44 +223,44 @@ - + - + - + - + - + - + @@ -268,20 +268,20 @@ - + - + - + @@ -291,14 +291,14 @@ - + - + @@ -308,12 +308,12 @@ - + - + @@ -322,12 +322,12 @@ - + - + @@ -336,12 +336,12 @@ - + - + @@ -350,7 +350,7 @@ - + @@ -360,7 +360,7 @@ --> - + @@ -373,7 +373,7 @@ - + @@ -396,7 +396,7 @@ - + @@ -404,7 +404,7 @@ - + is there an echo? @@ -414,14 +414,14 @@ - + - + Index: solr/core/src/test-files/solr/conf/schema-reversed.xml =================================================================== --- solr/core/src/test-files/solr/conf/schema-reversed.xml (revision 1175454) +++ solr/core/src/test-files/solr/conf/schema-reversed.xml (working copy) @@ -30,28 +30,28 @@ - + - + - + - + - + Index: solr/core/src/test-files/solr/conf/schema-trie.xml =================================================================== --- solr/core/src/test-files/solr/conf/schema-trie.xml (revision 1175454) +++ solr/core/src/test-files/solr/conf/schema-trie.xml (working copy) @@ -156,7 +156,7 @@ - + @@ -169,7 +169,7 @@ --> - + @@ -181,7 +181,7 @@ - + @@ -197,7 +197,7 @@ but may be good for SKUs. Can insert dashes in the wrong place and still match. --> - + Index: solr/core/src/test-files/solr/conf/schema11.xml =================================================================== --- solr/core/src/test-files/solr/conf/schema11.xml (revision 1175454) +++ solr/core/src/test-files/solr/conf/schema11.xml (working copy) @@ -147,7 +147,7 @@ - + @@ -160,7 +160,7 @@ --> - + @@ -172,7 +172,7 @@ - + @@ -188,7 +188,7 @@ but may be good for SKUs. Can insert dashes in the wrong place and still match. --> - + Index: solr/core/src/test-files/solr/conf/schemasurround.xml =================================================================== --- solr/core/src/test-files/solr/conf/schemasurround.xml (revision 1175454) +++ solr/core/src/test-files/solr/conf/schemasurround.xml (working copy) @@ -79,7 +79,7 @@ - + @@ -88,7 +88,7 @@ - + @@ -96,7 +96,7 @@ - + @@ -118,7 +118,7 @@ - + - + - + - + - + @@ -211,7 +211,7 @@ - + @@ -222,13 +222,13 @@ - + - + @@ -245,52 +245,52 @@ - + - + - + - + - + - + - + - + @@ -300,14 +300,14 @@ - + - + @@ -317,12 +317,12 @@ - + - + @@ -331,12 +331,12 @@ - + - + @@ -345,12 +345,12 @@ - + - + @@ -359,7 +359,7 @@ - + @@ -368,7 +368,7 @@ --> - + @@ -379,7 +379,7 @@ - + - + - + @@ -411,7 +411,7 @@ --> - + @@ -424,7 +424,7 @@ - + Index: solr/core/src/test-files/solr/conf/schema12.xml =================================================================== --- solr/core/src/test-files/solr/conf/schema12.xml (revision 1175454) +++ solr/core/src/test-files/solr/conf/schema12.xml (working copy) @@ -79,7 +79,7 @@ - + @@ -88,7 +88,7 @@ - + @@ -96,7 +96,7 @@ - + @@ -118,7 +118,7 @@ - + - + - + - + - + @@ -211,7 +211,7 @@ - + @@ -222,13 +222,13 @@ - + - + @@ -245,52 +245,52 @@ - + - + - + - + - + - + - + - + @@ -300,14 +300,14 @@ - + - + @@ -317,12 +317,12 @@ - + - + @@ -331,12 +331,12 @@ - + - + @@ -345,12 +345,12 @@ - + - + @@ -359,7 +359,7 @@ - + @@ -368,7 +368,7 @@ --> - + @@ -379,7 +379,7 @@ - + - + @@ -408,7 +408,7 @@ - + Index: solr/core/src/test-files/solr/conf/schema-copyfield-test.xml =================================================================== --- solr/core/src/test-files/solr/conf/schema-copyfield-test.xml (revision 1175454) +++ solr/core/src/test-files/solr/conf/schema-copyfield-test.xml (working copy) @@ -76,7 +76,7 @@ - + @@ -85,7 +85,7 @@ - + @@ -144,7 +144,7 @@ - + @@ -155,7 +155,7 @@ - + @@ -166,13 +166,13 @@ - + - + @@ -189,58 +189,58 @@ - + - + - + - + - + - + - + - + @@ -251,12 +251,12 @@ - + - + @@ -265,12 +265,12 @@ - + - + @@ -279,7 +279,7 @@ - + @@ -289,7 +289,7 @@ --> - + @@ -302,7 +302,7 @@ - + Index: solr/core/src/test-files/solr/conf/schema-stop-keep.xml =================================================================== --- solr/core/src/test-files/solr/conf/schema-stop-keep.xml (revision 1175454) +++ solr/core/src/test-files/solr/conf/schema-stop-keep.xml (working copy) @@ -34,7 +34,7 @@ - + @@ -43,7 +43,7 @@ - + Index: solr/core/src/java/org/apache/solr/handler/component/QueryElevationComponent.java =================================================================== --- solr/core/src/java/org/apache/solr/handler/component/QueryElevationComponent.java (revision 1175454) +++ solr/core/src/java/org/apache/solr/handler/component/QueryElevationComponent.java (working copy) @@ -316,6 +316,8 @@ while( tokens.incrementToken() ) { norm.append( termAtt.buffer(), 0, termAtt.length() ); } + tokens.end(); + tokens.close(); return norm.toString(); } Index: solr/core/src/java/org/apache/solr/handler/component/SpellCheckComponent.java =================================================================== --- solr/core/src/java/org/apache/solr/handler/component/SpellCheckComponent.java (revision 1175454) +++ solr/core/src/java/org/apache/solr/handler/component/SpellCheckComponent.java (working copy) @@ -494,6 +494,8 @@ token.setPositionIncrement(posIncAtt.getPositionIncrement()); result.add(token); } + ts.end(); + ts.close(); return result; } Index: solr/core/src/java/org/apache/solr/spelling/SpellingQueryConverter.java =================================================================== --- solr/core/src/java/org/apache/solr/spelling/SpellingQueryConverter.java (revision 1175454) +++ solr/core/src/java/org/apache/solr/spelling/SpellingQueryConverter.java (working copy) @@ -123,6 +123,8 @@ token.setPositionIncrement(posIncAtt.getPositionIncrement()); result.add(token); } + stream.end(); + stream.close(); } catch (IOException e) { } } Index: solr/solrj/src/test-files/solrj/solr/conf/schema.xml =================================================================== --- solr/solrj/src/test-files/solrj/solr/conf/schema.xml (revision 1175454) +++ solr/solrj/src/test-files/solrj/solr/conf/schema.xml (working copy) @@ -86,7 +86,7 @@ - + @@ -95,7 +95,7 @@ - + @@ -103,7 +103,7 @@ - + @@ -165,7 +165,7 @@ - + @@ -176,7 +176,7 @@ - + @@ -187,19 +187,19 @@ - + - + - + @@ -223,44 +223,44 @@ - + - + - + - + - + - + @@ -268,20 +268,20 @@ - + - + - + @@ -291,14 +291,14 @@ - + - + @@ -308,12 +308,12 @@ - + - + @@ -322,12 +322,12 @@ - + - + @@ -336,12 +336,12 @@ - + - + @@ -350,7 +350,7 @@ - + @@ -360,7 +360,7 @@ --> - + @@ -373,7 +373,7 @@ - + @@ -396,7 +396,7 @@ - + @@ -404,7 +404,7 @@ - + is there an echo? @@ -414,7 +414,7 @@ - + Index: solr/contrib/clustering/src/test-files/clustering/solr/conf/schema.xml =================================================================== --- solr/contrib/clustering/src/test-files/clustering/solr/conf/schema.xml (revision 1175454) +++ solr/contrib/clustering/src/test-files/clustering/solr/conf/schema.xml (working copy) @@ -147,7 +147,7 @@ - + @@ -160,7 +160,7 @@ --> - + @@ -180,7 +180,7 @@ - + @@ -196,7 +196,7 @@ but may be good for SKUs. Can insert dashes in the wrong place and still match. --> - + Index: solr/contrib/extraction/src/test-files/extraction/solr/conf/schema.xml =================================================================== --- solr/contrib/extraction/src/test-files/extraction/solr/conf/schema.xml (revision 1175454) +++ solr/contrib/extraction/src/test-files/extraction/solr/conf/schema.xml (working copy) @@ -76,7 +76,7 @@ - + @@ -85,7 +85,7 @@ - + @@ -93,7 +93,7 @@ - + @@ -152,7 +152,7 @@ - + @@ -163,7 +163,7 @@ - + @@ -174,13 +174,13 @@ - + - + @@ -197,58 +197,58 @@ - + - + - + - + - + - + - + - + @@ -259,12 +259,12 @@ - + - + @@ -273,12 +273,12 @@ - + - + @@ -287,7 +287,7 @@ - + @@ -297,7 +297,7 @@ --> - + @@ -310,7 +310,7 @@ - + Index: solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/dataimport-schema.xml =================================================================== --- solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/dataimport-schema.xml (revision 1175454) +++ solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/dataimport-schema.xml (working copy) @@ -147,7 +147,7 @@ - + @@ -160,7 +160,7 @@ --> - + @@ -172,7 +172,7 @@ - + @@ -188,7 +188,7 @@ but may be good for SKUs. Can insert dashes in the wrong place and still match. --> - + Index: solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/dataimport-solr_id-schema.xml =================================================================== --- solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/dataimport-solr_id-schema.xml (revision 1175454) +++ solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/dataimport-solr_id-schema.xml (working copy) @@ -147,7 +147,7 @@ - + @@ -160,7 +160,7 @@ --> - + @@ -172,7 +172,7 @@ - + @@ -188,7 +188,7 @@ but may be good for SKUs. Can insert dashes in the wrong place and still match. --> - + Index: solr/contrib/dataimporthandler-extras/src/test-files/dihextras/solr/conf/dataimport-schema-no-unique-key.xml =================================================================== --- solr/contrib/dataimporthandler-extras/src/test-files/dihextras/solr/conf/dataimport-schema-no-unique-key.xml (revision 1175454) +++ solr/contrib/dataimporthandler-extras/src/test-files/dihextras/solr/conf/dataimport-schema-no-unique-key.xml (working copy) @@ -147,7 +147,7 @@ - + @@ -160,7 +160,7 @@ --> - + @@ -172,7 +172,7 @@ - + Index: solr/contrib/uima/src/test-files/uima/solr/conf/schema.xml =================================================================== --- solr/contrib/uima/src/test-files/uima/solr/conf/schema.xml (revision 1175454) +++ solr/contrib/uima/src/test-files/uima/solr/conf/schema.xml (working copy) @@ -230,7 +230,7 @@ - + @@ -244,7 +244,7 @@ - +