LUCENE-1725: Fix the example Sort algorithm - auto is now deprecated and no longer works with Benchmark. Benchmark will now throw an exception if you specify sort fields without a type. The example sort algorithm is now typed.

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@794109 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2009-07-14 22:52:58 +00:00
parent ea7e4ad344
commit add56f5e66
3 changed files with 8 additions and 4 deletions

View File

@ -4,6 +4,11 @@ The Benchmark contrib package contains code for benchmarking Lucene in a variety
$Id:$
7/14/2009
LUCENE-1725: Fix the example Sort algorithm - auto is now deprecated and no longer works
with Benchmark. Benchmark will now throw an exception if you specify sort fields without
a type. The example sort algorithm is now typed. (Mark Miller)
7/6/2009
LUCENE-1730: Fix TrecContentSource to use ISO-8859-1 when reading the TREC files,
unless a different encoding is specified. Additionally, ContentSource now supports

View File

@ -57,7 +57,7 @@ log.queries=true
{ "TestSortSpeed"
OpenReader
{ "LoadFieldCacheAndSearch" SearchWithSort(sort_field:int) > : 1
{ "SearchWithSort" SearchWithSort(sort_field) > : 5000
{ "SearchWithSort" SearchWithSort(sort_field:int) > : 5000
CloseReader
}

View File

@ -43,7 +43,7 @@ public class SearchWithSortTask extends ReadTask {
* If nomaxscore is present, then we turn off maxScore tracking
* in {@link org.apache.lucene.search.TopFieldCollector}.
*
* name,byline:int,subject:auto
* name:string,page:int,subject:string
*
*/
public void setParams(String sortField) {
@ -70,8 +70,7 @@ public class SearchWithSortTask extends ReadTask {
fieldName = field.substring(0, index);
typeString = field.substring(1+index, field.length());
} else {
typeString = "auto";
fieldName = field;
throw new RuntimeException("You must specify the sort type ie page:int,subject:string");
}
int type = getType(typeString);
sortField0 = new SortField(fieldName, type);