SOLR-1340: DocumentAnalysisRequestHandler assumed text analysis for int field, couldn't handle exceptions in analysis

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@801751 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2009-08-06 18:09:56 +00:00
parent 118c25391c
commit 1558db534d
1 changed files with 10 additions and 1 deletions

View File

@ -128,6 +128,13 @@ public class DocumentAnalysisRequestHandlerTest extends AnalysisRequestHandlerTe
// the id field
NamedList<NamedList<Object>> idResult = documentResult.get("id");
assertNotNull("an analysis for the 'id' field should be returned", idResult);
NamedList<Object> queryResult;
List<NamedList> tokenList;
NamedList<Object> indexResult;
NamedList<List<NamedList>> valueResult;
/*** Much of this test seems invalid for a numeric "id" field
NamedList<Object> queryResult = idResult.get("query");
assertEquals("Only the default analyzer should be applied", 1, queryResult.size());
String name = queryResult.getName(0);
@ -136,6 +143,7 @@ public class DocumentAnalysisRequestHandlerTest extends AnalysisRequestHandlerTe
assertEquals("Query has only one token", 1, tokenList.size());
assertToken(tokenList.get(0), new TokenInfo("JUMPING", null, "word", 0, 7, 1, null, false));
NamedList<Object> indexResult = idResult.get("index");
assertEquals("The id field has only a single value", 1, indexResult.size());
NamedList<List<NamedList>> valueResult = (NamedList<List<NamedList>>) indexResult.get("1");
assertEquals("Only the default analyzer should be applied", 1, valueResult.size());
@ -144,7 +152,8 @@ public class DocumentAnalysisRequestHandlerTest extends AnalysisRequestHandlerTe
tokenList = valueResult.getVal(0);
assertEquals("The 'id' field value has only one token", 1, tokenList.size());
assertToken(tokenList.get(0), new TokenInfo("1", null, "word", 0, 1, 1, null, false));
***/
// the name field
NamedList<NamedList<Object>> whitetokResult = documentResult.get("whitetok");
assertNotNull("an analysis for the 'whitetok' field should be returned", whitetokResult);