You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sh...@apache.org on 2013/01/16 11:09:45 UTC
svn commit: r1433878 [2/2] - in /lucene/dev/branches/branch_4x: ./ lucene/
lucene/facet/
lucene/facet/src/examples/org/apache/lucene/facet/example/merge/
lucene/facet/src/examples/org/apache/lucene/facet/example/multiCL/
lucene/facet/src/java/org/apach...
Modified: lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/index/OrdinalMappingReaderTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/index/OrdinalMappingReaderTest.java?rev=1433878&r1=1433877&r2=1433878&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/index/OrdinalMappingReaderTest.java (original)
+++ lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/index/OrdinalMappingReaderTest.java Wed Jan 16 10:09:43 2013
@@ -16,6 +16,7 @@ import org.apache.lucene.store.Directory
import org.junit.Test;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
import org.apache.lucene.facet.example.merge.TaxonomyMergeUtils;
import org.apache.lucene.facet.search.FacetsCollector;
import org.apache.lucene.facet.search.params.CountFacetRequest;
@@ -43,6 +44,7 @@ import org.apache.lucene.facet.taxonomy.
* limitations under the License.
*/
+@SuppressCodecs("Lucene3x")
public class OrdinalMappingReaderTest extends LuceneTestCase {
private static final int NUM_DOCS = 100;
Copied: lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/index/TestFacetsPayloadMigrationReader.java (from r1433869, lucene/dev/trunk/lucene/facet/src/test/org/apache/lucene/facet/index/TestFacetsPayloadMigrationReader.java)
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/index/TestFacetsPayloadMigrationReader.java?p2=lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/index/TestFacetsPayloadMigrationReader.java&p1=lucene/dev/trunk/lucene/facet/src/test/org/apache/lucene/facet/index/TestFacetsPayloadMigrationReader.java&r1=1433869&r2=1433878&rev=1433878&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/facet/src/test/org/apache/lucene/facet/index/TestFacetsPayloadMigrationReader.java (original)
+++ lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/index/TestFacetsPayloadMigrationReader.java Wed Jan 16 10:09:43 2013
@@ -62,6 +62,7 @@ import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.IOUtils;
import org.apache.lucene.util.IntsRef;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
import org.junit.Test;
/*
@@ -82,6 +83,7 @@ import org.junit.Test;
*/
/** Tests facets index migration from payload to DocValues.*/
+@SuppressCodecs("Lucene3x")
public class TestFacetsPayloadMigrationReader extends LuceneTestCase {
private static class PayloadFacetFields extends FacetFields {
Modified: lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/index/params/CategoryListParamsTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/index/params/CategoryListParamsTest.java?rev=1433878&r1=1433877&r2=1433878&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/index/params/CategoryListParamsTest.java (original)
+++ lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/index/params/CategoryListParamsTest.java Wed Jan 16 10:09:43 2013
@@ -1,10 +1,7 @@
package org.apache.lucene.facet.index.params;
-import org.apache.lucene.index.Term;
-import org.junit.Test;
-
import org.apache.lucene.util.LuceneTestCase;
-import org.apache.lucene.facet.index.params.CategoryListParams;
+import org.junit.Test;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -28,7 +25,7 @@ public class CategoryListParamsTest exte
@Test
public void testDefaultSettings() {
CategoryListParams clp = new CategoryListParams();
- assertEquals("wrong default term", new Term("$facets", "$fulltree$"), clp.getTerm());
+ assertEquals("wrong default field", "$facets", clp.field);
assertEquals("unexpected default encoder", "Sorting (Unique (DGap (VInt8)))", clp.createEncoder().toString());
assertEquals("unexpected default decoder", "DGap (VInt8)", clp.createEncoder().createMatchingDecoder().toString());
}
@@ -64,8 +61,8 @@ public class CategoryListParamsTest exte
clParams1.hashCode(), clParams2.hashCode());
// Test 2 CategoryListParams with the same specified Term
- clParams1 = new CategoryListParams(new Term("test"));
- clParams2 = new CategoryListParams(new Term("test"));
+ clParams1 = new CategoryListParams("test");
+ clParams2 = new CategoryListParams("test");
assertEquals(
"2 CategoryListParams with the same term should equal each other.",
clParams1, clParams2);
@@ -73,8 +70,8 @@ public class CategoryListParamsTest exte
clParams1.hashCode(), clParams2.hashCode());
// Test 2 CategoryListParams with DIFFERENT terms
- clParams1 = new CategoryListParams(new Term("test1"));
- clParams2 = new CategoryListParams(new Term("test2"));
+ clParams1 = new CategoryListParams("test1");
+ clParams2 = new CategoryListParams("test2");
assertFalse(
"2 CategoryListParams with the different terms should NOT equal each other.",
clParams1.equals(clParams2));
Modified: lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/index/params/FacetIndexingParamsTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/index/params/FacetIndexingParamsTest.java?rev=1433878&r1=1433877&r2=1433878&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/index/params/FacetIndexingParamsTest.java (original)
+++ lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/index/params/FacetIndexingParamsTest.java Wed Jan 16 10:09:43 2013
@@ -35,8 +35,7 @@ public class FacetIndexingParamsTest ext
assertNotNull("Missing default category list", dfip.getAllCategoryListParams());
assertEquals("all categories have the same CategoryListParams by default",
dfip.getCategoryListParams(null), dfip.getCategoryListParams(new CategoryPath("a")));
- assertEquals("Expected default category list term is $facets:$fulltree$",
- new Term("$facets", "$fulltree$"), dfip.getCategoryListParams(null).getTerm());
+ assertEquals("Expected default category list field is $facets", "$facets", dfip.getCategoryListParams(null).field);
String expectedDDText = "a"
+ dfip.getFacetDelimChar() + "b";
CategoryPath cp = new CategoryPath("a", "b");
@@ -48,13 +47,13 @@ public class FacetIndexingParamsTest ext
assertEquals("wrong drill-down term text", expectedDDText, new String(
buf, 0, numchars));
CategoryListParams clParams = dfip.getCategoryListParams(null);
- assertEquals("partition for all ordinals is the first", "$fulltree$",
- PartitionsUtils.partitionNameByOrdinal(dfip, clParams , 250));
+ assertEquals("partition for all ordinals is the first", "",
+ PartitionsUtils.partitionNameByOrdinal(dfip, 250));
assertEquals("for partition 0, the same name should be returned",
- "$fulltree$", PartitionsUtils.partitionName(clParams, 0));
+ "", PartitionsUtils.partitionName(0));
assertEquals(
"for any other, it's the concatenation of name + partition",
- "$fulltree$1", PartitionsUtils.partitionName(clParams, 1));
+ PartitionsUtils.PART_NAME_PREFIX + "1", PartitionsUtils.partitionName(1));
assertEquals("default partition number is always 0", 0,
PartitionsUtils.partitionNumber(dfip,100));
assertEquals("default partition size is unbounded", Integer.MAX_VALUE,
@@ -63,11 +62,9 @@ public class FacetIndexingParamsTest ext
@Test
public void testCategoryListParamsWithDefaultIndexingParams() {
- CategoryListParams clp = new CategoryListParams(
- new Term("clp", "value"));
+ CategoryListParams clp = new CategoryListParams("clp");
FacetIndexingParams dfip = new FacetIndexingParams(clp);
- assertEquals("Expected default category list term is " + clp.getTerm(),
- clp.getTerm(), dfip.getCategoryListParams(null).getTerm());
+ assertEquals("Expected default category list field is " + clp.field, clp.field, dfip.getCategoryListParams(null).field);
}
@Test
Modified: lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/index/params/PerDimensionIndexingParamsTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/index/params/PerDimensionIndexingParamsTest.java?rev=1433878&r1=1433877&r2=1433878&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/index/params/PerDimensionIndexingParamsTest.java (original)
+++ lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/index/params/PerDimensionIndexingParamsTest.java Wed Jan 16 10:09:43 2013
@@ -32,44 +32,31 @@ public class PerDimensionIndexingParamsT
public void testTopLevelSettings() {
FacetIndexingParams ifip = new PerDimensionIndexingParams(Collections.<CategoryPath, CategoryListParams>emptyMap());
assertNotNull("Missing default category list", ifip.getAllCategoryListParams());
- assertEquals(
- "Expected default category list term is $facets:$fulltree$",
- new Term("$facets", "$fulltree$"), ifip.getCategoryListParams(
- null).getTerm());
- String expectedDDText = "a"
- + ifip.getFacetDelimChar() + "b";
+ assertEquals("Expected default category list field is $facets", "$facets", ifip.getCategoryListParams(null).field);
+ String expectedDDText = "a" + ifip.getFacetDelimChar() + "b";
CategoryPath cp = new CategoryPath("a", "b");
- assertEquals("wrong drill-down term", new Term("$facets",
- expectedDDText), DrillDown.term(ifip,cp));
+ assertEquals("wrong drill-down term", new Term("$facets", expectedDDText), DrillDown.term(ifip,cp));
char[] buf = new char[20];
int numchars = ifip.drillDownTermText(cp, buf);
assertEquals("3 characters should be written", 3, numchars);
- assertEquals("wrong drill-down term text", expectedDDText, new String(
- buf, 0, numchars));
+ assertEquals("wrong drill-down term text", expectedDDText, new String(buf, 0, numchars));
CategoryListParams clParams = ifip.getCategoryListParams(null);
- assertEquals("partition for all ordinals is the first", "$fulltree$",
- PartitionsUtils.partitionNameByOrdinal(ifip, clParams , 250));
- assertEquals("for partition 0, the same name should be returned",
- "$fulltree$", PartitionsUtils.partitionName(clParams, 0));
- assertEquals(
- "for any other, it's the concatenation of name + partition",
- "$fulltree$1", PartitionsUtils.partitionName(clParams, 1));
- assertEquals("default partition number is always 0", 0,
- PartitionsUtils.partitionNumber(ifip,100));
-
- assertEquals("default partition size is unbounded", Integer.MAX_VALUE,
- ifip.getPartitionSize());
+ assertEquals("partition for all ordinals is the first", "", PartitionsUtils.partitionNameByOrdinal(ifip, 250));
+ assertEquals("for partition 0, the same name should be returned", "", PartitionsUtils.partitionName(0));
+ assertEquals("for any other, it's the concatenation of name + partition", PartitionsUtils.PART_NAME_PREFIX + "1", PartitionsUtils.partitionName(1));
+ assertEquals("default partition number is always 0", 0, PartitionsUtils.partitionNumber(ifip,100));
+ assertEquals("default partition size is unbounded", Integer.MAX_VALUE, ifip.getPartitionSize());
}
@Test
public void testCategoryListParamsAddition() {
- CategoryListParams clp = new CategoryListParams(new Term("clp", "value"));
+ CategoryListParams clp = new CategoryListParams("clp");
PerDimensionIndexingParams tlfip = new PerDimensionIndexingParams(
Collections.<CategoryPath,CategoryListParams> singletonMap(new CategoryPath("a"), clp));
- assertEquals("Expected category list term is " + clp.getTerm(),
- clp.getTerm(), tlfip.getCategoryListParams(new CategoryPath("a")).getTerm());
- assertNotSame("Unexpected default category list " + clp.getTerm(), clp, tlfip.getCategoryListParams(null));
+ assertEquals("Expected category list field is " + clp.field,
+ clp.field, tlfip.getCategoryListParams(new CategoryPath("a")).field);
+ assertNotSame("Unexpected default category list " + clp.field, clp, tlfip.getCategoryListParams(null));
}
}
\ No newline at end of file
Modified: lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/CategoryListIteratorTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/CategoryListIteratorTest.java?rev=1433878&r1=1433877&r2=1433878&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/CategoryListIteratorTest.java (original)
+++ lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/CategoryListIteratorTest.java Wed Jan 16 10:09:43 2013
@@ -1,27 +1,20 @@
package org.apache.lucene.facet.search;
-import java.io.IOException;
-import java.io.Reader;
import java.util.HashSet;
import java.util.Set;
-import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.analysis.MockTokenizer;
-import org.apache.lucene.analysis.TokenStream;
-import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
-import org.apache.lucene.analysis.tokenattributes.PayloadAttribute;
import org.apache.lucene.document.Document;
-import org.apache.lucene.document.Field;
-import org.apache.lucene.document.TextField;
+import org.apache.lucene.document.StraightBytesDocValuesField;
import org.apache.lucene.index.AtomicReaderContext;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.RandomIndexWriter;
-import org.apache.lucene.index.Term;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.IntsRef;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
import org.apache.lucene.util.encoding.DGapIntEncoder;
import org.apache.lucene.util.encoding.IntEncoder;
import org.apache.lucene.util.encoding.SortingIntEncoder;
@@ -46,44 +39,9 @@ import org.junit.Test;
* limitations under the License.
*/
+@SuppressCodecs("Lucene3x")
public class CategoryListIteratorTest extends LuceneTestCase {
- private static final class DataTokenStream extends TokenStream {
-
- private final PayloadAttribute payload = addAttribute(PayloadAttribute.class);
- private final BytesRef buf;
- private final IntEncoder encoder;
- private final CharTermAttribute term = addAttribute(CharTermAttribute.class);
-
- private int idx;
- private boolean exhausted = false;
-
- public DataTokenStream(String text, IntEncoder encoder) {
- this.encoder = encoder;
- term.setEmpty().append(text);
- buf = new BytesRef();
- payload.setPayload(buf);
- }
-
- public void setIdx(int idx) {
- this.idx = idx;
- exhausted = false;
- }
-
- @Override
- public boolean incrementToken() throws IOException {
- if (exhausted) {
- return false;
- }
-
- // must copy because encoders may change the buffer
- encoder.encode(IntsRef.deepCopyOf(data[idx]), buf);
- exhausted = true;
- return true;
- }
-
- }
-
static final IntsRef[] data = new IntsRef[] {
new IntsRef(new int[] { 1, 2 }, 0, 2),
new IntsRef(new int[] { 3, 4 }, 0, 2),
@@ -95,13 +53,13 @@ public class CategoryListIteratorTest ex
public void testPayloadCategoryListIteraor() throws Exception {
Directory dir = newDirectory();
final IntEncoder encoder = new SortingIntEncoder(new UniqueValuesIntEncoder(new DGapIntEncoder(new VInt8IntEncoder())));
- DataTokenStream dts = new DataTokenStream("1",encoder);
RandomIndexWriter writer = new RandomIndexWriter(random(), dir, newIndexWriterConfig(TEST_VERSION_CURRENT,
new MockAnalyzer(random(), MockTokenizer.KEYWORD, false)).setMergePolicy(newLogMergePolicy()));
+ BytesRef buf = new BytesRef();
for (int i = 0; i < data.length; i++) {
- dts.setIdx(i);
Document doc = new Document();
- doc.add(new TextField("f", dts));
+ encoder.encode(IntsRef.deepCopyOf(data[i]), buf);
+ doc.add(new StraightBytesDocValuesField("f", buf));
writer.addDocument(doc);
}
IndexReader reader = writer.getReader();
@@ -109,9 +67,9 @@ public class CategoryListIteratorTest ex
int totalCategories = 0;
IntsRef ordinals = new IntsRef();
- CategoryListIterator cli = new PayloadCategoryListIteraor(new Term("f","1"), encoder.createMatchingDecoder());
+ CategoryListIterator cli = new DocValuesCategoryListIterator("f", encoder.createMatchingDecoder());
for (AtomicReaderContext context : reader.leaves()) {
- cli.setNextReader(context);
+ assertTrue("failed to initalize iterator", cli.setNextReader(context));
int maxDoc = context.reader().maxDoc();
int dataIdx = context.docBase;
for (int doc = 0; doc < maxDoc; doc++, dataIdx++) {
@@ -136,24 +94,17 @@ public class CategoryListIteratorTest ex
public void testPayloadIteratorWithInvalidDoc() throws Exception {
Directory dir = newDirectory();
final IntEncoder encoder = new SortingIntEncoder(new UniqueValuesIntEncoder(new DGapIntEncoder(new VInt8IntEncoder())));
- DataTokenStream dts = new DataTokenStream("1", encoder);
- // this test requires that no payloads ever be randomly present!
- final Analyzer noPayloadsAnalyzer = new Analyzer() {
- @Override
- public TokenStreamComponents createComponents(String fieldName, Reader reader) {
- return new TokenStreamComponents(new MockTokenizer(reader, MockTokenizer.KEYWORD, false));
- }
- };
// NOTE: test is wired to LogMP... because test relies on certain docids having payloads
RandomIndexWriter writer = new RandomIndexWriter(random(), dir,
- newIndexWriterConfig(TEST_VERSION_CURRENT, noPayloadsAnalyzer).setMergePolicy(newLogMergePolicy()));
+ newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random())).setMergePolicy(newLogMergePolicy()));
for (int i = 0; i < data.length; i++) {
Document doc = new Document();
if (i == 0) {
- dts.setIdx(i);
- doc.add(new TextField("f", dts)); // only doc 0 has payloads!
+ BytesRef buf = new BytesRef();
+ encoder.encode(IntsRef.deepCopyOf(data[i]), buf );
+ doc.add(new StraightBytesDocValuesField("f", buf));
} else {
- doc.add(new TextField("f", "1", Field.Store.NO));
+ doc.add(new StraightBytesDocValuesField("f", new BytesRef()));
}
writer.addDocument(doc);
writer.commit();
@@ -164,9 +115,9 @@ public class CategoryListIteratorTest ex
int totalCategories = 0;
IntsRef ordinals = new IntsRef();
- CategoryListIterator cli = new PayloadCategoryListIteraor(new Term("f","1"), encoder.createMatchingDecoder());
+ CategoryListIterator cli = new DocValuesCategoryListIterator("f", encoder.createMatchingDecoder());
for (AtomicReaderContext context : reader.leaves()) {
- cli.setNextReader(context);
+ assertTrue("failed to initalize iterator", cli.setNextReader(context));
int maxDoc = context.reader().maxDoc();
int dataIdx = context.docBase;
for (int doc = 0; doc < maxDoc; doc++, dataIdx++) {
@@ -176,13 +127,13 @@ public class CategoryListIteratorTest ex
}
cli.getOrdinals(doc, ordinals);
if (dataIdx == 0) {
- assertTrue("document 0 must have a payload", ordinals.length > 0);
+ assertTrue("document 0 must have ordinals", ordinals.length > 0);
for (int j = 0; j < ordinals.length; j++) {
assertTrue("expected category not found: " + ordinals.ints[j], values.contains(ordinals.ints[j]));
}
totalCategories += ordinals.length;
} else {
- assertTrue("only document 0 should have a payload", ordinals.length == 0);
+ assertTrue("only document 0 should have ordinals", ordinals.length == 0);
}
}
}
Modified: lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/DrillDownTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/DrillDownTest.java?rev=1433878&r1=1433877&r2=1433878&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/DrillDownTest.java (original)
+++ lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/DrillDownTest.java Wed Jan 16 10:09:43 2013
@@ -28,6 +28,7 @@ import org.apache.lucene.search.TermQuer
import org.apache.lucene.search.TopDocs;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -49,6 +50,7 @@ import org.junit.Test;
* limitations under the License.
*/
+@SuppressCodecs("Lucene3x")
public class DrillDownTest extends LuceneTestCase {
private FacetIndexingParams defaultParams = FacetIndexingParams.ALL_PARENTS;
@@ -60,8 +62,8 @@ public class DrillDownTest extends Lucen
public DrillDownTest() {
Map<CategoryPath,CategoryListParams> paramsMap = new HashMap<CategoryPath,CategoryListParams>();
- paramsMap.put(new CategoryPath("a"), new CategoryListParams(new Term("testing_facets_a", "a")));
- paramsMap.put(new CategoryPath("b"), new CategoryListParams(new Term("testing_facets_b", "b")));
+ paramsMap.put(new CategoryPath("a"), new CategoryListParams("testing_facets_a"));
+ paramsMap.put(new CategoryPath("b"), new CategoryListParams("testing_facets_b"));
nonDefaultParams = new PerDimensionIndexingParams(paramsMap);
}
@@ -113,8 +115,8 @@ public class DrillDownTest extends Lucen
}
@Test
- public void testTermDefault() {
- String defaultField = CategoryListParams.DEFAULT_TERM.field();
+ public void testDefaultField() {
+ String defaultField = CategoryListParams.DEFAULT_FIELD;
Term termA = DrillDown.term(defaultParams, new CategoryPath("a"));
assertEquals(new Term(defaultField, "a"), termA);
Modified: lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestDemoFacets.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestDemoFacets.java?rev=1433878&r1=1433877&r2=1433878&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestDemoFacets.java (original)
+++ lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestDemoFacets.java Wed Jan 16 10:09:43 2013
@@ -38,7 +38,9 @@ import org.apache.lucene.search.MatchAll
import org.apache.lucene.search.Query;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
+@SuppressCodecs("Lucene3x")
public class TestDemoFacets extends LuceneTestCase {
private DirectoryTaxonomyWriter taxoWriter;
Modified: lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestFacetsCollector.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestFacetsCollector.java?rev=1433878&r1=1433877&r2=1433878&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestFacetsCollector.java (original)
+++ lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestFacetsCollector.java Wed Jan 16 10:09:43 2013
@@ -25,6 +25,7 @@ import org.apache.lucene.search.TopScore
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.IOUtils;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
import org.junit.Test;
/*
@@ -44,6 +45,7 @@ import org.junit.Test;
* limitations under the License.
*/
+@SuppressCodecs("Lucene3x")
public class TestFacetsCollector extends LuceneTestCase {
@Test
Modified: lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestMultipleCategoryLists.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestMultipleCategoryLists.java?rev=1433878&r1=1433877&r2=1433878&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestMultipleCategoryLists.java (original)
+++ lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestMultipleCategoryLists.java Wed Jan 16 10:09:43 2013
@@ -10,14 +10,18 @@ import java.util.Map;
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.analysis.MockTokenizer;
+import org.apache.lucene.document.Document;
+import org.apache.lucene.document.Field;
+import org.apache.lucene.document.TextField;
import org.apache.lucene.facet.FacetTestUtils;
+import org.apache.lucene.facet.index.FacetFields;
import org.apache.lucene.facet.index.params.CategoryListParams;
import org.apache.lucene.facet.index.params.FacetIndexingParams;
import org.apache.lucene.facet.index.params.PerDimensionIndexingParams;
import org.apache.lucene.facet.search.params.CountFacetRequest;
import org.apache.lucene.facet.search.params.FacetRequest;
-import org.apache.lucene.facet.search.params.FacetSearchParams;
import org.apache.lucene.facet.search.params.FacetRequest.ResultMode;
+import org.apache.lucene.facet.search.params.FacetSearchParams;
import org.apache.lucene.facet.search.results.FacetResult;
import org.apache.lucene.facet.search.results.FacetResultNode;
import org.apache.lucene.facet.taxonomy.CategoryPath;
@@ -25,23 +29,20 @@ import org.apache.lucene.facet.taxonomy.
import org.apache.lucene.facet.taxonomy.TaxonomyWriter;
import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyReader;
import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter;
-import org.apache.lucene.index.DocsEnum;
+import org.apache.lucene.index.AtomicReader;
+import org.apache.lucene.index.AtomicReaderContext;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.IndexWriterConfig.OpenMode;
-import org.apache.lucene.index.MultiFields;
import org.apache.lucene.index.RandomIndexWriter;
-import org.apache.lucene.index.Term;
-import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.MatchAllDocsQuery;
import org.apache.lucene.search.MultiCollector;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.TopScoreDocCollector;
import org.apache.lucene.store.Directory;
-import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.IOUtils;
import org.apache.lucene.util.LuceneTestCase;
-import org.apache.lucene.util._TestUtil;
+import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
import org.junit.Test;
/*
@@ -61,8 +62,21 @@ import org.junit.Test;
* limitations under the License.
*/
+@SuppressCodecs("Lucene3x")
public class TestMultipleCategoryLists extends LuceneTestCase {
+ private static final CategoryPath[] CATEGORIES = new CategoryPath[] {
+ new CategoryPath("Author", "Mark Twain"),
+ new CategoryPath("Author", "Stephen King"),
+ new CategoryPath("Author", "Kurt Vonnegut"),
+ new CategoryPath("Band", "Rock & Pop", "The Beatles"),
+ new CategoryPath("Band", "Punk", "The Ramones"),
+ new CategoryPath("Band", "Rock & Pop", "U2"),
+ new CategoryPath("Band", "Rock & Pop", "REM"),
+ new CategoryPath("Band", "Rock & Pop", "Dave Matthews Band"),
+ new CategoryPath("Composer", "Bach"),
+ };
+
@Test
public void testDefault() throws Exception {
Directory[][] dirs = getDirs();
@@ -72,9 +86,6 @@ public class TestMultipleCategoryLists e
// create and open a taxonomy writer
TaxonomyWriter tw = new DirectoryTaxonomyWriter(dirs[0][1], OpenMode.CREATE);
- /**
- * Configure with no custom counting lists
- */
PerDimensionIndexingParams iParams = new PerDimensionIndexingParams(Collections.<CategoryPath, CategoryListParams>emptyMap());
seedIndex(iw, tw, iParams);
@@ -88,19 +99,14 @@ public class TestMultipleCategoryLists e
// prepare searcher to search against
IndexSearcher searcher = newSearcher(ir);
- FacetsCollector facetsCollector = performSearch(iParams, tr, ir,
- searcher);
+ FacetsCollector facetsCollector = performSearch(iParams, tr, ir, searcher);
// Obtain facets results and hand-test them
assertCorrectResults(facetsCollector);
- DocsEnum td = _TestUtil.docs(random(), ir, "$facets", new BytesRef("$fulltree$"), MultiFields.getLiveDocs(ir), null, DocsEnum.FLAG_NONE);
- assertTrue(td.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
+ assertOrdinalsExist("$facets", ir);
- tr.close();
- ir.close();
- iw.close();
- tw.close();
+ IOUtils.close(tr, ir, iw, tw);
IOUtils.close(dirs[0]);
}
@@ -111,12 +117,10 @@ public class TestMultipleCategoryLists e
RandomIndexWriter iw = new RandomIndexWriter(random(), dirs[0][0], newIndexWriterConfig(
TEST_VERSION_CURRENT, new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false)));
// create and open a taxonomy writer
- TaxonomyWriter tw = new DirectoryTaxonomyWriter(dirs[0][1],
- OpenMode.CREATE);
+ TaxonomyWriter tw = new DirectoryTaxonomyWriter(dirs[0][1], OpenMode.CREATE);
PerDimensionIndexingParams iParams = new PerDimensionIndexingParams(
- Collections.singletonMap(new CategoryPath("Author"),
- new CategoryListParams(new Term("$author", "Authors"))));
+ Collections.singletonMap(new CategoryPath("Author"), new CategoryListParams("$author")));
seedIndex(iw, tw, iParams);
IndexReader ir = iw.getReader();
@@ -133,13 +137,10 @@ public class TestMultipleCategoryLists e
// Obtain facets results and hand-test them
assertCorrectResults(facetsCollector);
- assertPostingListExists("$facets", "$fulltree$", ir);
- assertPostingListExists("$author", "Authors", ir);
+ assertOrdinalsExist("$facets", ir);
+ assertOrdinalsExist("$author", ir);
- tr.close();
- ir.close();
- iw.close();
- tw.close();
+ IOUtils.close(tr, ir, iw, tw);
IOUtils.close(dirs[0]);
}
@@ -150,12 +151,11 @@ public class TestMultipleCategoryLists e
RandomIndexWriter iw = new RandomIndexWriter(random(), dirs[0][0], newIndexWriterConfig(
TEST_VERSION_CURRENT, new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false)));
// create and open a taxonomy writer
- TaxonomyWriter tw = new DirectoryTaxonomyWriter(dirs[0][1],
- OpenMode.CREATE);
+ TaxonomyWriter tw = new DirectoryTaxonomyWriter(dirs[0][1], OpenMode.CREATE);
Map<CategoryPath,CategoryListParams> paramsMap = new HashMap<CategoryPath,CategoryListParams>();
- paramsMap.put(new CategoryPath("Band"), new CategoryListParams(new Term("$music", "Bands")));
- paramsMap.put(new CategoryPath("Composer"), new CategoryListParams(new Term("$music", "Composers")));
+ paramsMap.put(new CategoryPath("Band"), new CategoryListParams("$music"));
+ paramsMap.put(new CategoryPath("Composer"), new CategoryListParams("$music"));
PerDimensionIndexingParams iParams = new PerDimensionIndexingParams(paramsMap);
seedIndex(iw, tw, iParams);
@@ -168,26 +168,27 @@ public class TestMultipleCategoryLists e
// prepare searcher to search against
IndexSearcher searcher = newSearcher(ir);
- FacetsCollector facetsCollector = performSearch(iParams, tr, ir,
- searcher);
+ FacetsCollector facetsCollector = performSearch(iParams, tr, ir, searcher);
// Obtain facets results and hand-test them
assertCorrectResults(facetsCollector);
- assertPostingListExists("$facets", "$fulltree$", ir);
- assertPostingListExists("$music", "Bands", ir);
- assertPostingListExists("$music", "Composers", ir);
-
- tr.close();
- ir.close();
- iw.close();
- tw.close();
+ assertOrdinalsExist("$facets", ir);
+ assertOrdinalsExist("$music", ir);
+ assertOrdinalsExist("$music", ir);
+
+ IOUtils.close(tr, ir, iw, tw);
IOUtils.close(dirs[0]);
}
- private void assertPostingListExists(String field, String text, IndexReader ir) throws IOException {
- DocsEnum de = _TestUtil.docs(random(), ir, field, new BytesRef(text), null, null, DocsEnum.FLAG_NONE);
- assertTrue(de.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
+ private void assertOrdinalsExist(String field, IndexReader ir) throws IOException {
+ for (AtomicReaderContext context : ir.leaves()) {
+ AtomicReader r = context.reader();
+ if (r.docValues(field) != null) {
+ return; // not all segments must have this DocValues
+ }
+ }
+ fail("no ordinals found for " + field);
}
@Test
@@ -200,8 +201,8 @@ public class TestMultipleCategoryLists e
TaxonomyWriter tw = new DirectoryTaxonomyWriter(dirs[0][1], OpenMode.CREATE);
Map<CategoryPath,CategoryListParams> paramsMap = new HashMap<CategoryPath,CategoryListParams>();
- paramsMap.put(new CategoryPath("Band"), new CategoryListParams(new Term("$bands", "Bands")));
- paramsMap.put(new CategoryPath("Composer"), new CategoryListParams(new Term("$composers", "Composers")));
+ paramsMap.put(new CategoryPath("Band"), new CategoryListParams("$bands"));
+ paramsMap.put(new CategoryPath("Composer"), new CategoryListParams("$composers"));
PerDimensionIndexingParams iParams = new PerDimensionIndexingParams(paramsMap);
seedIndex(iw, tw, iParams);
@@ -214,18 +215,15 @@ public class TestMultipleCategoryLists e
// prepare searcher to search against
IndexSearcher searcher = newSearcher(ir);
- FacetsCollector facetsCollector = performSearch(iParams, tr, ir,
- searcher);
+ FacetsCollector facetsCollector = performSearch(iParams, tr, ir, searcher);
// Obtain facets results and hand-test them
assertCorrectResults(facetsCollector);
- assertPostingListExists("$facets", "$fulltree$", ir);
- assertPostingListExists("$bands", "Bands", ir);
- assertPostingListExists("$composers", "Composers", ir);
- tr.close();
- ir.close();
- iw.close();
- tw.close();
+ assertOrdinalsExist("$facets", ir);
+ assertOrdinalsExist("$bands", ir);
+ assertOrdinalsExist("$composers", ir);
+
+ IOUtils.close(tr, ir, iw, tw);
IOUtils.close(dirs[0]);
}
@@ -236,13 +234,12 @@ public class TestMultipleCategoryLists e
RandomIndexWriter iw = new RandomIndexWriter(random(), dirs[0][0], newIndexWriterConfig(
TEST_VERSION_CURRENT, new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false)));
// create and open a taxonomy writer
- TaxonomyWriter tw = new DirectoryTaxonomyWriter(dirs[0][1],
- OpenMode.CREATE);
+ TaxonomyWriter tw = new DirectoryTaxonomyWriter(dirs[0][1], OpenMode.CREATE);
Map<CategoryPath,CategoryListParams> paramsMap = new HashMap<CategoryPath,CategoryListParams>();
- paramsMap.put(new CategoryPath("Band"), new CategoryListParams(new Term("$music", "music")));
- paramsMap.put(new CategoryPath("Composer"), new CategoryListParams(new Term("$music", "music")));
- paramsMap.put(new CategoryPath("Author"), new CategoryListParams(new Term("$literature", "Authors")));
+ paramsMap.put(new CategoryPath("Band"), new CategoryListParams("$music"));
+ paramsMap.put(new CategoryPath("Composer"), new CategoryListParams("$music"));
+ paramsMap.put(new CategoryPath("Author"), new CategoryListParams("$literature"));
PerDimensionIndexingParams iParams = new PerDimensionIndexingParams(paramsMap);
seedIndex(iw, tw, iParams);
@@ -256,18 +253,14 @@ public class TestMultipleCategoryLists e
// prepare searcher to search against
IndexSearcher searcher = newSearcher(ir);
- FacetsCollector facetsCollector = performSearch(iParams, tr, ir,
- searcher);
+ FacetsCollector facetsCollector = performSearch(iParams, tr, ir, searcher);
// Obtain facets results and hand-test them
assertCorrectResults(facetsCollector);
- assertPostingListExists("$music", "music", ir);
- assertPostingListExists("$literature", "Authors", ir);
+ assertOrdinalsExist("$music", ir);
+ assertOrdinalsExist("$literature", ir);
- tr.close();
- ir.close();
- iw.close();
- tw.close();
+ IOUtils.close(tr, ir, iw, tw);
IOUtils.close(dirs[0]);
}
@@ -275,14 +268,12 @@ public class TestMultipleCategoryLists e
return FacetTestUtils.createIndexTaxonomyDirs(1);
}
- private void assertCorrectResults(FacetsCollector facetsCollector)
- throws IOException {
+ private void assertCorrectResults(FacetsCollector facetsCollector) throws IOException {
List<FacetResult> res = facetsCollector.getFacetResults();
FacetResult results = res.get(0);
FacetResultNode resNode = results.getFacetResultNode();
- Iterable<? extends FacetResultNode> subResults = resNode
- .getSubResults();
+ Iterable<? extends FacetResultNode> subResults = resNode.getSubResults();
Iterator<? extends FacetResultNode> subIter = subResults.iterator();
checkResult(resNode, "Band", 5.0);
@@ -325,9 +316,8 @@ public class TestMultipleCategoryLists e
checkResult(subIter.next(), "Band/Rock & Pop/The Beatles", 1.0);
}
- private FacetsCollector performSearch(FacetIndexingParams iParams,
- TaxonomyReader tr, IndexReader ir,
- IndexSearcher searcher) throws IOException {
+ private FacetsCollector performSearch(FacetIndexingParams iParams, TaxonomyReader tr, IndexReader ir,
+ IndexSearcher searcher) throws IOException {
// step 1: collect matching documents into a collector
Query q = new MatchAllDocsQuery();
TopScoreDocCollector topDocsCollector = TopScoreDocCollector.create(10, true);
@@ -344,7 +334,6 @@ public class TestMultipleCategoryLists e
// Faceted search parameters indicate which facets are we interested in
FacetSearchParams facetSearchParams = new FacetSearchParams(facetRequests, iParams);
-
// perform documents search and facets accumulation
FacetsCollector facetsCollector = new FacetsCollector(facetSearchParams, ir, tr);
@@ -352,27 +341,19 @@ public class TestMultipleCategoryLists e
return facetsCollector;
}
- private void seedIndex(RandomIndexWriter iw, TaxonomyWriter tw,
- FacetIndexingParams iParams) throws IOException {
- FacetTestUtils.add(iParams, iw, tw, "Author", "Mark Twain");
- FacetTestUtils.add(iParams, iw, tw, "Author", "Stephen King");
- FacetTestUtils.add(iParams, iw, tw, "Author", "Kurt Vonnegut");
- FacetTestUtils.add(iParams, iw, tw, "Band", "Rock & Pop",
- "The Beatles");
- FacetTestUtils.add(iParams, iw, tw, "Band", "Punk", "The Ramones");
- FacetTestUtils.add(iParams, iw, tw, "Band", "Rock & Pop", "U2");
- FacetTestUtils.add(iParams, iw, tw, "Band", "Rock & Pop", "REM");
- FacetTestUtils.add(iParams, iw, tw, "Band", "Rock & Pop",
- "Dave Matthews Band");
- FacetTestUtils.add(iParams, iw, tw, "Composer", "Bach");
+ private void seedIndex(RandomIndexWriter iw, TaxonomyWriter tw, FacetIndexingParams iParams) throws IOException {
+ FacetFields facetFields = new FacetFields(tw, iParams);
+ for (CategoryPath cp : CATEGORIES) {
+ Document doc = new Document();
+ facetFields.addFields(doc, Collections.singletonList(cp));
+ doc.add(new TextField("content", "alpha", Field.Store.YES));
+ iw.addDocument(doc);
+ }
}
private static void checkResult(FacetResultNode sub, String label, double value) {
- assertEquals("Label of subresult " + sub.getLabel() + " was incorrect",
- label, sub.getLabel().toString());
- assertEquals(
- "Value for " + sub.getLabel() + " subresult was incorrect",
- value, sub.getValue(), 0.0);
+ assertEquals("Label of subresult " + sub.getLabel() + " was incorrect", label, sub.getLabel().toString());
+ assertEquals("Value for " + sub.getLabel() + " subresult was incorrect", value, sub.getValue(), 0.0);
}
}
\ No newline at end of file
Modified: lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestStandardFacetsAccumulator.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestStandardFacetsAccumulator.java?rev=1433878&r1=1433877&r2=1433878&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestStandardFacetsAccumulator.java (original)
+++ lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestStandardFacetsAccumulator.java Wed Jan 16 10:09:43 2013
@@ -34,6 +34,7 @@ import org.apache.lucene.search.TermQuer
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.IOUtils;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
import org.junit.Test;
/*
@@ -53,6 +54,7 @@ import org.junit.Test;
* limitations under the License.
*/
+@SuppressCodecs("Lucene3x")
public class TestStandardFacetsAccumulator extends LuceneTestCase {
private void indexTwoDocs(IndexWriter indexWriter, FacetFields facetFields, boolean withContent) throws Exception {
@@ -93,6 +95,7 @@ public class TestStandardFacetsAccumulat
indexTwoDocs(indexWriter, null, false); // 4th segment, no content, or categories
indexTwoDocs(indexWriter, null, true); // 5th segment, with content, no categories
indexTwoDocs(indexWriter, facetFields, true); // 6th segment, with content, with categories
+ indexTwoDocs(indexWriter, null, true); // 7th segment, with content, no categories
IOUtils.close(indexWriter, taxoWriter);
DirectoryReader indexReader = DirectoryReader.open(indexDir);
Modified: lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestTopKInEachNodeResultHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestTopKInEachNodeResultHandler.java?rev=1433878&r1=1433877&r2=1433878&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestTopKInEachNodeResultHandler.java (original)
+++ lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestTopKInEachNodeResultHandler.java Wed Jan 16 10:09:43 2013
@@ -31,6 +31,7 @@ import org.apache.lucene.search.Query;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
import org.junit.Test;
/*
@@ -50,6 +51,7 @@ import org.junit.Test;
* limitations under the License.
*/
+@SuppressCodecs("Lucene3x")
public class TestTopKInEachNodeResultHandler extends LuceneTestCase {
//TODO (Facet): Move to extend BaseTestTopK and separate to several smaller test cases (methods) - see TestTopKResultsHandler
@@ -178,7 +180,7 @@ public class TestTopKInEachNodeResultHan
}
FacetResult fr = facetResults.get(0); // a, depth=3, K=2
- boolean hasDoctor = "Doctor".equals(fr.getFacetRequest().getCategoryPath().components[0]);
+ boolean hasDoctor = "Doctor".equals(fr.getFacetRequest().categoryPath.components[0]);
assertEquals(9, fr.getNumValidDescendants());
FacetResultNode parentRes = fr.getFacetResultNode();
assertEquals(16.0, parentRes.getValue(), Double.MIN_VALUE);
@@ -219,7 +221,7 @@ public class TestTopKInEachNodeResultHan
}
fr = facetResults.get(1); // a, depth=2, K=2. same result as before
- hasDoctor |= "Doctor".equals(fr.getFacetRequest().getCategoryPath().components[0]);
+ hasDoctor |= "Doctor".equals(fr.getFacetRequest().categoryPath.components[0]);
assertEquals(9, fr.getNumValidDescendants());
parentRes = fr.getFacetResultNode();
assertEquals(16.0, parentRes.getValue(), Double.MIN_VALUE);
@@ -239,7 +241,7 @@ public class TestTopKInEachNodeResultHan
}
fr = facetResults.get(2); // a, depth=1, K=2
- hasDoctor |= "Doctor".equals(fr.getFacetRequest().getCategoryPath().components[0]);
+ hasDoctor |= "Doctor".equals(fr.getFacetRequest().categoryPath.components[0]);
assertEquals(4, fr.getNumValidDescendants(), 4);
parentRes = fr.getFacetResultNode();
assertEquals(16.0, parentRes.getValue(), Double.MIN_VALUE);
@@ -257,7 +259,7 @@ public class TestTopKInEachNodeResultHan
}
fr = facetResults.get(3); // a/b, depth=3, K=2
- hasDoctor |= "Doctor".equals(fr.getFacetRequest().getCategoryPath().components[0]);
+ hasDoctor |= "Doctor".equals(fr.getFacetRequest().categoryPath.components[0]);
assertEquals(4, fr.getNumValidDescendants());
parentRes = fr.getFacetResultNode();
assertEquals(8.0, parentRes.getValue(), Double.MIN_VALUE);
@@ -272,7 +274,7 @@ public class TestTopKInEachNodeResultHan
}
fr = facetResults.get(4); // a/b, depth=2, K=2
- hasDoctor |= "Doctor".equals(fr.getFacetRequest().getCategoryPath().components[0]);
+ hasDoctor |= "Doctor".equals(fr.getFacetRequest().categoryPath.components[0]);
assertEquals(4, fr.getNumValidDescendants());
parentRes = fr.getFacetResultNode();
assertEquals(8.0, parentRes.getValue(), Double.MIN_VALUE);
@@ -286,7 +288,7 @@ public class TestTopKInEachNodeResultHan
}
fr = facetResults.get(5); // a/b, depth=1, K=2
- hasDoctor |= "Doctor".equals(fr.getFacetRequest().getCategoryPath().components[0]);
+ hasDoctor |= "Doctor".equals(fr.getFacetRequest().categoryPath.components[0]);
assertEquals(4, fr.getNumValidDescendants());
parentRes = fr.getFacetResultNode();
assertEquals(8.0, parentRes.getValue(), Double.MIN_VALUE);
@@ -300,13 +302,13 @@ public class TestTopKInEachNodeResultHan
}
fr = facetResults.get(6); // a/b, depth=0, K=2
- hasDoctor |= "Doctor".equals(fr.getFacetRequest().getCategoryPath().components[0]);
+ hasDoctor |= "Doctor".equals(fr.getFacetRequest().categoryPath.components[0]);
assertEquals(0, fr.getNumValidDescendants()); // 0 descendants but rootnode
parentRes = fr.getFacetResultNode();
assertEquals(8.0, parentRes.getValue(), Double.MIN_VALUE);
assertEquals(0.0, parentRes.getResidue(), Double.MIN_VALUE);
assertEquals(0, parentRes.getNumSubResults());
- hasDoctor |= "Doctor".equals(fr.getFacetRequest().getCategoryPath().components[0]);
+ hasDoctor |= "Doctor".equals(fr.getFacetRequest().categoryPath.components[0]);
// doctor, depth=1, K=2
assertFalse("Shouldn't have found anything for a FacetRequest " +
Modified: lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestTotalFacetCounts.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestTotalFacetCounts.java?rev=1433878&r1=1433877&r2=1433878&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestTotalFacetCounts.java (original)
+++ lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestTotalFacetCounts.java Wed Jan 16 10:09:43 2013
@@ -12,6 +12,7 @@ import org.apache.lucene.store.Directory
import org.apache.lucene.util.IOUtils;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util._TestUtil;
+import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
import org.junit.Test;
/*
@@ -31,6 +32,7 @@ import org.junit.Test;
* limitations under the License.
*/
+@SuppressCodecs("Lucene3x")
public class TestTotalFacetCounts extends LuceneTestCase {
private static void initCache(int numEntries) {
@@ -85,12 +87,12 @@ public class TestTotalFacetCounts extend
TotalFacetCountsCache tfcc = TotalFacetCountsCache.getSingleton();
File tmpFile = _TestUtil.createTempFile("test", "tmp", TEMP_DIR);
- tfcc.store(tmpFile, readers[0].indexReader, readers[0].taxReader, iParams, null);
+ tfcc.store(tmpFile, readers[0].indexReader, readers[0].taxReader, iParams);
tfcc.clear(); // not really required because TFCC overrides on load(), but in the test we need not rely on this.
tfcc.load(tmpFile, readers[0].indexReader, readers[0].taxReader, iParams);
// now retrieve the one just loaded
- TotalFacetCounts totalCounts = tfcc.getTotalCounts(readers[0].indexReader, readers[0].taxReader, iParams, null);
+ TotalFacetCounts totalCounts = tfcc.getTotalCounts(readers[0].indexReader, readers[0].taxReader, iParams);
int partition = 0;
for (int i=0; i<expectedCounts.length; i+=partitionSize) {
Modified: lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestTotalFacetCountsCache.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestTotalFacetCountsCache.java?rev=1433878&r1=1433877&r2=1433878&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestTotalFacetCountsCache.java (original)
+++ lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestTotalFacetCountsCache.java Wed Jan 16 10:09:43 2013
@@ -35,6 +35,7 @@ import org.apache.lucene.util.IOUtils;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.SlowRAMDirectory;
import org.apache.lucene.util._TestUtil;
+import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
import org.junit.Before;
import org.junit.Test;
@@ -55,6 +56,7 @@ import org.junit.Test;
* limitations under the License.
*/
+@SuppressCodecs("Lucene3x")
public class TestTotalFacetCountsCache extends LuceneTestCase {
static final TotalFacetCountsCache TFC = TotalFacetCountsCache.getSingleton();
@@ -78,7 +80,7 @@ public class TestTotalFacetCountsCache e
@Override
public void run() {
try {
- tfc = TFC.getTotalCounts(r, tr, iParams, null);
+ tfc = TFC.getTotalCounts(r, tr, iParams);
} catch (Exception e) {
throw new RuntimeException(e);
}
@@ -264,29 +266,29 @@ public class TestTotalFacetCountsCache e
// As this is the first time we have invoked the TotalFacetCountsManager,
// we should expect to compute and not read from disk.
TotalFacetCounts totalCounts =
- TFC.getTotalCounts(readers[0].indexReader, readers[0].taxReader, iParams, null);
+ TFC.getTotalCounts(readers[0].indexReader, readers[0].taxReader, iParams);
int prevGen = assertRecomputed(totalCounts, 0, "after first attempt to get it!");
// Repeating same operation should pull from the cache - not recomputed.
assertTrue("Should be obtained from cache at 2nd attempt",totalCounts ==
- TFC.getTotalCounts(readers[0].indexReader, readers[0].taxReader, iParams, null));
+ TFC.getTotalCounts(readers[0].indexReader, readers[0].taxReader, iParams));
// Repeat the same operation as above. but clear first - now should recompute again
initCache();
- totalCounts = TFC.getTotalCounts(readers[0].indexReader, readers[0].taxReader, iParams, null);
+ totalCounts = TFC.getTotalCounts(readers[0].indexReader, readers[0].taxReader, iParams);
prevGen = assertRecomputed(totalCounts, prevGen, "after cache clear, 3rd attempt to get it!");
//store to file
File outputFile = _TestUtil.createTempFile("test", "tmp", TEMP_DIR);
initCache();
- TFC.store(outputFile, readers[0].indexReader, readers[0].taxReader, iParams, null);
- totalCounts = TFC.getTotalCounts(readers[0].indexReader, readers[0].taxReader, iParams, null);
+ TFC.store(outputFile, readers[0].indexReader, readers[0].taxReader, iParams);
+ totalCounts = TFC.getTotalCounts(readers[0].indexReader, readers[0].taxReader, iParams);
prevGen = assertRecomputed(totalCounts, prevGen, "after cache clear, 4th attempt to get it!");
//clear and load
initCache();
TFC.load(outputFile, readers[0].indexReader, readers[0].taxReader, iParams);
- totalCounts = TFC.getTotalCounts(readers[0].indexReader, readers[0].taxReader, iParams, null);
+ totalCounts = TFC.getTotalCounts(readers[0].indexReader, readers[0].taxReader, iParams);
prevGen = assertReadFromDisc(totalCounts, prevGen, "after 5th attempt to get it!");
// Add a new facet to the index, commit and refresh readers
@@ -306,12 +308,12 @@ public class TestTotalFacetCountsCache e
readers[0].indexReader = r2;
// now use the new reader - should recompute
- totalCounts = TFC.getTotalCounts(readers[0].indexReader, readers[0].taxReader, iParams, null);
+ totalCounts = TFC.getTotalCounts(readers[0].indexReader, readers[0].taxReader, iParams);
prevGen = assertRecomputed(totalCounts, prevGen, "after updating the index - 7th attempt!");
// try again - should not recompute
assertTrue("Should be obtained from cache at 8th attempt",totalCounts ==
- TFC.getTotalCounts(readers[0].indexReader, readers[0].taxReader, iParams, null));
+ TFC.getTotalCounts(readers[0].indexReader, readers[0].taxReader, iParams));
readers[0].close();
outputFile.delete();
@@ -361,7 +363,7 @@ public class TestTotalFacetCountsCache e
// Create TFC and write cache to disk
File outputFile = _TestUtil.createTempFile("test", "tmp", TEMP_DIR);
- TFC.store(outputFile, readers[0].indexReader, readers[0].taxReader, iParams, null);
+ TFC.store(outputFile, readers[0].indexReader, readers[0].taxReader, iParams);
// Make the taxonomy grow without touching the index
for (int i = 0; i < 10; i++) {
@@ -377,8 +379,7 @@ public class TestTotalFacetCountsCache e
// With the bug, this next call should result in an exception
TFC.load(outputFile, readers[0].indexReader, readers[0].taxReader, iParams);
- TotalFacetCounts totalCounts = TFC.getTotalCounts(
- readers[0].indexReader, readers[0].taxReader, iParams, null);
+ TotalFacetCounts totalCounts = TFC.getTotalCounts(readers[0].indexReader, readers[0].taxReader, iParams);
assertReadFromDisc(totalCounts, 0, "after reading from disk.");
outputFile.delete();
writers[0].close();
@@ -467,28 +468,25 @@ public class TestTotalFacetCountsCache e
// As this is the first time we have invoked the TotalFacetCountsManager, we
// should expect to compute.
TotalFacetCounts totalCounts0 =
- TFC.getTotalCounts(readers[0].indexReader, readers[0].taxReader, iParams, null);
+ TFC.getTotalCounts(readers[0].indexReader, readers[0].taxReader, iParams);
int prevGen = -1;
prevGen = assertRecomputed(totalCounts0, prevGen, "after attempt 1");
assertTrue("attempt 1b for same input [0] shout find it in cache",
- totalCounts0 == TFC.getTotalCounts(readers[0].indexReader, readers[0].taxReader, iParams, null));
+ totalCounts0 == TFC.getTotalCounts(readers[0].indexReader, readers[0].taxReader, iParams));
// 2nd Reader - As this is the first time we have invoked the
// TotalFacetCountsManager, we should expect a state of NEW to be returned.
- TotalFacetCounts totalCounts1 =
- TFC.getTotalCounts(readers[1].indexReader, readers[1].taxReader, iParams, null);
+ TotalFacetCounts totalCounts1 = TFC.getTotalCounts(readers[1].indexReader, readers[1].taxReader, iParams);
prevGen = assertRecomputed(totalCounts1, prevGen, "after attempt 2");
assertTrue("attempt 2b for same input [1] shout find it in cache",
- totalCounts1 == TFC.getTotalCounts(readers[1].indexReader, readers[1].taxReader, iParams, null));
+ totalCounts1 == TFC.getTotalCounts(readers[1].indexReader, readers[1].taxReader, iParams));
// Right now cache size is one, so first TFC is gone and should be recomputed
- totalCounts0 =
- TFC.getTotalCounts(readers[0].indexReader, readers[0].taxReader, iParams, null);
+ totalCounts0 = TFC.getTotalCounts(readers[0].indexReader, readers[0].taxReader, iParams);
prevGen = assertRecomputed(totalCounts0, prevGen, "after attempt 3");
// Similarly will recompute the second result
- totalCounts1 =
- TFC.getTotalCounts(readers[1].indexReader, readers[1].taxReader, iParams, null);
+ totalCounts1 = TFC.getTotalCounts(readers[1].indexReader, readers[1].taxReader, iParams);
prevGen = assertRecomputed(totalCounts1, prevGen, "after attempt 4");
// Now we set the cache size to two, meaning both should exist in the
@@ -496,17 +494,15 @@ public class TestTotalFacetCountsCache e
TFC.setCacheSize(2);
// Re-compute totalCounts0 (was evicted from the cache when the cache was smaller)
- totalCounts0 =
- TFC.getTotalCounts(readers[0].indexReader, readers[0].taxReader, iParams, null);
+ totalCounts0 = TFC.getTotalCounts(readers[0].indexReader, readers[0].taxReader, iParams);
prevGen = assertRecomputed(totalCounts0, prevGen, "after attempt 5");
// now both are in the larger cache and should not be recomputed
- totalCounts1 = TFC.getTotalCounts(readers[1].indexReader,
- readers[1].taxReader, iParams, null);
+ totalCounts1 = TFC.getTotalCounts(readers[1].indexReader, readers[1].taxReader, iParams);
assertTrue("with cache of size 2 res no. 0 should come from cache",
- totalCounts0 == TFC.getTotalCounts(readers[0].indexReader, readers[0].taxReader, iParams, null));
+ totalCounts0 == TFC.getTotalCounts(readers[0].indexReader, readers[0].taxReader, iParams));
assertTrue("with cache of size 2 res no. 1 should come from cache",
- totalCounts1 == TFC.getTotalCounts(readers[1].indexReader, readers[1].taxReader, iParams, null));
+ totalCounts1 == TFC.getTotalCounts(readers[1].indexReader, readers[1].taxReader, iParams));
writers[0].close();
writers[1].close();
Modified: lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/associations/AssociationsFacetRequestTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/associations/AssociationsFacetRequestTest.java?rev=1433878&r1=1433877&r2=1433878&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/associations/AssociationsFacetRequestTest.java (original)
+++ lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/associations/AssociationsFacetRequestTest.java Wed Jan 16 10:09:43 2013
@@ -25,6 +25,7 @@ import org.apache.lucene.search.MatchAll
import org.apache.lucene.search.Query;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -46,7 +47,7 @@ import org.junit.Test;
* limitations under the License.
*/
-/** Test for associations */
+@SuppressCodecs("Lucene3x")
public class AssociationsFacetRequestTest extends LuceneTestCase {
private static Directory dir;
Modified: lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/params/FacetRequestTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/params/FacetRequestTest.java?rev=1433878&r1=1433877&r2=1433878&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/params/FacetRequestTest.java (original)
+++ lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/params/FacetRequestTest.java Wed Jan 16 10:09:43 2013
@@ -32,12 +32,12 @@ public class FacetRequestTest extends Lu
@Test(expected=IllegalArgumentException.class)
public void testIllegalNumResults() throws Exception {
- new CountFacetRequest(new CategoryPath("a", "b"), 0);
+ assertNotNull(new CountFacetRequest(new CategoryPath("a", "b"), 0));
}
@Test(expected=IllegalArgumentException.class)
public void testIllegalCategoryPath() throws Exception {
- new CountFacetRequest(null, 1);
+ assertNotNull(new CountFacetRequest(null, 1));
}
@Test
Modified: lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/params/FacetSearchParamsTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/params/FacetSearchParamsTest.java?rev=1433878&r1=1433877&r2=1433878&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/params/FacetSearchParamsTest.java (original)
+++ lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/params/FacetSearchParamsTest.java Wed Jan 16 10:09:43 2013
@@ -1,13 +1,5 @@
package org.apache.lucene.facet.search.params;
-import org.apache.lucene.facet.index.params.FacetIndexingParams;
-import org.apache.lucene.facet.taxonomy.CategoryPath;
-import org.apache.lucene.facet.taxonomy.TaxonomyReader;
-import org.apache.lucene.facet.taxonomy.TaxonomyWriter;
-import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyReader;
-import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter;
-import org.apache.lucene.facet.util.PartitionsUtils;
-import org.apache.lucene.store.Directory;
import org.apache.lucene.util.LuceneTestCase;
import org.junit.Test;
@@ -31,28 +23,6 @@ import org.junit.Test;
public class FacetSearchParamsTest extends LuceneTestCase {
@Test
- public void testAddFacetRequest() throws Exception {
- FacetSearchParams fsp = new FacetSearchParams(new CountFacetRequest(new CategoryPath("a", "b"), 1));
- assertEquals("expected 1 facet request", 1, fsp.getFacetRequests().size());
- }
-
- @Test
- public void testPartitionSizeWithCategories() throws Exception {
- Directory dir = newDirectory();
- TaxonomyWriter tw = new DirectoryTaxonomyWriter(dir);
- tw.addCategory(new CategoryPath("a"));
- tw.commit();
- tw.close();
- TaxonomyReader tr = new DirectoryTaxonomyReader(dir);
- assertEquals("unexpected partition offset for 1 categories", 2,
- PartitionsUtils.partitionOffset(FacetIndexingParams.ALL_PARENTS, 1, tr));
- assertEquals("unexpected partition size for 1 categories", 2,
- PartitionsUtils.partitionSize(FacetIndexingParams.ALL_PARENTS,tr));
- tr.close();
- dir.close();
- }
-
- @Test
public void testSearchParamsWithNullRequest() throws Exception {
try {
assertNull(new FacetSearchParams());
Modified: lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/params/MultiCategoryListIteratorTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/params/MultiCategoryListIteratorTest.java?rev=1433878&r1=1433877&r2=1433878&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/params/MultiCategoryListIteratorTest.java (original)
+++ lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/params/MultiCategoryListIteratorTest.java Wed Jan 16 10:09:43 2013
@@ -9,8 +9,7 @@ import org.apache.lucene.facet.index.Fac
import org.apache.lucene.facet.index.params.CategoryListParams;
import org.apache.lucene.facet.index.params.PerDimensionIndexingParams;
import org.apache.lucene.facet.search.CategoryListIterator;
-import org.apache.lucene.facet.search.PayloadCategoryListIteraor;
-import org.apache.lucene.facet.search.cache.CategoryListCache;
+import org.apache.lucene.facet.search.DocValuesCategoryListIterator;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
import org.apache.lucene.facet.taxonomy.TaxonomyWriter;
@@ -20,11 +19,11 @@ import org.apache.lucene.facet.util.Mult
import org.apache.lucene.index.AtomicReaderContext;
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexWriter;
-import org.apache.lucene.index.Term;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.IOUtils;
import org.apache.lucene.util.IntsRef;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
import org.apache.lucene.util.encoding.IntDecoder;
import org.junit.Test;
@@ -45,6 +44,7 @@ import org.junit.Test;
* limitations under the License.
*/
+@SuppressCodecs("Lucene3x")
public class MultiCategoryListIteratorTest extends LuceneTestCase {
@Test
@@ -60,7 +60,7 @@ public class MultiCategoryListIteratorTe
HashMap<CategoryPath,CategoryListParams> clps = new HashMap<CategoryPath,CategoryListParams>();
for (String dim : dimensions) {
CategoryPath cp = new CategoryPath(dim);
- CategoryListParams clp = new CategoryListParams(new Term("$" + dim, CategoryListParams.DEFAULT_TERM.bytes()));
+ CategoryListParams clp = new CategoryListParams("$" + dim);
clps.put(cp, clp);
}
PerDimensionIndexingParams indexingParams = new PerDimensionIndexingParams(clps);
@@ -86,23 +86,13 @@ public class MultiCategoryListIteratorTe
IOUtils.close(indexWriter, taxoWriter);
// test the multi iterator
- CategoryListCache clCache = null;
- if (random.nextBoolean()) {
- clCache = new CategoryListCache();
- }
-
DirectoryReader indexReader = DirectoryReader.open(indexDir);
TaxonomyReader taxoReader = new DirectoryTaxonomyReader(taxoDir);
CategoryListIterator[] iterators = new CategoryListIterator[numDimensions];
for (int i = 0; i < iterators.length; i++) {
CategoryListParams clp = indexingParams.getCategoryListParams(new CategoryPath(dimensions[i]));
IntDecoder decoder = clp.createEncoder().createMatchingDecoder();
- if (clCache != null && random.nextBoolean()) {
- clCache.loadAndRegister(clp, indexReader, taxoReader, indexingParams);
- iterators[i] = clCache.get(clp).iterator(0); // no partitions
- } else {
- iterators[i] = new PayloadCategoryListIteraor(clp.getTerm(), decoder);
- }
+ iterators[i] = new DocValuesCategoryListIterator(clp.field, decoder);
}
MultiCategoryListIterator cli = new MultiCategoryListIterator(iterators);
for (AtomicReaderContext context : indexReader.leaves()) {
Modified: lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/sampling/OversampleWithDepthTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/sampling/OversampleWithDepthTest.java?rev=1433878&r1=1433877&r2=1433878&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/sampling/OversampleWithDepthTest.java (original)
+++ lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/sampling/OversampleWithDepthTest.java Wed Jan 16 10:09:43 2013
@@ -30,6 +30,7 @@ import org.apache.lucene.store.Directory
import org.apache.lucene.store.LockObtainFailedException;
import org.apache.lucene.util.IOUtils;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
import org.junit.Test;
/*
@@ -49,6 +50,7 @@ import org.junit.Test;
* limitations under the License.
*/
+@SuppressCodecs("Lucene3x")
public class OversampleWithDepthTest extends LuceneTestCase {
@Test
Modified: lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestConcurrentFacetedIndexing.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestConcurrentFacetedIndexing.java?rev=1433878&r1=1433877&r2=1433878&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestConcurrentFacetedIndexing.java (original)
+++ lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestConcurrentFacetedIndexing.java Wed Jan 16 10:09:43 2013
@@ -18,6 +18,7 @@ import org.apache.lucene.index.IndexWrit
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.IOUtils;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -36,7 +37,7 @@ import org.apache.lucene.util.LuceneTest
* limitations under the License.
*/
-/** Tests concurrent indexing with facets. */
+@SuppressCodecs("Lucene3x")
public class TestConcurrentFacetedIndexing extends LuceneTestCase {
// A No-Op TaxonomyWriterCache which always discards all given categories, and