mirror of
https://github.com/apache/lucene.git
synced 2025-02-08 11:05:29 +00:00
LUCENE-2142: merge 3.x test only, as trunk uses different StringIndex variant
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@957492 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f81a5d9bf6
commit
18d21f9f11
@ -389,6 +389,10 @@ Bug fixes
|
|||||||
a prior (corrupt) index missing its segments_N file. (Mike
|
a prior (corrupt) index missing its segments_N file. (Mike
|
||||||
McCandless)
|
McCandless)
|
||||||
|
|
||||||
|
* LUCENE-2142 (correct fix): FieldCacheImpl.getStringIndex no longer
|
||||||
|
throws an exception when term count exceeds doc count.
|
||||||
|
(Mike McCandless, Uwe Schindler)
|
||||||
|
|
||||||
New features
|
New features
|
||||||
|
|
||||||
* LUCENE-2128: Parallelized fetching document frequencies during weight
|
* LUCENE-2128: Parallelized fetching document frequencies during weight
|
||||||
|
@ -1039,4 +1039,23 @@ public class TestSort extends LuceneTestCase implements Serializable {
|
|||||||
dir.close();
|
dir.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testLUCENE2142() throws IOException {
|
||||||
|
RAMDirectory indexStore = new RAMDirectory ();
|
||||||
|
IndexWriter writer = new IndexWriter(indexStore, new IndexWriterConfig(
|
||||||
|
TEST_VERSION_CURRENT, new MockAnalyzer()));
|
||||||
|
for (int i=0; i<5; i++) {
|
||||||
|
Document doc = new Document();
|
||||||
|
doc.add (new Field ("string", "a"+i, Field.Store.NO, Field.Index.NOT_ANALYZED));
|
||||||
|
doc.add (new Field ("string", "b"+i, Field.Store.NO, Field.Index.NOT_ANALYZED));
|
||||||
|
writer.addDocument (doc);
|
||||||
|
}
|
||||||
|
writer.optimize(); // enforce one segment to have a higher unique term count in all cases
|
||||||
|
writer.close();
|
||||||
|
sort.setSort(
|
||||||
|
new SortField("string", SortField.STRING),
|
||||||
|
SortField.FIELD_DOC );
|
||||||
|
// this should not throw AIOOBE or RuntimeEx
|
||||||
|
new IndexSearcher (indexStore, true).search(new MatchAllDocsQuery(), null, 500, sort);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user