Fixed Junit failure due to recent change in QueryParser default behaviour. Needed to explicitly require old style of RangeQuery implementation rather than new default of RangeFilters

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@529417 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Harwood 2007-04-16 22:04:07 +00:00
parent 934a56e55f
commit 1877f9e3dc
1 changed files with 8 additions and 1 deletions

View File

@ -132,7 +132,14 @@ public class HighlighterTest extends TestCase implements Formatter
}
public void testGetRangeFragments() throws Exception
{
doSearching(FIELD_NAME + ":[kannedy TO kznnedy]"); //bug?needs lower case
String queryString=FIELD_NAME + ":[kannedy TO kznnedy]";
//Need to explicitly set the QueryParser property to use RangeQuery rather than RangeFilters
QueryParser parser=new QueryParser(FIELD_NAME, new StandardAnalyzer());
parser.setUseOldRangeQuery(true);
query = parser.parse(queryString);
doSearching(query);
doStandardHighlights();
assertTrue("Failed to find correct number of highlights " + numHighlights + " found", numHighlights == 5);
}