本文整理汇总了Java中org.apache.lucene.search.suggest.Sort.SortInfo类的典型用法代码示例。如果您正苦于以下问题:Java SortInfo类的具体用法?Java SortInfo怎么用?Java SortInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SortInfo类属于org.apache.lucene.search.suggest.Sort包,在下文中一共展示了SortInfo类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testIntermediateMerges
import org.apache.lucene.search.suggest.Sort.SortInfo; //导入依赖的package包/类
@Test
public void testIntermediateMerges() throws Exception {
// Sort 20 mb worth of data with 1mb buffer, binary merging.
SortInfo info = checkSort(new Sort(Sort.DEFAULT_COMPARATOR, BufferSize.megabytes(1), Sort.defaultTempDir(), 2),
generateRandom((int)Sort.MB * 20));
assertTrue(info.mergeRounds > 10);
}
示例2: testSmallRandom
import org.apache.lucene.search.suggest.Sort.SortInfo; //导入依赖的package包/类
@Test
public void testSmallRandom() throws Exception {
// Sort 20 mb worth of data with 1mb buffer.
SortInfo sortInfo = checkSort(new Sort(Sort.DEFAULT_COMPARATOR, BufferSize.megabytes(1), Sort.defaultTempDir(), Sort.MAX_TEMPFILES),
generateRandom((int)Sort.MB * 20));
assertEquals(1, sortInfo.mergeRounds);
}
示例3: checkSort
import org.apache.lucene.search.suggest.Sort.SortInfo; //导入依赖的package包/类
/**
* Check sorting data on an instance of {@link Sort}.
*/
private SortInfo checkSort(Sort sort, byte[][] data) throws IOException {
File unsorted = writeAll("unsorted", data);
Arrays.sort(data, unsignedByteOrderComparator);
File golden = writeAll("golden", data);
File sorted = new File(tempDir, "sorted");
SortInfo sortInfo = sort.sort(unsorted, sorted);
//System.out.println("Input size [MB]: " + unsorted.length() / (1024 * 1024));
//System.out.println(sortInfo);
assertFilesIdentical(golden, sorted);
return sortInfo;
}