Skip to content

Apache Lucene open-source search software

LUCENE-4761: Facets package reorganization

Shai Erera7f243824d5ea
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 79301b0583e..40155a3a221 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -63,6 +63,9 @@ Changes in backwards compatibility policy
FacetsAggregator. You can still use StandardFacetsAccumulator, which works
with the old API (for now). (Shai Erera)
+* LUCENE-4761: Facet packages reorganized. Should be easy to fix your import
+ statements, if you use an IDE such as Eclipse. (Shai Erera)
+
Optimizations
* LUCENE-4687: BloomFilterPostingsFormat now lazily initializes delegate
diff --git a/lucene/demo/src/java/org/apache/lucene/demo/facet/ExampleResult.java b/lucene/demo/src/java/org/apache/lucene/demo/facet/ExampleResult.java
index e0d3abd54e4..144f6dc24be 100644
--- a/lucene/demo/src/java/org/apache/lucene/demo/facet/ExampleResult.java
+++ b/lucene/demo/src/java/org/apache/lucene/demo/facet/ExampleResult.java
@@ -2,7 +2,7 @@ package org.apache.lucene.demo.facet;
import java.util.List;
-import org.apache.lucene.facet.search.results.FacetResult;
+import org.apache.lucene.facet.search.FacetResult;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/lucene/demo/src/java/org/apache/lucene/demo/facet/adaptive/AdaptiveMain.java b/lucene/demo/src/java/org/apache/lucene/demo/facet/adaptive/AdaptiveMain.java
index 994d03f867e..5b35a9bf99f 100644
--- a/lucene/demo/src/java/org/apache/lucene/demo/facet/adaptive/AdaptiveMain.java
+++ b/lucene/demo/src/java/org/apache/lucene/demo/facet/adaptive/AdaptiveMain.java
@@ -10,7 +10,7 @@ import org.apache.lucene.demo.facet.ExampleUtils;
import org.apache.lucene.demo.facet.simple.SimpleIndexer;
import org.apache.lucene.demo.facet.simple.SimpleSearcher;
import org.apache.lucene.facet.search.AdaptiveFacetsAccumulator;
-import org.apache.lucene.facet.search.results.FacetResult;
+import org.apache.lucene.facet.search.FacetResult;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/lucene/demo/src/java/org/apache/lucene/demo/facet/adaptive/AdaptiveSearcher.java b/lucene/demo/src/java/org/apache/lucene/demo/facet/adaptive/AdaptiveSearcher.java
index 481e4a31343..2f17360c7f1 100644
--- a/lucene/demo/src/java/org/apache/lucene/demo/facet/adaptive/AdaptiveSearcher.java
+++ b/lucene/demo/src/java/org/apache/lucene/demo/facet/adaptive/AdaptiveSearcher.java
@@ -4,11 +4,11 @@ import java.util.List;
import org.apache.lucene.demo.facet.ExampleUtils;
import org.apache.lucene.demo.facet.simple.SimpleUtils;
+import org.apache.lucene.facet.params.FacetSearchParams;
import org.apache.lucene.facet.search.AdaptiveFacetsAccumulator;
+import org.apache.lucene.facet.search.CountFacetRequest;
+import org.apache.lucene.facet.search.FacetResult;
import org.apache.lucene.facet.search.FacetsCollector;
-import org.apache.lucene.facet.search.params.CountFacetRequest;
-import org.apache.lucene.facet.search.params.FacetSearchParams;
-import org.apache.lucene.facet.search.results.FacetResult;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyReader;
diff --git a/lucene/demo/src/java/org/apache/lucene/demo/facet/association/CategoryAssociationsMain.java b/lucene/demo/src/java/org/apache/lucene/demo/facet/association/CategoryAssociationsMain.java
index 2a80951be83..496146574ce 100644
--- a/lucene/demo/src/java/org/apache/lucene/demo/facet/association/CategoryAssociationsMain.java
+++ b/lucene/demo/src/java/org/apache/lucene/demo/facet/association/CategoryAssociationsMain.java
@@ -7,7 +7,7 @@ import org.apache.lucene.store.RAMDirectory;
import org.apache.lucene.demo.facet.ExampleResult;
import org.apache.lucene.demo.facet.ExampleUtils;
-import org.apache.lucene.facet.search.results.FacetResult;
+import org.apache.lucene.facet.search.FacetResult;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/lucene/demo/src/java/org/apache/lucene/demo/facet/association/CategoryAssociationsSearcher.java b/lucene/demo/src/java/org/apache/lucene/demo/facet/association/CategoryAssociationsSearcher.java
index 5e6d7ecd925..0e33db3f5a2 100644
--- a/lucene/demo/src/java/org/apache/lucene/demo/facet/association/CategoryAssociationsSearcher.java
+++ b/lucene/demo/src/java/org/apache/lucene/demo/facet/association/CategoryAssociationsSearcher.java
@@ -7,9 +7,9 @@ import org.apache.lucene.index.IndexReader;
import org.apache.lucene.store.Directory;
import org.apache.lucene.demo.facet.simple.SimpleSearcher;
-import org.apache.lucene.facet.search.params.associations.AssociationFloatSumFacetRequest;
-import org.apache.lucene.facet.search.params.associations.AssociationIntSumFacetRequest;
-import org.apache.lucene.facet.search.results.FacetResult;
+import org.apache.lucene.facet.associations.AssociationFloatSumFacetRequest;
+import org.apache.lucene.facet.associations.AssociationIntSumFacetRequest;
+import org.apache.lucene.facet.search.FacetResult;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyReader;
diff --git a/lucene/demo/src/java/org/apache/lucene/demo/facet/multiCL/MultiCLIndexer.java b/lucene/demo/src/java/org/apache/lucene/demo/facet/multiCL/MultiCLIndexer.java
index d98d28eddef..56003c21b02 100644
--- a/lucene/demo/src/java/org/apache/lucene/demo/facet/multiCL/MultiCLIndexer.java
+++ b/lucene/demo/src/java/org/apache/lucene/demo/facet/multiCL/MultiCLIndexer.java
@@ -12,9 +12,9 @@ import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.TextField;
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.params.CategoryListParams;
+import org.apache.lucene.facet.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.PerDimensionIndexingParams;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter;
import org.apache.lucene.index.IndexWriter;
diff --git a/lucene/demo/src/java/org/apache/lucene/demo/facet/multiCL/MultiCLMain.java b/lucene/demo/src/java/org/apache/lucene/demo/facet/multiCL/MultiCLMain.java
index c82ca1f3185..2628a9b75ef 100644
--- a/lucene/demo/src/java/org/apache/lucene/demo/facet/multiCL/MultiCLMain.java
+++ b/lucene/demo/src/java/org/apache/lucene/demo/facet/multiCL/MultiCLMain.java
@@ -7,7 +7,7 @@ import org.apache.lucene.store.RAMDirectory;
import org.apache.lucene.demo.facet.ExampleResult;
import org.apache.lucene.demo.facet.ExampleUtils;
-import org.apache.lucene.facet.search.results.FacetResult;
+import org.apache.lucene.facet.search.FacetResult;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/lucene/demo/src/java/org/apache/lucene/demo/facet/multiCL/MultiCLSearcher.java b/lucene/demo/src/java/org/apache/lucene/demo/facet/multiCL/MultiCLSearcher.java
index 6b5b07f605c..ebbafc1f317 100644
--- a/lucene/demo/src/java/org/apache/lucene/demo/facet/multiCL/MultiCLSearcher.java
+++ b/lucene/demo/src/java/org/apache/lucene/demo/facet/multiCL/MultiCLSearcher.java
@@ -15,12 +15,12 @@ import org.apache.lucene.store.Directory;
import org.apache.lucene.search.MultiCollector;
import org.apache.lucene.demo.facet.ExampleUtils;
import org.apache.lucene.demo.facet.simple.SimpleUtils;
-import org.apache.lucene.facet.index.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.FacetSearchParams;
+import org.apache.lucene.facet.search.CountFacetRequest;
+import org.apache.lucene.facet.search.FacetRequest;
+import org.apache.lucene.facet.search.FacetResult;
import org.apache.lucene.facet.search.FacetsCollector;
-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.results.FacetResult;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyReader;
diff --git a/lucene/demo/src/java/org/apache/lucene/demo/facet/simple/SimpleMain.java b/lucene/demo/src/java/org/apache/lucene/demo/facet/simple/SimpleMain.java
index 22448f8302e..1fe0eb56469 100644
--- a/lucene/demo/src/java/org/apache/lucene/demo/facet/simple/SimpleMain.java
+++ b/lucene/demo/src/java/org/apache/lucene/demo/facet/simple/SimpleMain.java
@@ -9,7 +9,7 @@ import org.apache.lucene.store.RAMDirectory;
import org.apache.lucene.demo.facet.ExampleResult;
import org.apache.lucene.demo.facet.ExampleUtils;
-import org.apache.lucene.facet.search.results.FacetResult;
+import org.apache.lucene.facet.search.FacetResult;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyReader;
diff --git a/lucene/demo/src/java/org/apache/lucene/demo/facet/simple/SimpleSearcher.java b/lucene/demo/src/java/org/apache/lucene/demo/facet/simple/SimpleSearcher.java
index 10b14ca66fb..a3ca72683d7 100644
--- a/lucene/demo/src/java/org/apache/lucene/demo/facet/simple/SimpleSearcher.java
+++ b/lucene/demo/src/java/org/apache/lucene/demo/facet/simple/SimpleSearcher.java
@@ -4,14 +4,14 @@ import java.util.Iterator;
import java.util.List;
import org.apache.lucene.demo.facet.ExampleUtils;
-import org.apache.lucene.facet.index.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.FacetSearchParams;
+import org.apache.lucene.facet.search.CountFacetRequest;
import org.apache.lucene.facet.search.DrillDown;
+import org.apache.lucene.facet.search.FacetRequest;
+import org.apache.lucene.facet.search.FacetResult;
+import org.apache.lucene.facet.search.FacetResultNode;
import org.apache.lucene.facet.search.FacetsCollector;
-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.results.FacetResult;
-import org.apache.lucene.facet.search.results.FacetResultNode;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
import org.apache.lucene.index.IndexReader;
diff --git a/lucene/demo/src/test/org/apache/lucene/demo/facet/TestAssociationExample.java b/lucene/demo/src/test/org/apache/lucene/demo/facet/TestAssociationExample.java
index a6010783675..cdb9a3c2172 100644
--- a/lucene/demo/src/test/org/apache/lucene/demo/facet/TestAssociationExample.java
+++ b/lucene/demo/src/test/org/apache/lucene/demo/facet/TestAssociationExample.java
@@ -5,7 +5,7 @@ import org.junit.Test;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.demo.facet.ExampleResult;
import org.apache.lucene.demo.facet.association.CategoryAssociationsMain;
-import org.apache.lucene.facet.search.results.FacetResultNode;
+import org.apache.lucene.facet.search.FacetResultNode;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/lucene/demo/src/test/org/apache/lucene/demo/facet/TestMultiCLExample.java b/lucene/demo/src/test/org/apache/lucene/demo/facet/TestMultiCLExample.java
index a422261884a..eaec26cfea1 100644
--- a/lucene/demo/src/test/org/apache/lucene/demo/facet/TestMultiCLExample.java
+++ b/lucene/demo/src/test/org/apache/lucene/demo/facet/TestMultiCLExample.java
@@ -8,8 +8,8 @@ import org.junit.Test;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.demo.facet.ExampleResult;
import org.apache.lucene.demo.facet.multiCL.MultiCLMain;
-import org.apache.lucene.facet.search.results.FacetResult;
-import org.apache.lucene.facet.search.results.FacetResultNode;
+import org.apache.lucene.facet.search.FacetResult;
+import org.apache.lucene.facet.search.FacetResultNode;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/lucene/demo/src/test/org/apache/lucene/demo/facet/TestSimpleExample.java b/lucene/demo/src/test/org/apache/lucene/demo/facet/TestSimpleExample.java
index 7fb9e707b9c..7a4b833cec1 100644
--- a/lucene/demo/src/test/org/apache/lucene/demo/facet/TestSimpleExample.java
+++ b/lucene/demo/src/test/org/apache/lucene/demo/facet/TestSimpleExample.java
@@ -7,8 +7,8 @@ import org.junit.Test;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.demo.facet.ExampleResult;
import org.apache.lucene.demo.facet.simple.SimpleMain;
-import org.apache.lucene.facet.search.results.FacetResult;
-import org.apache.lucene.facet.search.results.FacetResultNode;
+import org.apache.lucene.facet.search.FacetResult;
+import org.apache.lucene.facet.search.FacetResultNode;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/FacetException.java b/lucene/facet/src/java/org/apache/lucene/facet/FacetException.java
deleted file mode 100644
index d0281924802..00000000000
--- a/lucene/facet/src/java/org/apache/lucene/facet/FacetException.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package org.apache.lucene.facet;
-
-import java.io.IOException;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * A parent class for exceptions thrown by the Facets code.
- *
- * @lucene.experimental
- */
-public class FacetException extends IOException {
-
- public FacetException() {
- super();
- }
-
- public FacetException(String message) {
- super(message);
- }
-
- public FacetException(String message, Throwable cause) {
- super(message);
- initCause(cause);
- }
-
- public FacetException(Throwable cause) {
- initCause(cause);
- }
-
-}
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/aggregator/associations/AssociationFloatSumAggregator.java b/lucene/facet/src/java/org/apache/lucene/facet/associations/AssociationFloatSumAggregator.java
similarity index 86%
rename from lucene/facet/src/java/org/apache/lucene/facet/search/aggregator/associations/AssociationFloatSumAggregator.java
rename to lucene/facet/src/java/org/apache/lucene/facet/associations/AssociationFloatSumAggregator.java
index d35428f5b64..eee7c731408 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/aggregator/associations/AssociationFloatSumAggregator.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/associations/AssociationFloatSumAggregator.java
@@ -1,14 +1,12 @@
-package org.apache.lucene.facet.search.aggregator.associations;
+package org.apache.lucene.facet.associations;
import java.io.IOException;
-import org.apache.lucene.facet.associations.CategoryFloatAssociation;
-import org.apache.lucene.facet.associations.FloatAssociationsIterator;
-import org.apache.lucene.facet.index.params.CategoryListParams;
-import org.apache.lucene.facet.search.aggregator.Aggregator;
+import org.apache.lucene.facet.collections.IntToFloatMap;
+import org.apache.lucene.facet.params.CategoryListParams;
+import org.apache.lucene.facet.search.Aggregator;
import org.apache.lucene.index.AtomicReaderContext;
import org.apache.lucene.util.IntsRef;
-import org.apache.lucene.util.collections.IntToFloatMap;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/params/associations/AssociationFloatSumFacetRequest.java b/lucene/facet/src/java/org/apache/lucene/facet/associations/AssociationFloatSumFacetRequest.java
similarity index 88%
rename from lucene/facet/src/java/org/apache/lucene/facet/search/params/associations/AssociationFloatSumFacetRequest.java
rename to lucene/facet/src/java/org/apache/lucene/facet/associations/AssociationFloatSumFacetRequest.java
index 0b7a281947a..898598dacf3 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/params/associations/AssociationFloatSumFacetRequest.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/associations/AssociationFloatSumFacetRequest.java
@@ -1,11 +1,10 @@
-package org.apache.lucene.facet.search.params.associations;
+package org.apache.lucene.facet.associations;
import java.io.IOException;
+import org.apache.lucene.facet.search.Aggregator;
import org.apache.lucene.facet.search.FacetArrays;
-import org.apache.lucene.facet.search.aggregator.Aggregator;
-import org.apache.lucene.facet.search.aggregator.associations.AssociationFloatSumAggregator;
-import org.apache.lucene.facet.search.params.FacetRequest;
+import org.apache.lucene.facet.search.FacetRequest;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/aggregator/associations/AssociationIntSumAggregator.java b/lucene/facet/src/java/org/apache/lucene/facet/associations/AssociationIntSumAggregator.java
similarity index 87%
rename from lucene/facet/src/java/org/apache/lucene/facet/search/aggregator/associations/AssociationIntSumAggregator.java
rename to lucene/facet/src/java/org/apache/lucene/facet/associations/AssociationIntSumAggregator.java
index ec20dc37232..101f02fdf61 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/aggregator/associations/AssociationIntSumAggregator.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/associations/AssociationIntSumAggregator.java
@@ -1,14 +1,12 @@
-package org.apache.lucene.facet.search.aggregator.associations;
+package org.apache.lucene.facet.associations;
import java.io.IOException;
-import org.apache.lucene.facet.associations.CategoryIntAssociation;
-import org.apache.lucene.facet.associations.IntAssociationsIterator;
-import org.apache.lucene.facet.index.params.CategoryListParams;
-import org.apache.lucene.facet.search.aggregator.Aggregator;
+import org.apache.lucene.facet.collections.IntToIntMap;
+import org.apache.lucene.facet.params.CategoryListParams;
+import org.apache.lucene.facet.search.Aggregator;
import org.apache.lucene.index.AtomicReaderContext;
import org.apache.lucene.util.IntsRef;
-import org.apache.lucene.util.collections.IntToIntMap;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/params/associations/AssociationIntSumFacetRequest.java b/lucene/facet/src/java/org/apache/lucene/facet/associations/AssociationIntSumFacetRequest.java
similarity index 85%
rename from lucene/facet/src/java/org/apache/lucene/facet/search/params/associations/AssociationIntSumFacetRequest.java
rename to lucene/facet/src/java/org/apache/lucene/facet/associations/AssociationIntSumFacetRequest.java
index f42afe17a7c..34bcf39c6af 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/params/associations/AssociationIntSumFacetRequest.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/associations/AssociationIntSumFacetRequest.java
@@ -1,12 +1,10 @@
-package org.apache.lucene.facet.search.params.associations;
+package org.apache.lucene.facet.associations;
import java.io.IOException;
+import org.apache.lucene.facet.search.Aggregator;
import org.apache.lucene.facet.search.FacetArrays;
-import org.apache.lucene.facet.search.aggregator.Aggregator;
-import org.apache.lucene.facet.search.aggregator.associations.AssociationFloatSumAggregator;
-import org.apache.lucene.facet.search.aggregator.associations.AssociationIntSumAggregator;
-import org.apache.lucene.facet.search.params.FacetRequest;
+import org.apache.lucene.facet.search.FacetRequest;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/associations/search/AssociationIntSumFacetsAggregator.java b/lucene/facet/src/java/org/apache/lucene/facet/associations/AssociationIntSumFacetsAggregator.java
similarity index 84%
rename from lucene/facet/src/java/org/apache/lucene/facet/associations/search/AssociationIntSumFacetsAggregator.java
rename to lucene/facet/src/java/org/apache/lucene/facet/associations/AssociationIntSumFacetsAggregator.java
index 0f5fb156fe1..96c50d189ba 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/associations/search/AssociationIntSumFacetsAggregator.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/associations/AssociationIntSumFacetsAggregator.java
@@ -1,9 +1,10 @@
-package org.apache.lucene.facet.associations.search;
+package org.apache.lucene.facet.associations;
import java.io.IOException;
-import org.apache.lucene.facet.index.params.CategoryListParams;
+import org.apache.lucene.facet.params.CategoryListParams;
import org.apache.lucene.facet.search.FacetArrays;
+import org.apache.lucene.facet.search.FacetRequest;
import org.apache.lucene.facet.search.FacetsAggregator;
import org.apache.lucene.facet.search.FacetsCollector.MatchingDocs;
@@ -35,8 +36,8 @@ public class AssociationIntSumFacetsAggregator implements FacetsAggregator {
FacetArrays facetArrays) throws IOException {}
@Override
- public void rollupValues(int ordinal, int[] children, int[] siblings,
- FacetArrays facetArrays) {}
+ public void rollupValues(FacetRequest fr, int ordinal, int[] children,
+ int[] siblings, FacetArrays facetArrays) {}
@Override
public boolean requiresDocScores() {
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/associations/AssociationsDrillDownStream.java b/lucene/facet/src/java/org/apache/lucene/facet/associations/AssociationsDrillDownStream.java
index fdc7ff6ae29..c607fd702f0 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/associations/AssociationsDrillDownStream.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/associations/AssociationsDrillDownStream.java
@@ -2,7 +2,7 @@ package org.apache.lucene.facet.associations;
import org.apache.lucene.analysis.tokenattributes.PayloadAttribute;
import org.apache.lucene.facet.index.DrillDownStream;
-import org.apache.lucene.facet.index.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.FacetIndexingParams;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.store.ByteArrayDataOutput;
import org.apache.lucene.util.BytesRef;
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/associations/AssociationsFacetFields.java b/lucene/facet/src/java/org/apache/lucene/facet/associations/AssociationsFacetFields.java
index 0e611176b7b..2cdfef2bf1b 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/associations/AssociationsFacetFields.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/associations/AssociationsFacetFields.java
@@ -10,8 +10,8 @@ import org.apache.lucene.document.TextField;
import org.apache.lucene.facet.index.CountingListBuilder;
import org.apache.lucene.facet.index.DrillDownStream;
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.params.CategoryListParams;
+import org.apache.lucene.facet.params.FacetIndexingParams;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.facet.taxonomy.TaxonomyWriter;
import org.apache.lucene.index.FieldInfo.IndexOptions;
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/associations/FloatAssociationsIterator.java b/lucene/facet/src/java/org/apache/lucene/facet/associations/FloatAssociationsIterator.java
index daa791e35f6..e897e9f9b6b 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/associations/FloatAssociationsIterator.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/associations/FloatAssociationsIterator.java
@@ -2,7 +2,7 @@ package org.apache.lucene.facet.associations;
import java.io.IOException;
-import org.apache.lucene.util.collections.IntToFloatMap;
+import org.apache.lucene.facet.collections.IntToFloatMap;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/associations/IntAssociationsIterator.java b/lucene/facet/src/java/org/apache/lucene/facet/associations/IntAssociationsIterator.java
index 0a7b74b52bc..b60c2b6360f 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/associations/IntAssociationsIterator.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/associations/IntAssociationsIterator.java
@@ -2,7 +2,7 @@ package org.apache.lucene.facet.associations;
import java.io.IOException;
-import org.apache.lucene.util.collections.IntToIntMap;
+import org.apache.lucene.facet.collections.IntToIntMap;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/associations/package.html b/lucene/facet/src/java/org/apache/lucene/facet/associations/package.html
index 79f2de707d3..e20828c22bf 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/associations/package.html
+++ b/lucene/facet/src/java/org/apache/lucene/facet/associations/package.html
@@ -19,11 +19,7 @@
<title>Category Association</title>
</head>
<body>
-<h1>Category Association</h1>
-
-Allows association of arbitrary values with a category. The value can be used e.g. to compute
-the category's weight during faceted search. Two association implementations exist for
-{@link org.apache.lucene.facet.associations.CategoryIntAssociation int} and
-{@link org.apache.lucene.facet.associations.CategoryFloatAssociation float} values.
+Allows associating arbitrary values with a category. The value can be used e.g. to compute
+the category's weight during faceted search.
</body>
</html>
diff --git a/lucene/facet/src/java/org/apache/lucene/util/collections/ArrayHashMap.java b/lucene/facet/src/java/org/apache/lucene/facet/collections/ArrayHashMap.java
similarity index 99%
rename from lucene/facet/src/java/org/apache/lucene/util/collections/ArrayHashMap.java
rename to lucene/facet/src/java/org/apache/lucene/facet/collections/ArrayHashMap.java
index cce38084e1f..93fe9e1d914 100644
--- a/lucene/facet/src/java/org/apache/lucene/util/collections/ArrayHashMap.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/collections/ArrayHashMap.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.util.collections;
+package org.apache.lucene.facet.collections;
import java.util.Arrays;
import java.util.Iterator;
diff --git a/lucene/facet/src/java/org/apache/lucene/util/collections/DoubleIterator.java b/lucene/facet/src/java/org/apache/lucene/facet/collections/DoubleIterator.java
similarity index 95%
rename from lucene/facet/src/java/org/apache/lucene/util/collections/DoubleIterator.java
rename to lucene/facet/src/java/org/apache/lucene/facet/collections/DoubleIterator.java
index c3c92612ff0..00a0e730c4a 100644
--- a/lucene/facet/src/java/org/apache/lucene/util/collections/DoubleIterator.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/collections/DoubleIterator.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.util.collections;
+package org.apache.lucene.facet.collections;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/lucene/facet/src/java/org/apache/lucene/util/collections/FloatIterator.java b/lucene/facet/src/java/org/apache/lucene/facet/collections/FloatIterator.java
similarity index 95%
rename from lucene/facet/src/java/org/apache/lucene/util/collections/FloatIterator.java
rename to lucene/facet/src/java/org/apache/lucene/facet/collections/FloatIterator.java
index 7e6a728ca55..677b6fa9bb0 100644
--- a/lucene/facet/src/java/org/apache/lucene/util/collections/FloatIterator.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/collections/FloatIterator.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.util.collections;
+package org.apache.lucene.facet.collections;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/lucene/facet/src/java/org/apache/lucene/util/collections/FloatToObjectMap.java b/lucene/facet/src/java/org/apache/lucene/facet/collections/FloatToObjectMap.java
similarity index 99%
rename from lucene/facet/src/java/org/apache/lucene/util/collections/FloatToObjectMap.java
rename to lucene/facet/src/java/org/apache/lucene/facet/collections/FloatToObjectMap.java
index c096fe4d603..da5c4f84128 100644
--- a/lucene/facet/src/java/org/apache/lucene/util/collections/FloatToObjectMap.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/collections/FloatToObjectMap.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.util.collections;
+package org.apache.lucene.facet.collections;
import java.util.Arrays;
import java.util.Iterator;
diff --git a/lucene/facet/src/java/org/apache/lucene/util/collections/IntArray.java b/lucene/facet/src/java/org/apache/lucene/facet/collections/IntArray.java
similarity index 99%
rename from lucene/facet/src/java/org/apache/lucene/util/collections/IntArray.java
rename to lucene/facet/src/java/org/apache/lucene/facet/collections/IntArray.java
index d1d59ef5484..9cb6e1cc9a6 100644
--- a/lucene/facet/src/java/org/apache/lucene/util/collections/IntArray.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/collections/IntArray.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.util.collections;
+package org.apache.lucene.facet.collections;
import java.util.Arrays;
diff --git a/lucene/facet/src/java/org/apache/lucene/util/collections/IntHashSet.java b/lucene/facet/src/java/org/apache/lucene/facet/collections/IntHashSet.java
similarity index 99%
rename from lucene/facet/src/java/org/apache/lucene/util/collections/IntHashSet.java
rename to lucene/facet/src/java/org/apache/lucene/facet/collections/IntHashSet.java
index b9f383d61ea..3d5a81718f5 100644
--- a/lucene/facet/src/java/org/apache/lucene/util/collections/IntHashSet.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/collections/IntHashSet.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.util.collections;
+package org.apache.lucene.facet.collections;
import java.util.Arrays;
diff --git a/lucene/facet/src/java/org/apache/lucene/util/collections/IntIterator.java b/lucene/facet/src/java/org/apache/lucene/facet/collections/IntIterator.java
similarity index 95%
rename from lucene/facet/src/java/org/apache/lucene/util/collections/IntIterator.java
rename to lucene/facet/src/java/org/apache/lucene/facet/collections/IntIterator.java
index 9bd9ea3d91d..a69b2cbeb1e 100644
--- a/lucene/facet/src/java/org/apache/lucene/util/collections/IntIterator.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/collections/IntIterator.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.util.collections;
+package org.apache.lucene.facet.collections;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/lucene/facet/src/java/org/apache/lucene/util/collections/IntToDoubleMap.java b/lucene/facet/src/java/org/apache/lucene/facet/collections/IntToDoubleMap.java
similarity index 99%
rename from lucene/facet/src/java/org/apache/lucene/util/collections/IntToDoubleMap.java
rename to lucene/facet/src/java/org/apache/lucene/facet/collections/IntToDoubleMap.java
index c7b4064a882..b787ab61e9a 100644
--- a/lucene/facet/src/java/org/apache/lucene/util/collections/IntToDoubleMap.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/collections/IntToDoubleMap.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.util.collections;
+package org.apache.lucene.facet.collections;
import java.util.Arrays;
diff --git a/lucene/facet/src/java/org/apache/lucene/util/collections/IntToFloatMap.java b/lucene/facet/src/java/org/apache/lucene/facet/collections/IntToFloatMap.java
similarity index 99%
rename from lucene/facet/src/java/org/apache/lucene/util/collections/IntToFloatMap.java
rename to lucene/facet/src/java/org/apache/lucene/facet/collections/IntToFloatMap.java
index 1f257bc85dd..3e9d7aee2b8 100644
--- a/lucene/facet/src/java/org/apache/lucene/util/collections/IntToFloatMap.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/collections/IntToFloatMap.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.util.collections;
+package org.apache.lucene.facet.collections;
import java.util.Arrays;
diff --git a/lucene/facet/src/java/org/apache/lucene/util/collections/IntToIntMap.java b/lucene/facet/src/java/org/apache/lucene/facet/collections/IntToIntMap.java
similarity index 99%
rename from lucene/facet/src/java/org/apache/lucene/util/collections/IntToIntMap.java
rename to lucene/facet/src/java/org/apache/lucene/facet/collections/IntToIntMap.java
index 76155a547b2..f2f27fce417 100644
--- a/lucene/facet/src/java/org/apache/lucene/util/collections/IntToIntMap.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/collections/IntToIntMap.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.util.collections;
+package org.apache.lucene.facet.collections;
import java.util.Arrays;
diff --git a/lucene/facet/src/java/org/apache/lucene/util/collections/IntToObjectMap.java b/lucene/facet/src/java/org/apache/lucene/facet/collections/IntToObjectMap.java
similarity index 99%
rename from lucene/facet/src/java/org/apache/lucene/util/collections/IntToObjectMap.java
rename to lucene/facet/src/java/org/apache/lucene/facet/collections/IntToObjectMap.java
index 42d429b0961..9db16ec189f 100644
--- a/lucene/facet/src/java/org/apache/lucene/util/collections/IntToObjectMap.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/collections/IntToObjectMap.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.util.collections;
+package org.apache.lucene.facet.collections;
import java.util.Arrays;
import java.util.Iterator;
diff --git a/lucene/facet/src/java/org/apache/lucene/util/collections/LRUHashMap.java b/lucene/facet/src/java/org/apache/lucene/facet/collections/LRUHashMap.java
similarity index 99%
rename from lucene/facet/src/java/org/apache/lucene/util/collections/LRUHashMap.java
rename to lucene/facet/src/java/org/apache/lucene/facet/collections/LRUHashMap.java
index fe084dc0959..5565319c288 100644
--- a/lucene/facet/src/java/org/apache/lucene/util/collections/LRUHashMap.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/collections/LRUHashMap.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.util.collections;
+package org.apache.lucene.facet.collections;
import java.util.LinkedHashMap;
import java.util.Map;
diff --git a/lucene/facet/src/java/org/apache/lucene/util/collections/ObjectToFloatMap.java b/lucene/facet/src/java/org/apache/lucene/facet/collections/ObjectToFloatMap.java
similarity index 99%
rename from lucene/facet/src/java/org/apache/lucene/util/collections/ObjectToFloatMap.java
rename to lucene/facet/src/java/org/apache/lucene/facet/collections/ObjectToFloatMap.java
index 602c26e38d6..7c7a95cd92f 100644
--- a/lucene/facet/src/java/org/apache/lucene/util/collections/ObjectToFloatMap.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/collections/ObjectToFloatMap.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.util.collections;
+package org.apache.lucene.facet.collections;
import java.util.Arrays;
import java.util.Iterator;
diff --git a/lucene/facet/src/java/org/apache/lucene/util/collections/ObjectToIntMap.java b/lucene/facet/src/java/org/apache/lucene/facet/collections/ObjectToIntMap.java
similarity index 99%
rename from lucene/facet/src/java/org/apache/lucene/util/collections/ObjectToIntMap.java
rename to lucene/facet/src/java/org/apache/lucene/facet/collections/ObjectToIntMap.java
index 673f3472b57..a7ce7a6e278 100644
--- a/lucene/facet/src/java/org/apache/lucene/util/collections/ObjectToIntMap.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/collections/ObjectToIntMap.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.util.collections;
+package org.apache.lucene.facet.collections;
import java.util.Arrays;
import java.util.Iterator;
diff --git a/lucene/facet/src/java/org/apache/lucene/util/collections/package.html b/lucene/facet/src/java/org/apache/lucene/facet/collections/package.html
similarity index 90%
rename from lucene/facet/src/java/org/apache/lucene/util/collections/package.html
rename to lucene/facet/src/java/org/apache/lucene/facet/collections/package.html
index 46860960958..792be18a139 100644
--- a/lucene/facet/src/java/org/apache/lucene/util/collections/package.html
+++ b/lucene/facet/src/java/org/apache/lucene/facet/collections/package.html
@@ -16,9 +16,9 @@
-->
<html>
<head>
-<title>Collections</title>
+<title>Facets Collections</title>
</head>
<body>
- Various optimized Collections implementations.
+Various optimized Collections implementations.
</body>
</html>
\ No newline at end of file
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/aggregator/ComplementCountingAggregator.java b/lucene/facet/src/java/org/apache/lucene/facet/complements/ComplementCountingAggregator.java
similarity index 93%
rename from lucene/facet/src/java/org/apache/lucene/facet/search/aggregator/ComplementCountingAggregator.java
rename to lucene/facet/src/java/org/apache/lucene/facet/complements/ComplementCountingAggregator.java
index 50ca39fa352..e12dd6f3ac0 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/aggregator/ComplementCountingAggregator.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/complements/ComplementCountingAggregator.java
@@ -1,7 +1,8 @@
-package org.apache.lucene.facet.search.aggregator;
+package org.apache.lucene.facet.complements;
import java.io.IOException;
+import org.apache.lucene.facet.search.CountingAggregator;
import org.apache.lucene.util.IntsRef;
/*
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/TotalFacetCounts.java b/lucene/facet/src/java/org/apache/lucene/facet/complements/TotalFacetCounts.java
similarity index 91%
rename from lucene/facet/src/java/org/apache/lucene/facet/search/TotalFacetCounts.java
rename to lucene/facet/src/java/org/apache/lucene/facet/complements/TotalFacetCounts.java
index 8919b734097..b1778646cfa 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/TotalFacetCounts.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/complements/TotalFacetCounts.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.facet.search;
+package org.apache.lucene.facet.complements;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
@@ -11,13 +11,16 @@ import java.io.IOException;
import java.util.HashMap;
import java.util.concurrent.atomic.AtomicInteger;
-import org.apache.lucene.facet.index.params.CategoryListParams;
-import org.apache.lucene.facet.index.params.FacetIndexingParams;
-import org.apache.lucene.facet.search.aggregator.Aggregator;
-import org.apache.lucene.facet.search.aggregator.CountingAggregator;
-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.params.CategoryListParams;
+import org.apache.lucene.facet.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.FacetSearchParams;
+import org.apache.lucene.facet.search.Aggregator;
+import org.apache.lucene.facet.search.CategoryListIterator;
+import org.apache.lucene.facet.search.CountFacetRequest;
+import org.apache.lucene.facet.search.CountingAggregator;
+import org.apache.lucene.facet.search.FacetArrays;
+import org.apache.lucene.facet.search.FacetRequest;
+import org.apache.lucene.facet.search.StandardFacetsAccumulator;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
import org.apache.lucene.facet.util.PartitionsUtils;
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/TotalFacetCountsCache.java b/lucene/facet/src/java/org/apache/lucene/facet/complements/TotalFacetCountsCache.java
similarity index 98%
rename from lucene/facet/src/java/org/apache/lucene/facet/search/TotalFacetCountsCache.java
rename to lucene/facet/src/java/org/apache/lucene/facet/complements/TotalFacetCountsCache.java
index 95ba9603c4f..6000e8c54f9 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/TotalFacetCountsCache.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/complements/TotalFacetCountsCache.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.facet.search;
+package org.apache.lucene.facet.complements;
import java.io.File;
import java.io.IOException;
@@ -7,8 +7,8 @@ import java.util.LinkedHashMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedQueue;
-import org.apache.lucene.facet.index.params.CategoryListParams;
-import org.apache.lucene.facet.index.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.CategoryListParams;
+import org.apache.lucene.facet.params.FacetIndexingParams;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
import org.apache.lucene.index.IndexReader;
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/index/params/package.html b/lucene/facet/src/java/org/apache/lucene/facet/complements/package.html
similarity index 71%
rename from lucene/facet/src/java/org/apache/lucene/facet/index/params/package.html
rename to lucene/facet/src/java/org/apache/lucene/facet/complements/package.html
index 1e867529ede..beca697e675 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/index/params/package.html
+++ b/lucene/facet/src/java/org/apache/lucene/facet/complements/package.html
@@ -16,13 +16,12 @@
-->
<html>
<head>
-<title>Indexing-time specifications for handling facets</title>
+<title>Facets Complements counting</title>
</head>
<body>
-<h1>Indexing-time specifications for handling facets</h1>
-
-Parameters on how facets are to be written to the index,
-such as which fields and terms are used to refer to the facets posting list.
-
+Allows to cache the total counts of categories, so that during search which
+returns a large number of results (>60% of segment size), the complement set
+of matching documents is counted. Useful for queries that visit a large
+number of documents, e.g. overview queries.
</body>
</html>
\ No newline at end of file
diff --git a/lucene/facet/src/java/org/apache/lucene/util/encoding/ChunksIntEncoder.java b/lucene/facet/src/java/org/apache/lucene/facet/encoding/ChunksIntEncoder.java
similarity index 99%
rename from lucene/facet/src/java/org/apache/lucene/util/encoding/ChunksIntEncoder.java
rename to lucene/facet/src/java/org/apache/lucene/facet/encoding/ChunksIntEncoder.java
index 8829f2b9e57..464f4e9abdf 100644
--- a/lucene/facet/src/java/org/apache/lucene/util/encoding/ChunksIntEncoder.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/encoding/ChunksIntEncoder.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.util.encoding;
+package org.apache.lucene.facet.encoding;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.IntsRef;
diff --git a/lucene/facet/src/java/org/apache/lucene/util/encoding/DGapIntDecoder.java b/lucene/facet/src/java/org/apache/lucene/facet/encoding/DGapIntDecoder.java
similarity index 97%
rename from lucene/facet/src/java/org/apache/lucene/util/encoding/DGapIntDecoder.java
rename to lucene/facet/src/java/org/apache/lucene/facet/encoding/DGapIntDecoder.java
index 5e908206800..5537663ba1a 100644
--- a/lucene/facet/src/java/org/apache/lucene/util/encoding/DGapIntDecoder.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/encoding/DGapIntDecoder.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.util.encoding;
+package org.apache.lucene.facet.encoding;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.IntsRef;
diff --git a/lucene/facet/src/java/org/apache/lucene/util/encoding/DGapIntEncoder.java b/lucene/facet/src/java/org/apache/lucene/facet/encoding/DGapIntEncoder.java
similarity index 98%
rename from lucene/facet/src/java/org/apache/lucene/util/encoding/DGapIntEncoder.java
rename to lucene/facet/src/java/org/apache/lucene/facet/encoding/DGapIntEncoder.java
index 5e8ca5d293d..0aaf5d3d493 100644
--- a/lucene/facet/src/java/org/apache/lucene/util/encoding/DGapIntEncoder.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/encoding/DGapIntEncoder.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.util.encoding;
+package org.apache.lucene.facet.encoding;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.IntsRef;
diff --git a/lucene/facet/src/java/org/apache/lucene/util/encoding/DGapVInt8IntDecoder.java b/lucene/facet/src/java/org/apache/lucene/facet/encoding/DGapVInt8IntDecoder.java
similarity index 98%
rename from lucene/facet/src/java/org/apache/lucene/util/encoding/DGapVInt8IntDecoder.java
rename to lucene/facet/src/java/org/apache/lucene/facet/encoding/DGapVInt8IntDecoder.java
index d5a533234cd..c72c1185a8b 100644
--- a/lucene/facet/src/java/org/apache/lucene/util/encoding/DGapVInt8IntDecoder.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/encoding/DGapVInt8IntDecoder.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.util.encoding;
+package org.apache.lucene.facet.encoding;
import org.apache.lucene.util.ArrayUtil;
import org.apache.lucene.util.BytesRef;
diff --git a/lucene/facet/src/java/org/apache/lucene/util/encoding/DGapVInt8IntEncoder.java b/lucene/facet/src/java/org/apache/lucene/facet/encoding/DGapVInt8IntEncoder.java
similarity index 98%
rename from lucene/facet/src/java/org/apache/lucene/util/encoding/DGapVInt8IntEncoder.java
rename to lucene/facet/src/java/org/apache/lucene/facet/encoding/DGapVInt8IntEncoder.java
index a28328ea393..bc063835563 100644
--- a/lucene/facet/src/java/org/apache/lucene/util/encoding/DGapVInt8IntEncoder.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/encoding/DGapVInt8IntEncoder.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.util.encoding;
+package org.apache.lucene.facet.encoding;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.IntsRef;
diff --git a/lucene/facet/src/java/org/apache/lucene/util/encoding/EightFlagsIntDecoder.java b/lucene/facet/src/java/org/apache/lucene/facet/encoding/EightFlagsIntDecoder.java
similarity index 98%
rename from lucene/facet/src/java/org/apache/lucene/util/encoding/EightFlagsIntDecoder.java
rename to lucene/facet/src/java/org/apache/lucene/facet/encoding/EightFlagsIntDecoder.java
index 317185f44e3..3bf12efcd91 100644
--- a/lucene/facet/src/java/org/apache/lucene/util/encoding/EightFlagsIntDecoder.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/encoding/EightFlagsIntDecoder.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.util.encoding;
+package org.apache.lucene.facet.encoding;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.IntsRef;
diff --git a/lucene/facet/src/java/org/apache/lucene/util/encoding/EightFlagsIntEncoder.java b/lucene/facet/src/java/org/apache/lucene/facet/encoding/EightFlagsIntEncoder.java
similarity index 98%
rename from lucene/facet/src/java/org/apache/lucene/util/encoding/EightFlagsIntEncoder.java
rename to lucene/facet/src/java/org/apache/lucene/facet/encoding/EightFlagsIntEncoder.java
index 812d86d1003..5b1fec82bd2 100644
--- a/lucene/facet/src/java/org/apache/lucene/util/encoding/EightFlagsIntEncoder.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/encoding/EightFlagsIntEncoder.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.util.encoding;
+package org.apache.lucene.facet.encoding;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.IntsRef;
diff --git a/lucene/facet/src/java/org/apache/lucene/util/encoding/FourFlagsIntDecoder.java b/lucene/facet/src/java/org/apache/lucene/facet/encoding/FourFlagsIntDecoder.java
similarity index 98%
rename from lucene/facet/src/java/org/apache/lucene/util/encoding/FourFlagsIntDecoder.java
rename to lucene/facet/src/java/org/apache/lucene/facet/encoding/FourFlagsIntDecoder.java
index 216b806243c..b2cb5d1232f 100644
--- a/lucene/facet/src/java/org/apache/lucene/util/encoding/FourFlagsIntDecoder.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/encoding/FourFlagsIntDecoder.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.util.encoding;
+package org.apache.lucene.facet.encoding;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.IntsRef;
diff --git a/lucene/facet/src/java/org/apache/lucene/util/encoding/FourFlagsIntEncoder.java b/lucene/facet/src/java/org/apache/lucene/facet/encoding/FourFlagsIntEncoder.java
similarity index 98%
rename from lucene/facet/src/java/org/apache/lucene/util/encoding/FourFlagsIntEncoder.java
rename to lucene/facet/src/java/org/apache/lucene/facet/encoding/FourFlagsIntEncoder.java
index fd822651000..edf448e47fa 100644
--- a/lucene/facet/src/java/org/apache/lucene/util/encoding/FourFlagsIntEncoder.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/encoding/FourFlagsIntEncoder.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.util.encoding;
+package org.apache.lucene.facet.encoding;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.IntsRef;
diff --git a/lucene/facet/src/java/org/apache/lucene/util/encoding/IntDecoder.java b/lucene/facet/src/java/org/apache/lucene/facet/encoding/IntDecoder.java
similarity index 96%
rename from lucene/facet/src/java/org/apache/lucene/util/encoding/IntDecoder.java
rename to lucene/facet/src/java/org/apache/lucene/facet/encoding/IntDecoder.java
index e89c7557039..954c84d08df 100644
--- a/lucene/facet/src/java/org/apache/lucene/util/encoding/IntDecoder.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/encoding/IntDecoder.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.util.encoding;
+package org.apache.lucene.facet.encoding;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.IntsRef;
diff --git a/lucene/facet/src/java/org/apache/lucene/util/encoding/IntEncoder.java b/lucene/facet/src/java/org/apache/lucene/facet/encoding/IntEncoder.java
similarity index 97%
rename from lucene/facet/src/java/org/apache/lucene/util/encoding/IntEncoder.java
rename to lucene/facet/src/java/org/apache/lucene/facet/encoding/IntEncoder.java
index 64e2878cbf7..5d3e74df765 100644
--- a/lucene/facet/src/java/org/apache/lucene/util/encoding/IntEncoder.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/encoding/IntEncoder.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.util.encoding;
+package org.apache.lucene.facet.encoding;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.IntsRef;
diff --git a/lucene/facet/src/java/org/apache/lucene/util/encoding/IntEncoderFilter.java b/lucene/facet/src/java/org/apache/lucene/facet/encoding/IntEncoderFilter.java
similarity index 96%
rename from lucene/facet/src/java/org/apache/lucene/util/encoding/IntEncoderFilter.java
rename to lucene/facet/src/java/org/apache/lucene/facet/encoding/IntEncoderFilter.java
index c1fa04b5dc9..3c1f24a7bf5 100644
--- a/lucene/facet/src/java/org/apache/lucene/util/encoding/IntEncoderFilter.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/encoding/IntEncoderFilter.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.util.encoding;
+package org.apache.lucene.facet.encoding;
/*
diff --git a/lucene/facet/src/java/org/apache/lucene/util/encoding/NOnesIntDecoder.java b/lucene/facet/src/java/org/apache/lucene/facet/encoding/NOnesIntDecoder.java
similarity index 98%
rename from lucene/facet/src/java/org/apache/lucene/util/encoding/NOnesIntDecoder.java
rename to lucene/facet/src/java/org/apache/lucene/facet/encoding/NOnesIntDecoder.java
index 37e52e9a815..5819b621f3f 100644
--- a/lucene/facet/src/java/org/apache/lucene/util/encoding/NOnesIntDecoder.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/encoding/NOnesIntDecoder.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.util.encoding;
+package org.apache.lucene.facet.encoding;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.IntsRef;
diff --git a/lucene/facet/src/java/org/apache/lucene/util/encoding/NOnesIntEncoder.java b/lucene/facet/src/java/org/apache/lucene/facet/encoding/NOnesIntEncoder.java
similarity index 98%
rename from lucene/facet/src/java/org/apache/lucene/util/encoding/NOnesIntEncoder.java
rename to lucene/facet/src/java/org/apache/lucene/facet/encoding/NOnesIntEncoder.java
index 5a705c5ecf7..6c117de1f9c 100644
--- a/lucene/facet/src/java/org/apache/lucene/util/encoding/NOnesIntEncoder.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/encoding/NOnesIntEncoder.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.util.encoding;
+package org.apache.lucene.facet.encoding;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.IntsRef;
diff --git a/lucene/facet/src/java/org/apache/lucene/util/encoding/SimpleIntDecoder.java b/lucene/facet/src/java/org/apache/lucene/facet/encoding/SimpleIntDecoder.java
similarity index 97%
rename from lucene/facet/src/java/org/apache/lucene/util/encoding/SimpleIntDecoder.java
rename to lucene/facet/src/java/org/apache/lucene/facet/encoding/SimpleIntDecoder.java
index fd7a79e38c4..82c489a071b 100644
--- a/lucene/facet/src/java/org/apache/lucene/util/encoding/SimpleIntDecoder.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/encoding/SimpleIntDecoder.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.util.encoding;
+package org.apache.lucene.facet.encoding;
import org.apache.lucene.util.ArrayUtil;
import org.apache.lucene.util.BytesRef;
diff --git a/lucene/facet/src/java/org/apache/lucene/util/encoding/SimpleIntEncoder.java b/lucene/facet/src/java/org/apache/lucene/facet/encoding/SimpleIntEncoder.java
similarity index 97%
rename from lucene/facet/src/java/org/apache/lucene/util/encoding/SimpleIntEncoder.java
rename to lucene/facet/src/java/org/apache/lucene/facet/encoding/SimpleIntEncoder.java
index ae0b2958b30..f2eb6b919fe 100644
--- a/lucene/facet/src/java/org/apache/lucene/util/encoding/SimpleIntEncoder.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/encoding/SimpleIntEncoder.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.util.encoding;
+package org.apache.lucene.facet.encoding;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.IntsRef;
diff --git a/lucene/facet/src/java/org/apache/lucene/util/encoding/SortingIntEncoder.java b/lucene/facet/src/java/org/apache/lucene/facet/encoding/SortingIntEncoder.java
similarity index 97%
rename from lucene/facet/src/java/org/apache/lucene/util/encoding/SortingIntEncoder.java
rename to lucene/facet/src/java/org/apache/lucene/facet/encoding/SortingIntEncoder.java
index 128542087b9..c162c6150d1 100644
--- a/lucene/facet/src/java/org/apache/lucene/util/encoding/SortingIntEncoder.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/encoding/SortingIntEncoder.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.util.encoding;
+package org.apache.lucene.facet.encoding;
import java.util.Arrays;
diff --git a/lucene/facet/src/java/org/apache/lucene/util/encoding/UniqueValuesIntEncoder.java b/lucene/facet/src/java/org/apache/lucene/facet/encoding/UniqueValuesIntEncoder.java
similarity index 97%
rename from lucene/facet/src/java/org/apache/lucene/util/encoding/UniqueValuesIntEncoder.java
rename to lucene/facet/src/java/org/apache/lucene/facet/encoding/UniqueValuesIntEncoder.java
index 2612c234c70..fe5388d1f3c 100644
--- a/lucene/facet/src/java/org/apache/lucene/util/encoding/UniqueValuesIntEncoder.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/encoding/UniqueValuesIntEncoder.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.util.encoding;
+package org.apache.lucene.facet.encoding;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.IntsRef;
diff --git a/lucene/facet/src/java/org/apache/lucene/util/encoding/VInt8IntDecoder.java b/lucene/facet/src/java/org/apache/lucene/facet/encoding/VInt8IntDecoder.java
similarity index 97%
rename from lucene/facet/src/java/org/apache/lucene/util/encoding/VInt8IntDecoder.java
rename to lucene/facet/src/java/org/apache/lucene/facet/encoding/VInt8IntDecoder.java
index 65a122ac7de..785eafe9a12 100644
--- a/lucene/facet/src/java/org/apache/lucene/util/encoding/VInt8IntDecoder.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/encoding/VInt8IntDecoder.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.util.encoding;
+package org.apache.lucene.facet.encoding;
import org.apache.lucene.util.ArrayUtil;
import org.apache.lucene.util.BytesRef;
diff --git a/lucene/facet/src/java/org/apache/lucene/util/encoding/VInt8IntEncoder.java b/lucene/facet/src/java/org/apache/lucene/facet/encoding/VInt8IntEncoder.java
similarity index 99%
rename from lucene/facet/src/java/org/apache/lucene/util/encoding/VInt8IntEncoder.java
rename to lucene/facet/src/java/org/apache/lucene/facet/encoding/VInt8IntEncoder.java
index cc4bc1332af..5fdda79edb5 100644
--- a/lucene/facet/src/java/org/apache/lucene/util/encoding/VInt8IntEncoder.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/encoding/VInt8IntEncoder.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.util.encoding;
+package org.apache.lucene.facet.encoding;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.IntsRef;
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/associations/search/package.html b/lucene/facet/src/java/org/apache/lucene/facet/encoding/package.html
similarity index 89%
rename from lucene/facet/src/java/org/apache/lucene/facet/associations/search/package.html
rename to lucene/facet/src/java/org/apache/lucene/facet/encoding/package.html
index 2925f070cba..b1b95bce7e3 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/associations/search/package.html
+++ b/lucene/facet/src/java/org/apache/lucene/facet/encoding/package.html
@@ -16,11 +16,9 @@
-->
<html>
<head>
-<title>Category Association</title>
+<title>Facets Encoding</title>
</head>
<body>
-<h1>Category Association</h1>
-
-Associations search code
+Offers various encoders and decoders for category ordinals.
</body>
-</html>
+</html>
\ No newline at end of file
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/index/CountingListBuilder.java b/lucene/facet/src/java/org/apache/lucene/facet/index/CountingListBuilder.java
index e41ca4bb958..c7a3cf2722a 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/index/CountingListBuilder.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/index/CountingListBuilder.java
@@ -7,15 +7,15 @@ import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
-import org.apache.lucene.facet.index.params.CategoryListParams;
-import org.apache.lucene.facet.index.params.CategoryListParams.OrdinalPolicy;
-import org.apache.lucene.facet.index.params.FacetIndexingParams;
+import org.apache.lucene.facet.encoding.IntEncoder;
+import org.apache.lucene.facet.params.CategoryListParams;
+import org.apache.lucene.facet.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.CategoryListParams.OrdinalPolicy;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.facet.taxonomy.TaxonomyWriter;
import org.apache.lucene.facet.util.PartitionsUtils;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.IntsRef;
-import org.apache.lucene.util.encoding.IntEncoder;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/index/DrillDownStream.java b/lucene/facet/src/java/org/apache/lucene/facet/index/DrillDownStream.java
index 2535af2babd..0851f692f5b 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/index/DrillDownStream.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/index/DrillDownStream.java
@@ -5,7 +5,7 @@ import java.util.Iterator;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
-import org.apache.lucene.facet.index.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.FacetIndexingParams;
import org.apache.lucene.facet.taxonomy.CategoryPath;
/*
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/index/FacetFields.java b/lucene/facet/src/java/org/apache/lucene/facet/index/FacetFields.java
index a17265e9037..6251116894e 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/index/FacetFields.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/index/FacetFields.java
@@ -13,8 +13,8 @@ import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.FieldType;
import org.apache.lucene.document.TextField;
-import org.apache.lucene.facet.index.params.CategoryListParams;
-import org.apache.lucene.facet.index.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.CategoryListParams;
+import org.apache.lucene.facet.params.FacetIndexingParams;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.facet.taxonomy.TaxonomyWriter;
import org.apache.lucene.index.FieldInfo.IndexOptions;
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/index/package.html b/lucene/facet/src/java/org/apache/lucene/facet/index/package.html
index b936d23bb68..1b94556b8aa 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/index/package.html
+++ b/lucene/facet/src/java/org/apache/lucene/facet/index/package.html
@@ -16,16 +16,10 @@
-->
<html>
<head>
-<title>Indexing of document categories</title>
+<title>Facets indexing code</title>
</head>
<body>
-<h1>Indexing of document categories</h1>
-
-Attachment of
-{@link org.apache.lucene.facet.taxonomy.CategoryPath CategoryPath}'s
-or {@link org.apache.lucene.facet.associations.CategoryAssociation CategoryAssociation}'s
-to a given document using a
-{@link org.apache.lucene.facet.taxonomy.TaxonomyWriter Taxonomy}.
+Facets indexing code.
</body>
</html>
\ No newline at end of file
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/package.html b/lucene/facet/src/java/org/apache/lucene/facet/package.html
deleted file mode 100644
index a08531a1aa3..00000000000
--- a/lucene/facet/src/java/org/apache/lucene/facet/package.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<html>
- <head>
- <title>Faceted Indexing and Search</title>
- </head>
- <body>
- Provides faceted indexing and search capabilities. The <a href="doc-files/userguide.html">userguide</a> is recommended for a start.
- </body>
-</html>
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/index/params/CategoryListParams.java b/lucene/facet/src/java/org/apache/lucene/facet/params/CategoryListParams.java
similarity index 95%
rename from lucene/facet/src/java/org/apache/lucene/facet/index/params/CategoryListParams.java
rename to lucene/facet/src/java/org/apache/lucene/facet/params/CategoryListParams.java
index dcf8ed191a2..a457bcd2c11 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/index/params/CategoryListParams.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/params/CategoryListParams.java
@@ -1,16 +1,16 @@
-package org.apache.lucene.facet.index.params;
+package org.apache.lucene.facet.params;
import java.io.IOException;
+import org.apache.lucene.facet.encoding.DGapVInt8IntEncoder;
+import org.apache.lucene.facet.encoding.IntDecoder;
+import org.apache.lucene.facet.encoding.IntEncoder;
+import org.apache.lucene.facet.encoding.SortingIntEncoder;
+import org.apache.lucene.facet.encoding.UniqueValuesIntEncoder;
import org.apache.lucene.facet.search.CategoryListIterator;
import org.apache.lucene.facet.search.DocValuesCategoryListIterator;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.facet.util.PartitionsUtils;
-import org.apache.lucene.util.encoding.DGapVInt8IntEncoder;
-import org.apache.lucene.util.encoding.IntDecoder;
-import org.apache.lucene.util.encoding.IntEncoder;
-import org.apache.lucene.util.encoding.SortingIntEncoder;
-import org.apache.lucene.util.encoding.UniqueValuesIntEncoder;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/index/params/FacetIndexingParams.java b/lucene/facet/src/java/org/apache/lucene/facet/params/FacetIndexingParams.java
similarity index 98%
rename from lucene/facet/src/java/org/apache/lucene/facet/index/params/FacetIndexingParams.java
rename to lucene/facet/src/java/org/apache/lucene/facet/params/FacetIndexingParams.java
index c5abe4004ac..edd8ef97904 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/index/params/FacetIndexingParams.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/params/FacetIndexingParams.java
@@ -1,9 +1,9 @@
-package org.apache.lucene.facet.index.params;
+package org.apache.lucene.facet.params;
import java.util.Collections;
import java.util.List;
-import org.apache.lucene.facet.index.params.CategoryListParams.OrdinalPolicy;
+import org.apache.lucene.facet.params.CategoryListParams.OrdinalPolicy;
import org.apache.lucene.facet.search.FacetArrays;
import org.apache.lucene.facet.taxonomy.CategoryPath;
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/params/FacetSearchParams.java b/lucene/facet/src/java/org/apache/lucene/facet/params/FacetSearchParams.java
similarity index 96%
rename from lucene/facet/src/java/org/apache/lucene/facet/search/params/FacetSearchParams.java
rename to lucene/facet/src/java/org/apache/lucene/facet/params/FacetSearchParams.java
index 5a361c28027..1bf3dfe44ab 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/params/FacetSearchParams.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/params/FacetSearchParams.java
@@ -1,9 +1,9 @@
-package org.apache.lucene.facet.search.params;
+package org.apache.lucene.facet.params;
import java.util.Arrays;
import java.util.List;
-import org.apache.lucene.facet.index.params.FacetIndexingParams;
+import org.apache.lucene.facet.search.FacetRequest;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/index/params/PerDimensionIndexingParams.java b/lucene/facet/src/java/org/apache/lucene/facet/params/PerDimensionIndexingParams.java
similarity index 98%
rename from lucene/facet/src/java/org/apache/lucene/facet/index/params/PerDimensionIndexingParams.java
rename to lucene/facet/src/java/org/apache/lucene/facet/params/PerDimensionIndexingParams.java
index c4b971a5ca9..18251e79a79 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/index/params/PerDimensionIndexingParams.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/params/PerDimensionIndexingParams.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.facet.index.params;
+package org.apache.lucene.facet.params;
import java.util.ArrayList;
import java.util.HashMap;
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/index/params/PerDimensionOrdinalPolicy.java b/lucene/facet/src/java/org/apache/lucene/facet/params/PerDimensionOrdinalPolicy.java
similarity index 97%
rename from lucene/facet/src/java/org/apache/lucene/facet/index/params/PerDimensionOrdinalPolicy.java
rename to lucene/facet/src/java/org/apache/lucene/facet/params/PerDimensionOrdinalPolicy.java
index c91b1a69ccf..9446508d313 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/index/params/PerDimensionOrdinalPolicy.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/params/PerDimensionOrdinalPolicy.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.facet.index.params;
+package org.apache.lucene.facet.params;
import java.util.Map;
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/params/associations/package.html b/lucene/facet/src/java/org/apache/lucene/facet/params/package.html
similarity index 79%
rename from lucene/facet/src/java/org/apache/lucene/facet/search/params/associations/package.html
rename to lucene/facet/src/java/org/apache/lucene/facet/params/package.html
index 1e0d9a00536..dd2d8a41d1c 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/params/associations/package.html
+++ b/lucene/facet/src/java/org/apache/lucene/facet/params/package.html
@@ -1,4 +1,3 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -15,8 +14,12 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<html><head></head>
+<html>
+<head>
+<title>Facets indexing and search parameters</title>
+</head>
<body>
-Association-based Parameters for Faceted Search.
+Facets indexing and search parameters. Define how facets are indexed
+as well as which categories need to be aggregated.
</body>
-</html>
+</html>
\ No newline at end of file
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/partitions/search/IntermediateFacetResult.java b/lucene/facet/src/java/org/apache/lucene/facet/partitions/IntermediateFacetResult.java
similarity index 89%
rename from lucene/facet/src/java/org/apache/lucene/facet/partitions/search/IntermediateFacetResult.java
rename to lucene/facet/src/java/org/apache/lucene/facet/partitions/IntermediateFacetResult.java
index 9cda7a54a33..5434c298a66 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/partitions/search/IntermediateFacetResult.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/partitions/IntermediateFacetResult.java
@@ -1,8 +1,8 @@
-package org.apache.lucene.facet.partitions.search;
+package org.apache.lucene.facet.partitions;
+import org.apache.lucene.facet.search.FacetRequest;
+import org.apache.lucene.facet.search.FacetResult;
import org.apache.lucene.facet.search.FacetResultsHandler;
-import org.apache.lucene.facet.search.params.FacetRequest;
-import org.apache.lucene.facet.search.results.FacetResult;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/partitions/search/PartitionsFacetResultsHandler.java b/lucene/facet/src/java/org/apache/lucene/facet/partitions/PartitionsFacetResultsHandler.java
similarity index 95%
rename from lucene/facet/src/java/org/apache/lucene/facet/partitions/search/PartitionsFacetResultsHandler.java
rename to lucene/facet/src/java/org/apache/lucene/facet/partitions/PartitionsFacetResultsHandler.java
index 09a9ea6439d..c5ec23f7128 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/partitions/search/PartitionsFacetResultsHandler.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/partitions/PartitionsFacetResultsHandler.java
@@ -1,14 +1,14 @@
-package org.apache.lucene.facet.partitions.search;
+package org.apache.lucene.facet.partitions;
import java.io.IOException;
import org.apache.lucene.facet.search.FacetArrays;
+import org.apache.lucene.facet.search.FacetRequest;
+import org.apache.lucene.facet.search.FacetResult;
+import org.apache.lucene.facet.search.FacetResultNode;
import org.apache.lucene.facet.search.FacetResultsHandler;
import org.apache.lucene.facet.search.ScoredDocIDs;
import org.apache.lucene.facet.search.StandardFacetsAccumulator;
-import org.apache.lucene.facet.search.params.FacetRequest;
-import org.apache.lucene.facet.search.results.FacetResult;
-import org.apache.lucene.facet.search.results.FacetResultNode;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
/*
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/partitions/search/package.html b/lucene/facet/src/java/org/apache/lucene/facet/partitions/package.html
similarity index 100%
rename from lucene/facet/src/java/org/apache/lucene/facet/partitions/search/package.html
rename to lucene/facet/src/java/org/apache/lucene/facet/partitions/package.html
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/sampling/RandomSampler.java b/lucene/facet/src/java/org/apache/lucene/facet/sampling/RandomSampler.java
similarity index 98%
rename from lucene/facet/src/java/org/apache/lucene/facet/search/sampling/RandomSampler.java
rename to lucene/facet/src/java/org/apache/lucene/facet/sampling/RandomSampler.java
index f90a8d9a99e..7dae2dbe9ef 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/sampling/RandomSampler.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/sampling/RandomSampler.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.facet.search.sampling;
+package org.apache.lucene.facet.sampling;
import java.io.IOException;
import java.util.Random;
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/sampling/RepeatableSampler.java b/lucene/facet/src/java/org/apache/lucene/facet/sampling/RepeatableSampler.java
similarity index 99%
rename from lucene/facet/src/java/org/apache/lucene/facet/search/sampling/RepeatableSampler.java
rename to lucene/facet/src/java/org/apache/lucene/facet/sampling/RepeatableSampler.java
index 892d2fece1c..f1ae6b7466d 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/sampling/RepeatableSampler.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/sampling/RepeatableSampler.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.facet.search.sampling;
+package org.apache.lucene.facet.sampling;
import java.io.IOException;
import java.util.Arrays;
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/sampling/SampleFixer.java b/lucene/facet/src/java/org/apache/lucene/facet/sampling/SampleFixer.java
similarity index 93%
rename from lucene/facet/src/java/org/apache/lucene/facet/search/sampling/SampleFixer.java
rename to lucene/facet/src/java/org/apache/lucene/facet/sampling/SampleFixer.java
index 5b992d3b244..a3305f8586e 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/sampling/SampleFixer.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/sampling/SampleFixer.java
@@ -1,9 +1,9 @@
-package org.apache.lucene.facet.search.sampling;
+package org.apache.lucene.facet.sampling;
import java.io.IOException;
+import org.apache.lucene.facet.search.FacetResult;
import org.apache.lucene.facet.search.ScoredDocIDs;
-import org.apache.lucene.facet.search.results.FacetResult;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/sampling/Sampler.java b/lucene/facet/src/java/org/apache/lucene/facet/sampling/Sampler.java
similarity index 96%
rename from lucene/facet/src/java/org/apache/lucene/facet/search/sampling/Sampler.java
rename to lucene/facet/src/java/org/apache/lucene/facet/sampling/Sampler.java
index 345677f9c66..7a8f4ea9443 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/sampling/Sampler.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/sampling/Sampler.java
@@ -1,16 +1,16 @@
-package org.apache.lucene.facet.search.sampling;
+package org.apache.lucene.facet.sampling;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
+import org.apache.lucene.facet.params.FacetSearchParams;
+import org.apache.lucene.facet.search.Aggregator;
import org.apache.lucene.facet.search.FacetArrays;
+import org.apache.lucene.facet.search.FacetRequest;
+import org.apache.lucene.facet.search.FacetResult;
+import org.apache.lucene.facet.search.FacetResultNode;
import org.apache.lucene.facet.search.ScoredDocIDs;
-import org.apache.lucene.facet.search.aggregator.Aggregator;
-import org.apache.lucene.facet.search.params.FacetRequest;
-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.TaxonomyReader;
import org.apache.lucene.index.IndexReader;
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/sampling/SamplingAccumulator.java b/lucene/facet/src/java/org/apache/lucene/facet/sampling/SamplingAccumulator.java
similarity index 92%
rename from lucene/facet/src/java/org/apache/lucene/facet/search/sampling/SamplingAccumulator.java
rename to lucene/facet/src/java/org/apache/lucene/facet/sampling/SamplingAccumulator.java
index a2b7e40ce1c..54329e6d82e 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/sampling/SamplingAccumulator.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/sampling/SamplingAccumulator.java
@@ -1,18 +1,17 @@
-package org.apache.lucene.facet.search.sampling;
+package org.apache.lucene.facet.sampling;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
-import org.apache.lucene.facet.partitions.search.PartitionsFacetResultsHandler;
+import org.apache.lucene.facet.params.FacetSearchParams;
+import org.apache.lucene.facet.partitions.PartitionsFacetResultsHandler;
+import org.apache.lucene.facet.sampling.Sampler.SampleResult;
import org.apache.lucene.facet.search.FacetArrays;
+import org.apache.lucene.facet.search.FacetResult;
import org.apache.lucene.facet.search.FacetsAccumulator;
-import org.apache.lucene.facet.search.SamplingWrapper;
import org.apache.lucene.facet.search.ScoredDocIDs;
import org.apache.lucene.facet.search.StandardFacetsAccumulator;
-import org.apache.lucene.facet.search.params.FacetSearchParams;
-import org.apache.lucene.facet.search.results.FacetResult;
-import org.apache.lucene.facet.search.sampling.Sampler.SampleResult;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
import org.apache.lucene.index.IndexReader;
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/sampling/SamplingParams.java b/lucene/facet/src/java/org/apache/lucene/facet/sampling/SamplingParams.java
similarity index 99%
rename from lucene/facet/src/java/org/apache/lucene/facet/search/sampling/SamplingParams.java
rename to lucene/facet/src/java/org/apache/lucene/facet/sampling/SamplingParams.java
index fc509ca11ec..4366d577543 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/sampling/SamplingParams.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/sampling/SamplingParams.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.facet.search.sampling;
+package org.apache.lucene.facet.sampling;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/SamplingWrapper.java b/lucene/facet/src/java/org/apache/lucene/facet/sampling/SamplingWrapper.java
similarity index 88%
rename from lucene/facet/src/java/org/apache/lucene/facet/search/SamplingWrapper.java
rename to lucene/facet/src/java/org/apache/lucene/facet/sampling/SamplingWrapper.java
index 8f02d6e26d5..829c671d836 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/SamplingWrapper.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/sampling/SamplingWrapper.java
@@ -1,14 +1,15 @@
-package org.apache.lucene.facet.search;
+package org.apache.lucene.facet.sampling;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
-import org.apache.lucene.facet.partitions.search.PartitionsFacetResultsHandler;
-import org.apache.lucene.facet.search.params.FacetSearchParams;
-import org.apache.lucene.facet.search.results.FacetResult;
-import org.apache.lucene.facet.search.sampling.Sampler;
-import org.apache.lucene.facet.search.sampling.Sampler.SampleResult;
+import org.apache.lucene.facet.params.FacetSearchParams;
+import org.apache.lucene.facet.partitions.PartitionsFacetResultsHandler;
+import org.apache.lucene.facet.sampling.Sampler.SampleResult;
+import org.apache.lucene.facet.search.FacetResult;
+import org.apache.lucene.facet.search.ScoredDocIDs;
+import org.apache.lucene.facet.search.StandardFacetsAccumulator;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/sampling/TakmiSampleFixer.java b/lucene/facet/src/java/org/apache/lucene/facet/sampling/TakmiSampleFixer.java
similarity index 96%
rename from lucene/facet/src/java/org/apache/lucene/facet/search/sampling/TakmiSampleFixer.java
rename to lucene/facet/src/java/org/apache/lucene/facet/sampling/TakmiSampleFixer.java
index ddfb66f90e0..0b3e3f1f777 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/sampling/TakmiSampleFixer.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/sampling/TakmiSampleFixer.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.facet.search.sampling;
+package org.apache.lucene.facet.sampling;
import java.io.IOException;
@@ -9,12 +9,12 @@ import org.apache.lucene.index.DocsEnum;
import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.util.Bits;
+import org.apache.lucene.facet.params.FacetSearchParams;
import org.apache.lucene.facet.search.DrillDown;
+import org.apache.lucene.facet.search.FacetResult;
+import org.apache.lucene.facet.search.FacetResultNode;
import org.apache.lucene.facet.search.ScoredDocIDs;
import org.apache.lucene.facet.search.ScoredDocIDsIterator;
-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;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
diff --git a/lucene/facet/src/java/org/apache/lucene/util/package.html b/lucene/facet/src/java/org/apache/lucene/facet/sampling/package.html
similarity index 91%
rename from lucene/facet/src/java/org/apache/lucene/util/package.html
rename to lucene/facet/src/java/org/apache/lucene/facet/sampling/package.html
index ae35259e1d1..2d34182afad 100644
--- a/lucene/facet/src/java/org/apache/lucene/util/package.html
+++ b/lucene/facet/src/java/org/apache/lucene/facet/sampling/package.html
@@ -15,7 +15,10 @@
limitations under the License.
-->
<html>
+<head>
+<title>Facets sampling</title>
+</head>
<body>
-Low-level faceting utilities.
+Facets sampling.
</body>
-</html>
+</html>
\ No newline at end of file
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/AdaptiveFacetsAccumulator.java b/lucene/facet/src/java/org/apache/lucene/facet/search/AdaptiveFacetsAccumulator.java
index 2ffac8209f6..8d341580d32 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/AdaptiveFacetsAccumulator.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/search/AdaptiveFacetsAccumulator.java
@@ -3,11 +3,10 @@ package org.apache.lucene.facet.search;
import java.io.IOException;
import java.util.List;
-import org.apache.lucene.facet.search.params.FacetSearchParams;
-import org.apache.lucene.facet.search.results.FacetResult;
-import org.apache.lucene.facet.search.sampling.RandomSampler;
-import org.apache.lucene.facet.search.sampling.Sampler;
-import org.apache.lucene.facet.search.sampling.SamplingAccumulator;
+import org.apache.lucene.facet.params.FacetSearchParams;
+import org.apache.lucene.facet.sampling.RandomSampler;
+import org.apache.lucene.facet.sampling.Sampler;
+import org.apache.lucene.facet.sampling.SamplingAccumulator;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
import org.apache.lucene.index.IndexReader;
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/aggregator/Aggregator.java b/lucene/facet/src/java/org/apache/lucene/facet/search/Aggregator.java
similarity index 97%
rename from lucene/facet/src/java/org/apache/lucene/facet/search/aggregator/Aggregator.java
rename to lucene/facet/src/java/org/apache/lucene/facet/search/Aggregator.java
index 2eac9155706..e95af406cbb 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/aggregator/Aggregator.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/search/Aggregator.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.facet.search.aggregator;
+package org.apache.lucene.facet.search;
import java.io.IOException;
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/params/CountFacetRequest.java b/lucene/facet/src/java/org/apache/lucene/facet/search/CountFacetRequest.java
similarity index 84%
rename from lucene/facet/src/java/org/apache/lucene/facet/search/params/CountFacetRequest.java
rename to lucene/facet/src/java/org/apache/lucene/facet/search/CountFacetRequest.java
index de033ef325f..9519230b6c9 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/params/CountFacetRequest.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/search/CountFacetRequest.java
@@ -1,9 +1,6 @@
-package org.apache.lucene.facet.search.params;
+package org.apache.lucene.facet.search;
-import org.apache.lucene.facet.search.FacetArrays;
-import org.apache.lucene.facet.search.aggregator.Aggregator;
-import org.apache.lucene.facet.search.aggregator.ComplementCountingAggregator;
-import org.apache.lucene.facet.search.aggregator.CountingAggregator;
+import org.apache.lucene.facet.complements.ComplementCountingAggregator;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/aggregator/CountingAggregator.java b/lucene/facet/src/java/org/apache/lucene/facet/search/CountingAggregator.java
similarity index 97%
rename from lucene/facet/src/java/org/apache/lucene/facet/search/aggregator/CountingAggregator.java
rename to lucene/facet/src/java/org/apache/lucene/facet/search/CountingAggregator.java
index 53c03caf427..395581b600b 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/aggregator/CountingAggregator.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/search/CountingAggregator.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.facet.search.aggregator;
+package org.apache.lucene.facet.search;
import java.io.IOException;
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/CountingFacetsAggregator.java b/lucene/facet/src/java/org/apache/lucene/facet/search/CountingFacetsAggregator.java
index 514a6af7c87..6927444ba60 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/CountingFacetsAggregator.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/search/CountingFacetsAggregator.java
@@ -2,7 +2,7 @@ package org.apache.lucene.facet.search;
import java.io.IOException;
-import org.apache.lucene.facet.index.params.CategoryListParams;
+import org.apache.lucene.facet.params.CategoryListParams;
import org.apache.lucene.facet.search.FacetsCollector.MatchingDocs;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
import org.apache.lucene.util.IntsRef;
@@ -70,7 +70,7 @@ public class CountingFacetsAggregator implements FacetsAggregator {
}
@Override
- public void rollupValues(int ordinal, int[] children, int[] siblings, FacetArrays facetArrays) {
+ public void rollupValues(FacetRequest fr, int ordinal, int[] children, int[] siblings, FacetArrays facetArrays) {
final int[] counts = facetArrays.getIntArray();
counts[ordinal] += rollupCounts(children[ordinal], children, siblings, counts);
}
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/DepthOneFacetResultsHandler.java b/lucene/facet/src/java/org/apache/lucene/facet/search/DepthOneFacetResultsHandler.java
index 1caa08f93b1..439b37582d4 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/DepthOneFacetResultsHandler.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/search/DepthOneFacetResultsHandler.java
@@ -6,11 +6,8 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
-import org.apache.lucene.facet.search.params.FacetRequest;
-import org.apache.lucene.facet.search.params.FacetRequest.SortBy;
-import org.apache.lucene.facet.search.params.FacetRequest.SortOrder;
-import org.apache.lucene.facet.search.results.FacetResult;
-import org.apache.lucene.facet.search.results.FacetResultNode;
+import org.apache.lucene.facet.search.FacetRequest.SortBy;
+import org.apache.lucene.facet.search.FacetRequest.SortOrder;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
import org.apache.lucene.facet.taxonomy.directory.ParallelTaxonomyArrays;
import org.apache.lucene.util.PriorityQueue;
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/DocValuesCategoryListIterator.java b/lucene/facet/src/java/org/apache/lucene/facet/search/DocValuesCategoryListIterator.java
index 74d696574d3..916aec2263e 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/DocValuesCategoryListIterator.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/search/DocValuesCategoryListIterator.java
@@ -2,11 +2,11 @@ package org.apache.lucene.facet.search;
import java.io.IOException;
+import org.apache.lucene.facet.encoding.IntDecoder;
import org.apache.lucene.index.AtomicReaderContext;
import org.apache.lucene.index.BinaryDocValues;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.IntsRef;
-import org.apache.lucene.util.encoding.IntDecoder;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/DrillDown.java b/lucene/facet/src/java/org/apache/lucene/facet/search/DrillDown.java
index 57d60f46b6b..670df7e796d 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/DrillDown.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/search/DrillDown.java
@@ -7,9 +7,9 @@ import org.apache.lucene.search.Query;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.search.BooleanClause.Occur;
-import org.apache.lucene.facet.index.params.CategoryListParams;
-import org.apache.lucene.facet.index.params.FacetIndexingParams;
-import org.apache.lucene.facet.search.params.FacetSearchParams;
+import org.apache.lucene.facet.params.CategoryListParams;
+import org.apache.lucene.facet.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.FacetSearchParams;
import org.apache.lucene.facet.taxonomy.CategoryPath;
/*
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/params/FacetRequest.java b/lucene/facet/src/java/org/apache/lucene/facet/search/FacetRequest.java
similarity index 97%
rename from lucene/facet/src/java/org/apache/lucene/facet/search/params/FacetRequest.java
rename to lucene/facet/src/java/org/apache/lucene/facet/search/FacetRequest.java
index 948267fed23..867316483b2 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/params/FacetRequest.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/search/FacetRequest.java
@@ -1,10 +1,7 @@
-package org.apache.lucene.facet.search.params;
+package org.apache.lucene.facet.search;
import java.io.IOException;
-import org.apache.lucene.facet.search.FacetArrays;
-import org.apache.lucene.facet.search.FacetResultsHandler;
-import org.apache.lucene.facet.search.aggregator.Aggregator;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/results/FacetResult.java b/lucene/facet/src/java/org/apache/lucene/facet/search/FacetResult.java
similarity index 96%
rename from lucene/facet/src/java/org/apache/lucene/facet/search/results/FacetResult.java
rename to lucene/facet/src/java/org/apache/lucene/facet/search/FacetResult.java
index 0a9e575a9a2..3d9732d8d51 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/results/FacetResult.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/search/FacetResult.java
@@ -1,6 +1,5 @@
-package org.apache.lucene.facet.search.results;
+package org.apache.lucene.facet.search;
-import org.apache.lucene.facet.search.params.FacetRequest;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/results/FacetResultNode.java b/lucene/facet/src/java/org/apache/lucene/facet/search/FacetResultNode.java
similarity index 93%
rename from lucene/facet/src/java/org/apache/lucene/facet/search/results/FacetResultNode.java
rename to lucene/facet/src/java/org/apache/lucene/facet/search/FacetResultNode.java
index eb7e0680fb4..2a7733c81f4 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/results/FacetResultNode.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/search/FacetResultNode.java
@@ -1,11 +1,9 @@
-package org.apache.lucene.facet.search.results;
+package org.apache.lucene.facet.search;
import java.util.Collections;
import java.util.List;
-import org.apache.lucene.facet.search.params.CountFacetRequest;
-import org.apache.lucene.facet.search.params.FacetRequest;
-import org.apache.lucene.facet.search.params.FacetRequest.ResultMode;
+import org.apache.lucene.facet.search.FacetRequest.ResultMode;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/FacetResultsHandler.java b/lucene/facet/src/java/org/apache/lucene/facet/search/FacetResultsHandler.java
index 836de2c58e9..3123c4d6192 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/FacetResultsHandler.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/search/FacetResultsHandler.java
@@ -2,8 +2,6 @@ package org.apache.lucene.facet.search;
import java.io.IOException;
-import org.apache.lucene.facet.search.params.FacetRequest;
-import org.apache.lucene.facet.search.results.FacetResult;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
/*
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/FacetsAccumulator.java b/lucene/facet/src/java/org/apache/lucene/facet/search/FacetsAccumulator.java
index b86d8ad6eba..b0220e1baf0 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/FacetsAccumulator.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/search/FacetsAccumulator.java
@@ -7,20 +7,18 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import org.apache.lucene.facet.index.params.CategoryListParams;
-import org.apache.lucene.facet.index.params.CategoryListParams.OrdinalPolicy;
+import org.apache.lucene.facet.encoding.DGapVInt8IntDecoder;
+import org.apache.lucene.facet.params.CategoryListParams;
+import org.apache.lucene.facet.params.FacetSearchParams;
+import org.apache.lucene.facet.params.CategoryListParams.OrdinalPolicy;
+import org.apache.lucene.facet.search.FacetRequest.FacetArraysSource;
+import org.apache.lucene.facet.search.FacetRequest.ResultMode;
+import org.apache.lucene.facet.search.FacetRequest.SortBy;
+import org.apache.lucene.facet.search.FacetRequest.SortOrder;
import org.apache.lucene.facet.search.FacetsCollector.MatchingDocs;
-import org.apache.lucene.facet.search.params.FacetRequest;
-import org.apache.lucene.facet.search.params.FacetSearchParams;
-import org.apache.lucene.facet.search.params.FacetRequest.FacetArraysSource;
-import org.apache.lucene.facet.search.params.FacetRequest.ResultMode;
-import org.apache.lucene.facet.search.params.FacetRequest.SortBy;
-import org.apache.lucene.facet.search.params.FacetRequest.SortOrder;
-import org.apache.lucene.facet.search.results.FacetResult;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
import org.apache.lucene.facet.taxonomy.directory.ParallelTaxonomyArrays;
import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.util.encoding.DGapVInt8IntDecoder;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -47,10 +45,10 @@ import org.apache.lucene.util.encoding.DGapVInt8IntDecoder;
*/
public class FacetsAccumulator {
- protected final TaxonomyReader taxonomyReader;
- protected final IndexReader indexReader;
- protected final FacetArrays facetArrays;
- protected FacetSearchParams searchParams;
+ public final TaxonomyReader taxonomyReader;
+ public final IndexReader indexReader;
+ public final FacetArrays facetArrays;
+ public FacetSearchParams searchParams;
/**
* Initializes the accumulator with the given search params, index reader and
@@ -162,7 +160,7 @@ public class FacetsAccumulator {
OrdinalPolicy ordinalPolicy = clp .getOrdinalPolicy(fr.categoryPath.components[0]);
if (ordinalPolicy == OrdinalPolicy.NO_PARENTS) {
// rollup values
- aggregator.rollupValues(rootOrd, children, siblings, facetArrays);
+ aggregator.rollupValues(fr, rootOrd, children, siblings, facetArrays);
}
FacetResultsHandler frh = createFacetResultsHandler(fr);
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/FacetsAggregator.java b/lucene/facet/src/java/org/apache/lucene/facet/search/FacetsAggregator.java
index 9e1b69b538a..befb195e107 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/FacetsAggregator.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/search/FacetsAggregator.java
@@ -2,8 +2,8 @@ package org.apache.lucene.facet.search;
import java.io.IOException;
-import org.apache.lucene.facet.index.params.CategoryListParams;
-import org.apache.lucene.facet.index.params.CategoryListParams.OrdinalPolicy;
+import org.apache.lucene.facet.params.CategoryListParams;
+import org.apache.lucene.facet.params.CategoryListParams.OrdinalPolicy;
import org.apache.lucene.facet.search.FacetsCollector.MatchingDocs;
/*
@@ -41,7 +41,7 @@ public interface FacetsAggregator {
* ordinal is the requested category, and you should use the children and
* siblings arrays to traverse its sub-tree.
*/
- public void rollupValues(int ordinal, int[] children, int[] siblings, FacetArrays facetArrays);
+ public void rollupValues(FacetRequest fr, int ordinal, int[] children, int[] siblings, FacetArrays facetArrays);
/** Returns {@code true} if this aggregator requires document scores. */
public boolean requiresDocScores();
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/FacetsCollector.java b/lucene/facet/src/java/org/apache/lucene/facet/search/FacetsCollector.java
index 5e961e8990d..27a786af5f5 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/FacetsCollector.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/search/FacetsCollector.java
@@ -4,10 +4,7 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
-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.results.FacetResult;
+import org.apache.lucene.facet.params.FacetSearchParams;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
import org.apache.lucene.index.AtomicReaderContext;
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/FastCountingFacetsAggregator.java b/lucene/facet/src/java/org/apache/lucene/facet/search/FastCountingFacetsAggregator.java
index bfc4e97f5ae..cd3b20d978b 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/FastCountingFacetsAggregator.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/search/FastCountingFacetsAggregator.java
@@ -2,15 +2,14 @@ package org.apache.lucene.facet.search;
import java.io.IOException;
-import org.apache.lucene.facet.index.params.CategoryListParams;
+import org.apache.lucene.facet.encoding.DGapVInt8IntDecoder;
+import org.apache.lucene.facet.encoding.DGapVInt8IntEncoder;
+import org.apache.lucene.facet.params.CategoryListParams;
+import org.apache.lucene.facet.params.FacetSearchParams;
import org.apache.lucene.facet.search.FacetsCollector.MatchingDocs;
-import org.apache.lucene.facet.search.params.FacetRequest;
-import org.apache.lucene.facet.search.params.FacetSearchParams;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
import org.apache.lucene.index.BinaryDocValues;
import org.apache.lucene.util.BytesRef;
-import org.apache.lucene.util.encoding.DGapVInt8IntDecoder;
-import org.apache.lucene.util.encoding.DGapVInt8IntEncoder;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -109,7 +108,7 @@ public final class FastCountingFacetsAggregator implements FacetsAggregator {
}
@Override
- public final void rollupValues(int ordinal, int[] children, int[] siblings, FacetArrays facetArrays) {
+ public final void rollupValues(FacetRequest fr, int ordinal, int[] children, int[] siblings, FacetArrays facetArrays) {
final int[] counts = facetArrays.getIntArray();
counts[ordinal] += rollupCounts(children[ordinal], children, siblings, counts);
}
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/FloatFacetResultsHandler.java b/lucene/facet/src/java/org/apache/lucene/facet/search/FloatFacetResultsHandler.java
index 2052396860a..f760edc9ee0 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/FloatFacetResultsHandler.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/search/FloatFacetResultsHandler.java
@@ -3,8 +3,6 @@ package org.apache.lucene.facet.search;
import java.io.IOException;
import java.util.ArrayList;
-import org.apache.lucene.facet.search.params.FacetRequest;
-import org.apache.lucene.facet.search.results.FacetResultNode;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
import org.apache.lucene.util.PriorityQueue;
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/IntFacetResultsHandler.java b/lucene/facet/src/java/org/apache/lucene/facet/search/IntFacetResultsHandler.java
index 34f5a222b76..fa98dc1854b 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/IntFacetResultsHandler.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/search/IntFacetResultsHandler.java
@@ -3,8 +3,6 @@ package org.apache.lucene.facet.search;
import java.io.IOException;
import java.util.ArrayList;
-import org.apache.lucene.facet.search.params.FacetRequest;
-import org.apache.lucene.facet.search.results.FacetResultNode;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
import org.apache.lucene.util.PriorityQueue;
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/PerCategoryListAggregator.java b/lucene/facet/src/java/org/apache/lucene/facet/search/PerCategoryListAggregator.java
new file mode 100644
index 00000000000..790dba62b50
--- /dev/null
+++ b/lucene/facet/src/java/org/apache/lucene/facet/search/PerCategoryListAggregator.java
@@ -0,0 +1,62 @@
+package org.apache.lucene.facet.search;
+
+import java.io.IOException;
+import java.util.Map;
+
+import org.apache.lucene.facet.params.CategoryListParams;
+import org.apache.lucene.facet.params.FacetIndexingParams;
+import org.apache.lucene.facet.search.FacetsCollector.MatchingDocs;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * A {@link FacetsAggregator} which invokes the proper aggregator per
+ * {@link CategoryListParams}.
+ */
+public class PerCategoryListAggregator implements FacetsAggregator {
+
+ private final Map<CategoryListParams,FacetsAggregator> aggregators;
+ private final FacetIndexingParams fip;
+
+ public PerCategoryListAggregator(Map<CategoryListParams,FacetsAggregator> aggregators, FacetIndexingParams fip) {
+ this.aggregators = aggregators;
+ this.fip = fip;
+ }
+
+ @Override
+ public void aggregate(MatchingDocs matchingDocs, CategoryListParams clp, FacetArrays facetArrays) throws IOException {
+ aggregators.get(clp).aggregate(matchingDocs, clp, facetArrays);
+ }
+
+ @Override
+ public void rollupValues(FacetRequest fr, int ordinal, int[] children, int[] siblings, FacetArrays facetArrays) {
+ CategoryListParams clp = fip.getCategoryListParams(fr.categoryPath);
+ aggregators.get(clp).rollupValues(fr, ordinal, children, siblings, facetArrays);
+ }
+
+ @Override
+ public boolean requiresDocScores() {
+ for (FacetsAggregator aggregator : aggregators.values()) {
+ if (aggregator.requiresDocScores()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+}
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/aggregator/ScoringAggregator.java b/lucene/facet/src/java/org/apache/lucene/facet/search/ScoringAggregator.java
similarity index 97%
rename from lucene/facet/src/java/org/apache/lucene/facet/search/aggregator/ScoringAggregator.java
rename to lucene/facet/src/java/org/apache/lucene/facet/search/ScoringAggregator.java
index 4b0a67083db..2ecf0b60a2b 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/aggregator/ScoringAggregator.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/search/ScoringAggregator.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.facet.search.aggregator;
+package org.apache.lucene.facet.search;
import java.io.IOException;
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/StandardFacetsAccumulator.java b/lucene/facet/src/java/org/apache/lucene/facet/search/StandardFacetsAccumulator.java
index 62898f9e018..6f9d9de115a 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/StandardFacetsAccumulator.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/search/StandardFacetsAccumulator.java
@@ -10,16 +10,14 @@ import java.util.Map.Entry;
import java.util.logging.Level;
import java.util.logging.Logger;
-import org.apache.lucene.facet.index.params.FacetIndexingParams;
-import org.apache.lucene.facet.partitions.search.PartitionsFacetResultsHandler;
+import org.apache.lucene.facet.complements.TotalFacetCounts;
+import org.apache.lucene.facet.complements.TotalFacetCountsCache;
+import org.apache.lucene.facet.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.FacetSearchParams;
+import org.apache.lucene.facet.partitions.IntermediateFacetResult;
+import org.apache.lucene.facet.partitions.PartitionsFacetResultsHandler;
+import org.apache.lucene.facet.search.FacetRequest.ResultMode;
import org.apache.lucene.facet.search.FacetsCollector.MatchingDocs;
-import org.apache.lucene.facet.search.aggregator.Aggregator;
-import org.apache.lucene.facet.search.params.CountFacetRequest;
-import org.apache.lucene.facet.search.params.FacetRequest;
-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.partitions.search.IntermediateFacetResult;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
import org.apache.lucene.facet.util.PartitionsUtils;
import org.apache.lucene.facet.util.ScoredDocIdsUtils;
@@ -410,5 +408,10 @@ public class StandardFacetsAccumulator extends FacetsAccumulator {
public void setComplementThreshold(double complementThreshold) {
this.complementThreshold = complementThreshold;
}
+
+ /** Returns true if complements are enabled. */
+ public boolean isUsingComplements() {
+ return isUsingComplements;
+ }
}
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/params/SumScoreFacetRequest.java b/lucene/facet/src/java/org/apache/lucene/facet/search/SumScoreFacetRequest.java
similarity index 88%
rename from lucene/facet/src/java/org/apache/lucene/facet/search/params/SumScoreFacetRequest.java
rename to lucene/facet/src/java/org/apache/lucene/facet/search/SumScoreFacetRequest.java
index cc5319f1561..7a08a124069 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/params/SumScoreFacetRequest.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/search/SumScoreFacetRequest.java
@@ -1,8 +1,5 @@
-package org.apache.lucene.facet.search.params;
+package org.apache.lucene.facet.search;
-import org.apache.lucene.facet.search.FacetArrays;
-import org.apache.lucene.facet.search.aggregator.Aggregator;
-import org.apache.lucene.facet.search.aggregator.ScoringAggregator;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/SumScoreFacetsAggregator.java b/lucene/facet/src/java/org/apache/lucene/facet/search/SumScoreFacetsAggregator.java
index 589e0c4bc80..516a3c63752 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/SumScoreFacetsAggregator.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/search/SumScoreFacetsAggregator.java
@@ -2,7 +2,7 @@ package org.apache.lucene.facet.search;
import java.io.IOException;
-import org.apache.lucene.facet.index.params.CategoryListParams;
+import org.apache.lucene.facet.params.CategoryListParams;
import org.apache.lucene.facet.search.FacetsCollector.MatchingDocs;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
import org.apache.lucene.util.IntsRef;
@@ -65,7 +65,7 @@ public class SumScoreFacetsAggregator implements FacetsAggregator {
}
@Override
- public void rollupValues(int ordinal, int[] children, int[] siblings, FacetArrays facetArrays) {
+ public void rollupValues(FacetRequest fr, int ordinal, int[] children, int[] siblings, FacetArrays facetArrays) {
float[] scores = facetArrays.getFloatArray();
scores[ordinal] += rollupScores(children[ordinal], children, siblings, scores);
}
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/TopKFacetResultsHandler.java b/lucene/facet/src/java/org/apache/lucene/facet/search/TopKFacetResultsHandler.java
index f7a47a31cd9..a74fc79f75c 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/TopKFacetResultsHandler.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/search/TopKFacetResultsHandler.java
@@ -3,11 +3,8 @@ package org.apache.lucene.facet.search;
import java.io.IOException;
import java.util.ArrayList;
-import org.apache.lucene.facet.partitions.search.IntermediateFacetResult;
-import org.apache.lucene.facet.partitions.search.PartitionsFacetResultsHandler;
-import org.apache.lucene.facet.search.params.FacetRequest;
-import org.apache.lucene.facet.search.results.FacetResult;
-import org.apache.lucene.facet.search.results.FacetResultNode;
+import org.apache.lucene.facet.partitions.IntermediateFacetResult;
+import org.apache.lucene.facet.partitions.PartitionsFacetResultsHandler;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
import org.apache.lucene.facet.taxonomy.directory.ParallelTaxonomyArrays;
import org.apache.lucene.facet.util.ResultSortUtils;
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/TopKInEachNodeHandler.java b/lucene/facet/src/java/org/apache/lucene/facet/search/TopKInEachNodeHandler.java
index c486a824955..3b5f1c95c83 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/TopKInEachNodeHandler.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/search/TopKInEachNodeHandler.java
@@ -4,17 +4,14 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
-import org.apache.lucene.facet.partitions.search.IntermediateFacetResult;
-import org.apache.lucene.facet.partitions.search.PartitionsFacetResultsHandler;
-import org.apache.lucene.facet.search.params.FacetRequest;
-import org.apache.lucene.facet.search.params.FacetRequest.SortOrder;
-import org.apache.lucene.facet.search.results.FacetResult;
-import org.apache.lucene.facet.search.results.FacetResultNode;
+import org.apache.lucene.facet.collections.IntIterator;
+import org.apache.lucene.facet.collections.IntToObjectMap;
+import org.apache.lucene.facet.partitions.IntermediateFacetResult;
+import org.apache.lucene.facet.partitions.PartitionsFacetResultsHandler;
+import org.apache.lucene.facet.search.FacetRequest.SortOrder;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
import org.apache.lucene.facet.taxonomy.directory.ParallelTaxonomyArrays;
import org.apache.lucene.util.PriorityQueue;
-import org.apache.lucene.util.collections.IntIterator;
-import org.apache.lucene.util.collections.IntToObjectMap;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/aggregator/associations/package.html b/lucene/facet/src/java/org/apache/lucene/facet/search/aggregator/associations/package.html
deleted file mode 100644
index 53e891c6c54..00000000000
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/aggregator/associations/package.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<html><head></head>
-<body>
-Association-based aggregators.
-</body>
-</html>
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/aggregator/package.html b/lucene/facet/src/java/org/apache/lucene/facet/search/aggregator/package.html
deleted file mode 100644
index 932c293435c..00000000000
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/aggregator/package.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<html>
- <head>
- <title>Aggregating Facets during Faceted Search</title>
- </head>
- <body>
- <h1>Aggregating Facets during Faceted Search</h1>
-
- A facets aggregator is the parallel of Lucene's Collector.
- While Collector collected matching documents,
- an aggregator aggregates facets of a matching document.
- </body>
-</html>
\ No newline at end of file
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/package.html b/lucene/facet/src/java/org/apache/lucene/facet/search/package.html
index 5a9975843df..94b2b36abcf 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/package.html
+++ b/lucene/facet/src/java/org/apache/lucene/facet/search/package.html
@@ -15,44 +15,10 @@
limitations under the License.
-->
<html>
- <head>
- <title>Faceted Search API</title>
- </head>
- <body>
- <h1>Faceted Search API</h1>
-
- API for faceted search has several interfaces - simple, top level ones, adequate for most users,
- and advanced, more complicated ones, for the more advanced users.
-
- <p>
-
- We now describe the simpler interfaces.
- There are mainly 3 interfaces for faceted search:
- <ol>
- <li>{@link org.apache.lucene.facet.search.params.FacetRequest Facets Request}
- defines requirements:
- <ul>
- <li>which facets are required, e.g. depth</li>
- <li>what is computed for each facet - e.g. count, score.</li>
- </ul>
- </li>
- <li>{@link org.apache.lucene.facet.search.FacetsAccumulator Facets Extractor}
- Controls how facets are extracted, with variations of:
- <ul>
- <li>default (partitioned, like all extractors). </li>
- <li>sampled - inspects only a fraction of the documents.</li>
- </ul>
- </li>
- <li>{@link org.apache.lucene.facet.search.FacetResultsHandler Facet Results Handler }
- Controls how results are further processed and merged (also between partitions):
- <ul>
- <li>Top K.</li>
- <li>Tree.</li>
- <li>Tree with top K at each level</li>
- <li>...</li>
- </ul>
- </li>
- </ol>
-
- </body>
+<head>
+<title>Facets search code</title>
+</head>
+<body>
+Facets search code.
+</body>
</html>
\ No newline at end of file
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/params/package.html b/lucene/facet/src/java/org/apache/lucene/facet/search/params/package.html
deleted file mode 100644
index 353cc8d3352..00000000000
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/params/package.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<html>
- <head>
- <title>Parameters for Faceted Search</title>
- </head>
- <body>
- <h1>Parameters for Faceted Search</h1>
- </body>
-</html>
\ No newline at end of file
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/results/package.html b/lucene/facet/src/java/org/apache/lucene/facet/search/results/package.html
deleted file mode 100644
index 1a05c38dab2..00000000000
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/results/package.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<html>
- <head>
- <title>Results of Faceted Search</title>
- </head>
- <body>
- <h1>Results of Faceted Search</h1>
- <p>
- The results of facets accumulation are obtained as a list of {@link org.apache.lucene.facet.search.results.FacetResult} elements.
- </p>
- </body>
-</html>
\ No newline at end of file
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/sampling/package.html b/lucene/facet/src/java/org/apache/lucene/facet/search/sampling/package.html
deleted file mode 100644
index 90e033c52df..00000000000
--- a/lucene/facet/src/java/org/apache/lucene/facet/search/sampling/package.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<html>
- <head>
- <title>Sampling for facets accumulation</title>
- </head>
- <body>
- <h1>Sampling for facets accumulation</h1>
- </body>
-</html>
\ No newline at end of file
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyReader.java b/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyReader.java
index 9bca90ec44e..2f1fb30dfbd 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyReader.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyReader.java
@@ -5,6 +5,7 @@ import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.apache.lucene.facet.collections.LRUHashMap;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
import org.apache.lucene.facet.taxonomy.directory.Consts.LoadFullPathOnly;
@@ -17,7 +18,6 @@ import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.IOUtils;
-import org.apache.lucene.util.collections.LRUHashMap;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/package.html b/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/package.html
index 82d23315d3b..edbec74f587 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/package.html
+++ b/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/package.html
@@ -16,10 +16,9 @@
-->
<html>
<head>
-<title>Taxonomy implemented using a Lucene-Index</title>
+<title>Taxonomy index implementation using on top of a Directory</title>
</head>
<body>
- <h1>Taxonomy implemented using a Lucene-Index</h1>
-
+Taxonomy index implementation using on top of a Directory.
</body>
</html>
\ No newline at end of file
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/package.html b/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/package.html
index e04e585b4c5..36f13e84244 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/package.html
+++ b/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/package.html
@@ -22,7 +22,7 @@
<h1>Taxonomy of Categories</h1>
Facets are defined using a hierarchy of categories, known as a
- <i>Taxonomy</i>
+ <i>Taxonomy</i>.
<br>
For example, in a book store application, a Taxonomy could have the
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/writercache/package.html b/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/writercache/package.html
index 64e6ff39c9a..72bae6f6a73 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/writercache/package.html
+++ b/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/writercache/package.html
@@ -16,10 +16,9 @@
-->
<html>
<head>
-<title>Improves indexing time by caching a map of CategoryPath to their Ordinal</title>
+<title>Taxonomy index cache</title>
</head>
<body>
- <h1>Improves indexing time by caching a map of CategoryPath to their Ordinal</h1>
-
+Improves indexing time by caching a map of CategoryPath to their Ordinal.
</body>
</html>
\ No newline at end of file
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/index/FacetsPayloadMigrationReader.java b/lucene/facet/src/java/org/apache/lucene/facet/util/FacetsPayloadMigrationReader.java
similarity index 98%
rename from lucene/facet/src/java/org/apache/lucene/facet/index/FacetsPayloadMigrationReader.java
rename to lucene/facet/src/java/org/apache/lucene/facet/util/FacetsPayloadMigrationReader.java
index d8181133aad..4ce34b15172 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/index/FacetsPayloadMigrationReader.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/util/FacetsPayloadMigrationReader.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.facet.index;
+package org.apache.lucene.facet.util;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -23,8 +23,8 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
-import org.apache.lucene.facet.index.params.CategoryListParams;
-import org.apache.lucene.facet.index.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.CategoryListParams;
+import org.apache.lucene.facet.params.FacetIndexingParams;
import org.apache.lucene.index.AtomicReader;
import org.apache.lucene.index.AtomicReaderContext;
import org.apache.lucene.index.BinaryDocValues;
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/index/OrdinalMappingAtomicReader.java b/lucene/facet/src/java/org/apache/lucene/facet/util/OrdinalMappingAtomicReader.java
similarity index 95%
rename from lucene/facet/src/java/org/apache/lucene/facet/index/OrdinalMappingAtomicReader.java
rename to lucene/facet/src/java/org/apache/lucene/facet/util/OrdinalMappingAtomicReader.java
index e9ef0df0536..ad0a102d425 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/index/OrdinalMappingAtomicReader.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/util/OrdinalMappingAtomicReader.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.facet.index;
+package org.apache.lucene.facet.util;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -21,16 +21,16 @@ import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
-import org.apache.lucene.facet.index.params.CategoryListParams;
-import org.apache.lucene.facet.index.params.FacetIndexingParams;
+import org.apache.lucene.facet.encoding.IntDecoder;
+import org.apache.lucene.facet.encoding.IntEncoder;
+import org.apache.lucene.facet.params.CategoryListParams;
+import org.apache.lucene.facet.params.FacetIndexingParams;
import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter.OrdinalMap;
import org.apache.lucene.index.AtomicReader;
import org.apache.lucene.index.BinaryDocValues;
import org.apache.lucene.index.FilterAtomicReader;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.IntsRef;
-import org.apache.lucene.util.encoding.IntDecoder;
-import org.apache.lucene.util.encoding.IntEncoder;
/**
* A {@link FilterAtomicReader} for updating facets ordinal references,
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/util/PartitionsUtils.java b/lucene/facet/src/java/org/apache/lucene/facet/util/PartitionsUtils.java
index a16a47294d8..99f66dfff22 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/util/PartitionsUtils.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/util/PartitionsUtils.java
@@ -1,6 +1,6 @@
package org.apache.lucene.facet.util;
-import org.apache.lucene.facet.index.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.FacetIndexingParams;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
/*
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/util/ResultSortUtils.java b/lucene/facet/src/java/org/apache/lucene/facet/util/ResultSortUtils.java
index 4c61d0833cb..7a328a6006c 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/util/ResultSortUtils.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/util/ResultSortUtils.java
@@ -6,10 +6,10 @@ import java.util.Comparator;
import org.apache.lucene.util.PriorityQueue;
+import org.apache.lucene.facet.search.FacetRequest;
+import org.apache.lucene.facet.search.FacetResultNode;
import org.apache.lucene.facet.search.Heap;
-import org.apache.lucene.facet.search.params.FacetRequest;
-import org.apache.lucene.facet.search.params.FacetRequest.SortOrder;
-import org.apache.lucene.facet.search.results.FacetResultNode;
+import org.apache.lucene.facet.search.FacetRequest.SortOrder;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/util/TaxonomyMergeUtils.java b/lucene/facet/src/java/org/apache/lucene/facet/util/TaxonomyMergeUtils.java
index ea01728fff9..3a6c75b7fe7 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/util/TaxonomyMergeUtils.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/util/TaxonomyMergeUtils.java
@@ -3,8 +3,7 @@ package org.apache.lucene.facet.util;
import java.io.IOException;
import java.util.List;
-import org.apache.lucene.facet.index.OrdinalMappingAtomicReader;
-import org.apache.lucene.facet.index.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.FacetIndexingParams;
import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter;
import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter.OrdinalMap;
import org.apache.lucene.index.AtomicReader;
diff --git a/lucene/facet/src/java/org/apache/lucene/util/UnsafeByteArrayInputStream.java b/lucene/facet/src/java/org/apache/lucene/util/UnsafeByteArrayInputStream.java
deleted file mode 100644
index 10b3ccb54e7..00000000000
--- a/lucene/facet/src/java/org/apache/lucene/util/UnsafeByteArrayInputStream.java
+++ /dev/null
@@ -1,147 +0,0 @@
-package org.apache.lucene.util;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * This class, much like {@link ByteArrayInputStream} uses a given buffer as a
- * source of an InputStream. Unlike ByteArrayInputStream, this class does not
- * "waste" memory by creating a local copy of the given buffer, but rather uses
- * the given buffer as is. Hence the name Unsafe. While using this class one
- * should remember that the byte[] buffer memory is shared and might be changed
- * from outside.
- *
- * For reuse-ability, a call for {@link #reInit(byte[])} can be called, and
- * initialize the stream with a new buffer.
- *
- * @lucene.experimental
- */
-public class UnsafeByteArrayInputStream extends InputStream {
-
- private byte[] buffer;
- private int markIndex;
- private int upperLimit;
- private int index;
-
- /**
- * Creates a new instance by not using any byte[] up front. If you use this
- * constructor, you MUST call either of the {@link #reInit(byte[]) reInit}
- * methods before you consume any byte from this instance.<br>
- * This constructor is for convenience purposes only, so that if one does not
- * have the byte[] at the moment of creation, one is not forced to pass a
- * <code>new byte[0]</code> or something. Obviously in that case, one will
- * call either {@link #reInit(byte[]) reInit} methods before using the class.
- */
- public UnsafeByteArrayInputStream() {
- markIndex = upperLimit = index = 0;
- }
-
- /**
- * Creates an UnsafeByteArrayInputStream which uses a given byte array as
- * the source of the stream. Default range is [0 , buffer.length)
- *
- * @param buffer
- * byte array used as the source of this stream
- */
- public UnsafeByteArrayInputStream(byte[] buffer) {
- reInit(buffer, 0, buffer.length);
- }
-
- /**
- * Creates an UnsafeByteArrayInputStream which uses a given byte array as
- * the source of the stream, at the specific range: [startPos, endPos)
- *
- * @param buffer
- * byte array used as the source of this stream
- * @param startPos
- * first index (inclusive) to the data lying in the given buffer
- * @param endPos
- * an index (exclusive) where the data ends. data @
- * buffer[endPos] will never be read
- */
- public UnsafeByteArrayInputStream(byte[] buffer, int startPos, int endPos) {
- reInit(buffer, startPos, endPos);
- }
-
- @Override
- public void mark(int readlimit) {
- markIndex = index;
- }
-
- @Override
- public boolean markSupported() {
- return true;
- }
-
- /**
- * Initialize the stream with a given buffer, using the default limits of
- * [0, buffer.length)
- *
- * @param buffer
- * byte array used as the source of this stream
- */
- public void reInit(byte[] buffer) {
- reInit(buffer, 0, buffer.length);
- }
-
- /**
- * Initialize the stream with a given byte array as the source of the
- * stream, at the specific range: [startPos, endPos)
- *
- * @param buffer
- * byte array used as the source of this stream
- * @param startPos
- * first index (inclusive) to the data lying in the given buffer
- * @param endPos
- * an index (exclusive) where the data ends. data @
- * buffer[endPos] will never be read
- */
- public void reInit(byte[] buffer, int startPos, int endPos) {
- this.buffer = buffer;
- markIndex = startPos;
- upperLimit = endPos;
- index = markIndex;
- }
-
- @Override
- public int available() throws IOException {
- return upperLimit - index;
- }
-
- /**
- * Read a byte. Data returned as an integer [0,255] If end of stream
- * reached, returns -1
- */
- @Override
- public int read() throws IOException {
- return index < upperLimit ? buffer[index++] & 0xff : -1;
- }
-
- /**
- * Resets the stream back to its original state. Basically - moving the
- * index back to start position.
- */
- @Override
- public void reset() throws IOException {
- index = markIndex;
- }
-
-}
diff --git a/lucene/facet/src/java/org/apache/lucene/util/UnsafeByteArrayOutputStream.java b/lucene/facet/src/java/org/apache/lucene/util/UnsafeByteArrayOutputStream.java
deleted file mode 100644
index 80e5c8cc26c..00000000000
--- a/lucene/facet/src/java/org/apache/lucene/util/UnsafeByteArrayOutputStream.java
+++ /dev/null
@@ -1,184 +0,0 @@
-package org.apache.lucene.util;
-
-import java.io.IOException;
-import java.io.OutputStream;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * This class is used as a wrapper to a byte array, extending
- * {@link OutputStream}. Data is written in the given byte[] buffer, until its
- * length is insufficient. Than the buffer size is doubled and the data is
- * written.
- *
- * This class is Unsafe as it is using a buffer which potentially can be changed
- * from the outside. Moreover, when {@link #toByteArray()} is called, the buffer
- * itself is returned, and not a copy.
- *
- * @lucene.experimental
- */
-public class UnsafeByteArrayOutputStream extends OutputStream {
-
- private byte[] buffer;
- private int index;
- private int startIndex;
-
- /**
- * Constructs a new output stream, with a default allocated buffer which can
- * later be obtained via {@link #toByteArray()}.
- */
- public UnsafeByteArrayOutputStream() {
- reInit(new byte[32], 0);
- }
-
- /**
- * Constructs a new output stream, with a given buffer. Writing will start
- * at index 0 as a default.
- *
- * @param buffer
- * some space to which writing will be made
- */
- public UnsafeByteArrayOutputStream(byte[] buffer) {
- reInit(buffer, 0);
- }
-
- /**
- * Constructs a new output stream, with a given buffer. Writing will start
- * at a given index.
- *
- * @param buffer
- * some space to which writing will be made.
- * @param startPos
- * an index (inclusive) from white data will be written.
- */
- public UnsafeByteArrayOutputStream(byte[] buffer, int startPos) {
- reInit(buffer, startPos);
- }
-
- private void grow(int newLength) {
- // It actually should be: (Java 1.7, when its intrinsic on all machines)
- // buffer = Arrays.copyOf(buffer, newLength);
- byte[] newBuffer = new byte[newLength];
- System.arraycopy(buffer, 0, newBuffer, 0, buffer.length);
- buffer = newBuffer;
- }
-
- /**
- * For reuse-ability, this stream object can be re-initialized with another
- * given buffer and starting position.
- *
- * @param buffer some space to which writing will be made.
- * @param startPos an index (inclusive) from white data will be written.
- */
- public void reInit(byte[] buffer, int startPos) {
- if (buffer.length == 0) {
- throw new IllegalArgumentException("initial buffer length must be greater than 0.");
- }
- this.buffer = buffer;
- startIndex = startPos;
- index = startIndex;
- }
-
- /**
- * For reuse-ability, this stream object can be re-initialized with another
- * given buffer, using 0 as default starting position.
- *
- * @param buffer some space to which writing will be made.
- */
- public void reInit(byte[] buffer) {
- reInit(buffer, 0);
- }
-
- /**
- * writes a given byte(at the form of an int) to the buffer. If the buffer's
- * empty space is insufficient, the buffer is doubled.
- *
- * @param value byte value to be written
- */
- @Override
- public void write(int value) throws IOException {
- if (index >= buffer.length) {
- grow(buffer.length << 1);
- }
- buffer[index++] = (byte) value;
- }
-
- /**
- * writes a given byte[], with offset and length to the buffer. If the
- * buffer's empty space is insufficient, the buffer is doubled until it
- * could contain all the data.
- *
- * @param b
- * byte buffer, containing the source data to be written
- * @param off
- * index from which data from the buffer b should be written
- * @param len
- * number of bytes that should be written
- */
- @Override
- public void write(byte[] b, int off, int len) throws IOException {
- // If there's not enough space for the data
- int targetLength = index + len;
- if (targetLength >= buffer.length) {
- // Calculating the new required length of the array, keeping the array
- // size a power of 2 if it was initialized like that.
- int newlen = buffer.length;
- while ((newlen <<= 1) < targetLength) {}
- grow(newlen);
- }
-
- // Now that we have enough spare space, we could copy the rest of the
- // data
- System.arraycopy(b, off, buffer, index, len);
-
- // Updating the index to next available index.
- index += len;
- }
-
- /**
- * Returns the byte array saved within the buffer AS IS.
- *
- * @return the actual inner buffer - not a copy of it.
- */
- public byte[] toByteArray() {
- return buffer;
- }
-
- /**
- * Returns the number of relevant bytes. This objects makes sure the buffer
- * is at least the size of it's data. But it can also be twice as big. The
- * user would want to process the relevant bytes only. For that he would
- * need the count.
- *
- * @return number of relevant bytes
- */
- public int length() {
- return index;
- }
-
- /**
- * Returns the start position data was written to. This is useful in case you
- * used {@link #reInit(byte[], int)} or
- * {@link #UnsafeByteArrayOutputStream(byte[], int)} and passed a start
- * position which is not 0.
- */
- public int getStartPos() {
- return startIndex;
- }
-
-}
diff --git a/lucene/facet/src/java/org/apache/lucene/util/encoding/package.html b/lucene/facet/src/java/org/apache/lucene/util/encoding/package.html
deleted file mode 100644
index 8a81b258e34..00000000000
--- a/lucene/facet/src/java/org/apache/lucene/util/encoding/package.html
+++ /dev/null
@@ -1,40 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<html>
-<head>
-<title>Encoding</title>
-</head>
-<body>
-Offers various encoders and decoders for integers, as well as the
-mechanisms to create new ones. The super class for all encoders is
-{@link org.apache.lucene.util.encoding.IntEncoder} and for most of the
-encoders there is a matching {@link
-org.apache.lucene.util.encoding.IntDecoder} implementation (not all
-encoders need a decoder).
-<p>
-Some encoders don't perform any encoding at all, or do not include an
-encoding logic. Those are called {@link
-org.apache.lucene.util.encoding.IntEncoderFilter}s. A filter is an
-encoder which delegates the encoding task to a given encoder, however
-performs additional logic before the values are sent for encoding. An
-example is {@link org.apache.lucene.util.encoding.DGapIntEncoder}
-which encodes the gaps between values rather than the values themselves.
-Another example is {@link
-org.apache.lucene.util.encoding.SortingIntEncoder} which sorts all the
-values in ascending order before they are sent for encoding.
-</body>
-</html>
\ No newline at end of file
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/FacetTestBase.java b/lucene/facet/src/test/org/apache/lucene/facet/FacetTestBase.java
index d770546b652..46321c32ef2 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/FacetTestBase.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/FacetTestBase.java
@@ -16,14 +16,15 @@ 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.collections.IntToObjectMap;
import org.apache.lucene.facet.index.FacetFields;
-import org.apache.lucene.facet.index.params.CategoryListParams;
-import org.apache.lucene.facet.index.params.CategoryListParams.OrdinalPolicy;
-import org.apache.lucene.facet.index.params.FacetIndexingParams;
-import org.apache.lucene.facet.search.params.FacetRequest;
-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.params.CategoryListParams;
+import org.apache.lucene.facet.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.FacetSearchParams;
+import org.apache.lucene.facet.params.CategoryListParams.OrdinalPolicy;
+import org.apache.lucene.facet.search.FacetRequest;
+import org.apache.lucene.facet.search.FacetResult;
+import org.apache.lucene.facet.search.FacetResultNode;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
import org.apache.lucene.facet.taxonomy.TaxonomyWriter;
@@ -46,7 +47,6 @@ import org.apache.lucene.util.Bits;
import org.apache.lucene.util.IOUtils;
import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
import org.apache.lucene.util._TestUtil;
-import org.apache.lucene.util.collections.IntToObjectMap;
import org.junit.AfterClass;
import org.junit.BeforeClass;
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/FacetTestCase.java b/lucene/facet/src/test/org/apache/lucene/facet/FacetTestCase.java
index a6cf3b8ec3b..bbff743d284 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/FacetTestCase.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/FacetTestCase.java
@@ -2,17 +2,17 @@ package org.apache.lucene.facet;
import java.util.Random;
-import org.apache.lucene.facet.index.params.CategoryListParams;
+import org.apache.lucene.facet.encoding.DGapIntEncoder;
+import org.apache.lucene.facet.encoding.DGapVInt8IntEncoder;
+import org.apache.lucene.facet.encoding.EightFlagsIntEncoder;
+import org.apache.lucene.facet.encoding.FourFlagsIntEncoder;
+import org.apache.lucene.facet.encoding.IntEncoder;
+import org.apache.lucene.facet.encoding.NOnesIntEncoder;
+import org.apache.lucene.facet.encoding.SortingIntEncoder;
+import org.apache.lucene.facet.encoding.UniqueValuesIntEncoder;
+import org.apache.lucene.facet.encoding.VInt8IntEncoder;
+import org.apache.lucene.facet.params.CategoryListParams;
import org.apache.lucene.util.LuceneTestCase;
-import org.apache.lucene.util.encoding.DGapIntEncoder;
-import org.apache.lucene.util.encoding.DGapVInt8IntEncoder;
-import org.apache.lucene.util.encoding.EightFlagsIntEncoder;
-import org.apache.lucene.util.encoding.FourFlagsIntEncoder;
-import org.apache.lucene.util.encoding.IntEncoder;
-import org.apache.lucene.util.encoding.NOnesIntEncoder;
-import org.apache.lucene.util.encoding.SortingIntEncoder;
-import org.apache.lucene.util.encoding.UniqueValuesIntEncoder;
-import org.apache.lucene.util.encoding.VInt8IntEncoder;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/FacetTestUtils.java b/lucene/facet/src/test/org/apache/lucene/facet/FacetTestUtils.java
index aef675e7da5..66c6d5a6194 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/FacetTestUtils.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/FacetTestUtils.java
@@ -1,7 +1,7 @@
package org.apache.lucene.facet;
-import org.apache.lucene.facet.search.results.FacetResult;
-import org.apache.lucene.facet.search.results.FacetResultNode;
+import org.apache.lucene.facet.search.FacetResult;
+import org.apache.lucene.facet.search.FacetResultNode;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/lucene/facet/src/test/org/apache/lucene/util/SlowRAMDirectory.java b/lucene/facet/src/test/org/apache/lucene/facet/SlowRAMDirectory.java
similarity index 93%
rename from lucene/facet/src/test/org/apache/lucene/util/SlowRAMDirectory.java
rename to lucene/facet/src/test/org/apache/lucene/facet/SlowRAMDirectory.java
index 77c75ca3865..ee21a8c211b 100644
--- a/lucene/facet/src/test/org/apache/lucene/util/SlowRAMDirectory.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/SlowRAMDirectory.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.util;
+package org.apache.lucene.facet;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -24,6 +24,7 @@ import org.apache.lucene.store.IOContext;
import org.apache.lucene.store.IndexInput;
import org.apache.lucene.store.IndexOutput;
import org.apache.lucene.store.RAMDirectory;
+import org.apache.lucene.util.ThreadInterruptedException;
/**
* Test utility - slow directory
@@ -89,18 +90,18 @@ public class SlowRAMDirectory extends RAMDirectory {
private class SlowIndexInput extends IndexInput {
private IndexInput ii;
private int numRead = 0;
- private Random random;
+ private Random rand;
public SlowIndexInput(IndexInput ii) {
super("SlowIndexInput(" + ii + ")");
- this.random = forkRandom();
+ this.rand = forkRandom();
this.ii = ii;
}
@Override
public byte readByte() throws IOException {
if (numRead >= IO_SLEEP_THRESHOLD) {
- doSleep(random, 0);
+ doSleep(rand, 0);
numRead = 0;
}
++numRead;
@@ -110,7 +111,7 @@ public class SlowRAMDirectory extends RAMDirectory {
@Override
public void readBytes(byte[] b, int offset, int len) throws IOException {
if (numRead >= IO_SLEEP_THRESHOLD) {
- doSleep(random, len);
+ doSleep(rand, len);
numRead = 0;
}
numRead += len;
@@ -135,17 +136,17 @@ public class SlowRAMDirectory extends RAMDirectory {
private IndexOutput io;
private int numWrote;
- private final Random random;
+ private final Random rand;
public SlowIndexOutput(IndexOutput io) {
this.io = io;
- this.random = forkRandom();
+ this.rand = forkRandom();
}
@Override
public void writeByte(byte b) throws IOException {
if (numWrote >= IO_SLEEP_THRESHOLD) {
- doSleep(random, 0);
+ doSleep(rand, 0);
numWrote = 0;
}
++numWrote;
@@ -155,7 +156,7 @@ public class SlowRAMDirectory extends RAMDirectory {
@Override
public void writeBytes(byte[] b, int offset, int length) throws IOException {
if (numWrote >= IO_SLEEP_THRESHOLD) {
- doSleep(random, length);
+ doSleep(rand, length);
numWrote = 0;
}
numWrote += length;
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/search/associations/AssociationsFacetRequestTest.java b/lucene/facet/src/test/org/apache/lucene/facet/associations/AssociationsFacetRequestTest.java
similarity index 95%
rename from lucene/facet/src/test/org/apache/lucene/facet/search/associations/AssociationsFacetRequestTest.java
rename to lucene/facet/src/test/org/apache/lucene/facet/associations/AssociationsFacetRequestTest.java
index 7bb650b62ca..b65e5115a27 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/search/associations/AssociationsFacetRequestTest.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/associations/AssociationsFacetRequestTest.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.facet.search.associations;
+package org.apache.lucene.facet.associations;
import java.util.List;
@@ -6,15 +6,15 @@ import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.analysis.MockTokenizer;
import org.apache.lucene.document.Document;
import org.apache.lucene.facet.FacetTestCase;
+import org.apache.lucene.facet.associations.AssociationFloatSumFacetRequest;
+import org.apache.lucene.facet.associations.AssociationIntSumFacetRequest;
import org.apache.lucene.facet.associations.AssociationsFacetFields;
import org.apache.lucene.facet.associations.CategoryAssociationsContainer;
import org.apache.lucene.facet.associations.CategoryFloatAssociation;
import org.apache.lucene.facet.associations.CategoryIntAssociation;
+import org.apache.lucene.facet.params.FacetSearchParams;
+import org.apache.lucene.facet.search.FacetResult;
import org.apache.lucene.facet.search.FacetsCollector;
-import org.apache.lucene.facet.search.params.FacetSearchParams;
-import org.apache.lucene.facet.search.params.associations.AssociationFloatSumFacetRequest;
-import org.apache.lucene.facet.search.params.associations.AssociationIntSumFacetRequest;
-import org.apache.lucene.facet.search.results.FacetResult;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.facet.taxonomy.TaxonomyWriter;
import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyReader;
diff --git a/lucene/facet/src/test/org/apache/lucene/util/collections/ArrayHashMapTest.java b/lucene/facet/src/test/org/apache/lucene/facet/collections/ArrayHashMapTest.java
similarity index 98%
rename from lucene/facet/src/test/org/apache/lucene/util/collections/ArrayHashMapTest.java
rename to lucene/facet/src/test/org/apache/lucene/facet/collections/ArrayHashMapTest.java
index 4b0c3ba90fe..ade3bc8c74d 100644
--- a/lucene/facet/src/test/org/apache/lucene/util/collections/ArrayHashMapTest.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/collections/ArrayHashMapTest.java
@@ -1,10 +1,11 @@
-package org.apache.lucene.util.collections;
+package org.apache.lucene.facet.collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Random;
import org.apache.lucene.facet.FacetTestCase;
+import org.apache.lucene.facet.collections.ArrayHashMap;
import org.junit.Test;
/*
diff --git a/lucene/facet/src/test/org/apache/lucene/util/collections/FloatToObjectMapTest.java b/lucene/facet/src/test/org/apache/lucene/facet/collections/FloatToObjectMapTest.java
similarity index 97%
rename from lucene/facet/src/test/org/apache/lucene/util/collections/FloatToObjectMapTest.java
rename to lucene/facet/src/test/org/apache/lucene/facet/collections/FloatToObjectMapTest.java
index a627ea1e423..c3cb26fb313 100644
--- a/lucene/facet/src/test/org/apache/lucene/util/collections/FloatToObjectMapTest.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/collections/FloatToObjectMapTest.java
@@ -1,10 +1,12 @@
-package org.apache.lucene.util.collections;
+package org.apache.lucene.facet.collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Random;
import org.apache.lucene.facet.FacetTestCase;
+import org.apache.lucene.facet.collections.FloatIterator;
+import org.apache.lucene.facet.collections.FloatToObjectMap;
import org.junit.Test;
/*
diff --git a/lucene/facet/src/test/org/apache/lucene/util/collections/IntArrayTest.java b/lucene/facet/src/test/org/apache/lucene/facet/collections/IntArrayTest.java
similarity index 96%
rename from lucene/facet/src/test/org/apache/lucene/util/collections/IntArrayTest.java
rename to lucene/facet/src/test/org/apache/lucene/facet/collections/IntArrayTest.java
index 73b33465622..e15ecf7425e 100644
--- a/lucene/facet/src/test/org/apache/lucene/util/collections/IntArrayTest.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/collections/IntArrayTest.java
@@ -1,6 +1,7 @@
-package org.apache.lucene.util.collections;
+package org.apache.lucene.facet.collections;
import org.apache.lucene.facet.FacetTestCase;
+import org.apache.lucene.facet.collections.IntArray;
import org.junit.Test;
/*
diff --git a/lucene/facet/src/test/org/apache/lucene/util/collections/IntHashSetTest.java b/lucene/facet/src/test/org/apache/lucene/facet/collections/IntHashSetTest.java
similarity index 98%
rename from lucene/facet/src/test/org/apache/lucene/util/collections/IntHashSetTest.java
rename to lucene/facet/src/test/org/apache/lucene/facet/collections/IntHashSetTest.java
index 1440925f23a..4545bb324f3 100644
--- a/lucene/facet/src/test/org/apache/lucene/util/collections/IntHashSetTest.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/collections/IntHashSetTest.java
@@ -1,8 +1,9 @@
-package org.apache.lucene.util.collections;
+package org.apache.lucene.facet.collections;
import java.util.HashSet;
import org.apache.lucene.facet.FacetTestCase;
+import org.apache.lucene.facet.collections.IntHashSet;
import org.junit.Test;
/*
diff --git a/lucene/facet/src/test/org/apache/lucene/util/collections/IntToDoubleMapTest.java b/lucene/facet/src/test/org/apache/lucene/facet/collections/IntToDoubleMapTest.java
similarity index 97%
rename from lucene/facet/src/test/org/apache/lucene/util/collections/IntToDoubleMapTest.java
rename to lucene/facet/src/test/org/apache/lucene/facet/collections/IntToDoubleMapTest.java
index 9380cc1e444..a75e965c924 100644
--- a/lucene/facet/src/test/org/apache/lucene/util/collections/IntToDoubleMapTest.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/collections/IntToDoubleMapTest.java
@@ -1,9 +1,12 @@
-package org.apache.lucene.util.collections;
+package org.apache.lucene.facet.collections;
import java.util.HashSet;
import java.util.Random;
import org.apache.lucene.facet.FacetTestCase;
+import org.apache.lucene.facet.collections.DoubleIterator;
+import org.apache.lucene.facet.collections.IntIterator;
+import org.apache.lucene.facet.collections.IntToDoubleMap;
import org.junit.Test;
/*
diff --git a/lucene/facet/src/test/org/apache/lucene/util/collections/IntToFloatMapTest.java b/lucene/facet/src/test/org/apache/lucene/facet/collections/IntToFloatMapTest.java
similarity index 97%
rename from lucene/facet/src/test/org/apache/lucene/util/collections/IntToFloatMapTest.java
rename to lucene/facet/src/test/org/apache/lucene/facet/collections/IntToFloatMapTest.java
index 4c9fc88b635..272c8ae6093 100644
--- a/lucene/facet/src/test/org/apache/lucene/util/collections/IntToFloatMapTest.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/collections/IntToFloatMapTest.java
@@ -1,9 +1,12 @@
-package org.apache.lucene.util.collections;
+package org.apache.lucene.facet.collections;
import java.util.HashSet;
import java.util.Random;
import org.apache.lucene.facet.FacetTestCase;
+import org.apache.lucene.facet.collections.FloatIterator;
+import org.apache.lucene.facet.collections.IntIterator;
+import org.apache.lucene.facet.collections.IntToFloatMap;
import org.junit.Test;
/*
diff --git a/lucene/facet/src/test/org/apache/lucene/util/collections/IntToIntMapTest.java b/lucene/facet/src/test/org/apache/lucene/facet/collections/IntToIntMapTest.java
similarity index 97%
rename from lucene/facet/src/test/org/apache/lucene/util/collections/IntToIntMapTest.java
rename to lucene/facet/src/test/org/apache/lucene/facet/collections/IntToIntMapTest.java
index 6877a89997b..06988b94025 100644
--- a/lucene/facet/src/test/org/apache/lucene/util/collections/IntToIntMapTest.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/collections/IntToIntMapTest.java
@@ -1,9 +1,11 @@
-package org.apache.lucene.util.collections;
+package org.apache.lucene.facet.collections;
import java.util.HashSet;
import java.util.Random;
import org.apache.lucene.facet.FacetTestCase;
+import org.apache.lucene.facet.collections.IntIterator;
+import org.apache.lucene.facet.collections.IntToIntMap;
import org.junit.Test;
/*
diff --git a/lucene/facet/src/test/org/apache/lucene/util/collections/IntToObjectMapTest.java b/lucene/facet/src/test/org/apache/lucene/facet/collections/IntToObjectMapTest.java
similarity index 97%
rename from lucene/facet/src/test/org/apache/lucene/util/collections/IntToObjectMapTest.java
rename to lucene/facet/src/test/org/apache/lucene/facet/collections/IntToObjectMapTest.java
index 91337451b68..d505155cc36 100644
--- a/lucene/facet/src/test/org/apache/lucene/util/collections/IntToObjectMapTest.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/collections/IntToObjectMapTest.java
@@ -1,10 +1,12 @@
-package org.apache.lucene.util.collections;
+package org.apache.lucene.facet.collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Random;
import org.apache.lucene.facet.FacetTestCase;
+import org.apache.lucene.facet.collections.IntIterator;
+import org.apache.lucene.facet.collections.IntToObjectMap;
import org.junit.Test;
/*
diff --git a/lucene/facet/src/test/org/apache/lucene/util/collections/ObjectToFloatMapTest.java b/lucene/facet/src/test/org/apache/lucene/facet/collections/ObjectToFloatMapTest.java
similarity index 97%
rename from lucene/facet/src/test/org/apache/lucene/util/collections/ObjectToFloatMapTest.java
rename to lucene/facet/src/test/org/apache/lucene/facet/collections/ObjectToFloatMapTest.java
index 7d00a16b39a..b291cc986a9 100644
--- a/lucene/facet/src/test/org/apache/lucene/util/collections/ObjectToFloatMapTest.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/collections/ObjectToFloatMapTest.java
@@ -1,10 +1,12 @@
-package org.apache.lucene.util.collections;
+package org.apache.lucene.facet.collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Random;
import org.apache.lucene.facet.FacetTestCase;
+import org.apache.lucene.facet.collections.FloatIterator;
+import org.apache.lucene.facet.collections.ObjectToFloatMap;
import org.junit.Test;
/*
diff --git a/lucene/facet/src/test/org/apache/lucene/util/collections/ObjectToIntMapTest.java b/lucene/facet/src/test/org/apache/lucene/facet/collections/ObjectToIntMapTest.java
similarity index 98%
rename from lucene/facet/src/test/org/apache/lucene/util/collections/ObjectToIntMapTest.java
rename to lucene/facet/src/test/org/apache/lucene/facet/collections/ObjectToIntMapTest.java
index adb3d855f2d..89631284d61 100644
--- a/lucene/facet/src/test/org/apache/lucene/util/collections/ObjectToIntMapTest.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/collections/ObjectToIntMapTest.java
@@ -1,10 +1,12 @@
-package org.apache.lucene.util.collections;
+package org.apache.lucene.facet.collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Random;
import org.apache.lucene.facet.FacetTestCase;
+import org.apache.lucene.facet.collections.IntIterator;
+import org.apache.lucene.facet.collections.ObjectToIntMap;
import org.junit.Test;
/*
diff --git a/lucene/facet/src/test/org/apache/lucene/util/collections/TestLRUHashMap.java b/lucene/facet/src/test/org/apache/lucene/facet/collections/TestLRUHashMap.java
similarity index 95%
rename from lucene/facet/src/test/org/apache/lucene/util/collections/TestLRUHashMap.java
rename to lucene/facet/src/test/org/apache/lucene/facet/collections/TestLRUHashMap.java
index ddf3301eeda..d61bf710af8 100644
--- a/lucene/facet/src/test/org/apache/lucene/util/collections/TestLRUHashMap.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/collections/TestLRUHashMap.java
@@ -1,6 +1,7 @@
-package org.apache.lucene.util.collections;
+package org.apache.lucene.facet.collections;
import org.apache.lucene.facet.FacetTestCase;
+import org.apache.lucene.facet.collections.LRUHashMap;
import org.junit.Test;
/*
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/search/TestFacetsAccumulatorWithComplement.java b/lucene/facet/src/test/org/apache/lucene/facet/complements/TestFacetsAccumulatorWithComplement.java
similarity index 88%
rename from lucene/facet/src/test/org/apache/lucene/facet/search/TestFacetsAccumulatorWithComplement.java
rename to lucene/facet/src/test/org/apache/lucene/facet/complements/TestFacetsAccumulatorWithComplement.java
index ef45025fcee..8cb229a2e9f 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/search/TestFacetsAccumulatorWithComplement.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/complements/TestFacetsAccumulatorWithComplement.java
@@ -1,14 +1,16 @@
-package org.apache.lucene.facet.search;
+package org.apache.lucene.facet.complements;
import java.io.IOException;
import java.util.List;
import org.apache.lucene.facet.FacetTestBase;
-import org.apache.lucene.facet.index.params.FacetIndexingParams;
-import org.apache.lucene.facet.search.params.CountFacetRequest;
-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.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.FacetSearchParams;
+import org.apache.lucene.facet.search.CountFacetRequest;
+import org.apache.lucene.facet.search.FacetResult;
+import org.apache.lucene.facet.search.FacetResultNode;
+import org.apache.lucene.facet.search.FacetsCollector;
+import org.apache.lucene.facet.search.StandardFacetsAccumulator;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.MultiReader;
@@ -36,11 +38,6 @@ import org.junit.Test;
* limitations under the License.
*/
-/**
- * Test that complementsworks as expected.
- * We place this test under *.facet.search rather than *.search
- * because the test actually does faceted search.
- */
public class TestFacetsAccumulatorWithComplement extends FacetTestBase {
private FacetIndexingParams fip;
@@ -130,9 +127,9 @@ public class TestFacetsAccumulatorWithComplement extends FacetTestBase {
}
}
- assertEquals(withComplement, sfa.isUsingComplements);
+ assertEquals(withComplement, sfa.isUsingComplements());
return res;
}
-}
\ No newline at end of file
+}
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/search/TestTotalFacetCounts.java b/lucene/facet/src/test/org/apache/lucene/facet/complements/TestTotalFacetCounts.java
similarity index 94%
rename from lucene/facet/src/test/org/apache/lucene/facet/search/TestTotalFacetCounts.java
rename to lucene/facet/src/test/org/apache/lucene/facet/complements/TestTotalFacetCounts.java
index f84678bb46b..144356b020f 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/search/TestTotalFacetCounts.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/complements/TestTotalFacetCounts.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.facet.search;
+package org.apache.lucene.facet.complements;
import java.io.File;
import java.io.IOException;
@@ -7,9 +7,11 @@ import java.util.Collections;
import org.apache.lucene.document.Document;
import org.apache.lucene.facet.FacetTestCase;
+import org.apache.lucene.facet.complements.TotalFacetCounts;
+import org.apache.lucene.facet.complements.TotalFacetCountsCache;
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.params.CategoryListParams;
+import org.apache.lucene.facet.params.FacetIndexingParams;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
import org.apache.lucene.facet.taxonomy.TaxonomyWriter;
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/search/TestTotalFacetCountsCache.java b/lucene/facet/src/test/org/apache/lucene/facet/complements/TestTotalFacetCountsCache.java
similarity index 96%
rename from lucene/facet/src/test/org/apache/lucene/facet/search/TestTotalFacetCountsCache.java
rename to lucene/facet/src/test/org/apache/lucene/facet/complements/TestTotalFacetCountsCache.java
index 8e88dbbc46c..d70e608a47f 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/search/TestTotalFacetCountsCache.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/complements/TestTotalFacetCountsCache.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.facet.search;
+package org.apache.lucene.facet.complements;
import java.io.File;
import java.io.IOException;
@@ -10,13 +10,17 @@ import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.analysis.MockTokenizer;
import org.apache.lucene.document.Document;
import org.apache.lucene.facet.FacetTestCase;
+import org.apache.lucene.facet.SlowRAMDirectory;
+import org.apache.lucene.facet.complements.TotalFacetCounts;
+import org.apache.lucene.facet.complements.TotalFacetCountsCache;
+import org.apache.lucene.facet.complements.TotalFacetCounts.CreationType;
import org.apache.lucene.facet.index.FacetFields;
-import org.apache.lucene.facet.index.params.FacetIndexingParams;
-import org.apache.lucene.facet.search.TotalFacetCounts.CreationType;
-import org.apache.lucene.facet.search.params.CountFacetRequest;
-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.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.FacetSearchParams;
+import org.apache.lucene.facet.search.CountFacetRequest;
+import org.apache.lucene.facet.search.FacetResult;
+import org.apache.lucene.facet.search.FacetResultNode;
+import org.apache.lucene.facet.search.FacetsCollector;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
import org.apache.lucene.facet.taxonomy.TaxonomyWriter;
@@ -31,7 +35,6 @@ import org.apache.lucene.search.MatchAllDocsQuery;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.MockDirectoryWrapper;
import org.apache.lucene.util.IOUtils;
-import org.apache.lucene.util.SlowRAMDirectory;
import org.apache.lucene.util._TestUtil;
import org.junit.Before;
import org.junit.Test;
diff --git a/lucene/facet/src/test/org/apache/lucene/util/encoding/EncodingSpeed.java b/lucene/facet/src/test/org/apache/lucene/facet/encoding/EncodingSpeed.java
similarity index 98%
rename from lucene/facet/src/test/org/apache/lucene/util/encoding/EncodingSpeed.java
rename to lucene/facet/src/test/org/apache/lucene/facet/encoding/EncodingSpeed.java
index 9b34bdac834..dee37ea39fa 100644
--- a/lucene/facet/src/test/org/apache/lucene/util/encoding/EncodingSpeed.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/encoding/EncodingSpeed.java
@@ -1,10 +1,20 @@
-package org.apache.lucene.util.encoding;
+package org.apache.lucene.facet.encoding;
import java.io.IOException;
import java.text.NumberFormat;
import java.util.Arrays;
import java.util.Locale;
+import org.apache.lucene.facet.encoding.DGapIntEncoder;
+import org.apache.lucene.facet.encoding.DGapVInt8IntEncoder;
+import org.apache.lucene.facet.encoding.EightFlagsIntEncoder;
+import org.apache.lucene.facet.encoding.FourFlagsIntEncoder;
+import org.apache.lucene.facet.encoding.IntDecoder;
+import org.apache.lucene.facet.encoding.IntEncoder;
+import org.apache.lucene.facet.encoding.NOnesIntEncoder;
+import org.apache.lucene.facet.encoding.SortingIntEncoder;
+import org.apache.lucene.facet.encoding.UniqueValuesIntEncoder;
+import org.apache.lucene.facet.encoding.VInt8IntEncoder;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.IntsRef;
diff --git a/lucene/facet/src/test/org/apache/lucene/util/encoding/EncodingTest.java b/lucene/facet/src/test/org/apache/lucene/facet/encoding/EncodingTest.java
similarity index 90%
rename from lucene/facet/src/test/org/apache/lucene/util/encoding/EncodingTest.java
rename to lucene/facet/src/test/org/apache/lucene/facet/encoding/EncodingTest.java
index 6383beaec0b..77521f83561 100644
--- a/lucene/facet/src/test/org/apache/lucene/util/encoding/EncodingTest.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/encoding/EncodingTest.java
@@ -1,9 +1,20 @@
-package org.apache.lucene.util.encoding;
+package org.apache.lucene.facet.encoding;
import java.io.IOException;
import java.util.Arrays;
import org.apache.lucene.facet.FacetTestCase;
+import org.apache.lucene.facet.encoding.DGapIntEncoder;
+import org.apache.lucene.facet.encoding.DGapVInt8IntEncoder;
+import org.apache.lucene.facet.encoding.EightFlagsIntEncoder;
+import org.apache.lucene.facet.encoding.FourFlagsIntEncoder;
+import org.apache.lucene.facet.encoding.IntDecoder;
+import org.apache.lucene.facet.encoding.IntEncoder;
+import org.apache.lucene.facet.encoding.NOnesIntEncoder;
+import org.apache.lucene.facet.encoding.SimpleIntEncoder;
+import org.apache.lucene.facet.encoding.SortingIntEncoder;
+import org.apache.lucene.facet.encoding.UniqueValuesIntEncoder;
+import org.apache.lucene.facet.encoding.VInt8IntEncoder;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.IntsRef;
import org.junit.BeforeClass;
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/index/params/CategoryListParamsTest.java b/lucene/facet/src/test/org/apache/lucene/facet/params/CategoryListParamsTest.java
similarity index 90%
rename from lucene/facet/src/test/org/apache/lucene/facet/index/params/CategoryListParamsTest.java
rename to lucene/facet/src/test/org/apache/lucene/facet/params/CategoryListParamsTest.java
index 49378e40672..6fe71c218aa 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/index/params/CategoryListParamsTest.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/params/CategoryListParamsTest.java
@@ -1,11 +1,12 @@
-package org.apache.lucene.facet.index.params;
+package org.apache.lucene.facet.params;
import org.apache.lucene.facet.FacetTestCase;
-import org.apache.lucene.util.encoding.DGapVInt8IntEncoder;
-import org.apache.lucene.util.encoding.IntDecoder;
-import org.apache.lucene.util.encoding.IntEncoder;
-import org.apache.lucene.util.encoding.SortingIntEncoder;
-import org.apache.lucene.util.encoding.UniqueValuesIntEncoder;
+import org.apache.lucene.facet.encoding.DGapVInt8IntEncoder;
+import org.apache.lucene.facet.encoding.IntDecoder;
+import org.apache.lucene.facet.encoding.IntEncoder;
+import org.apache.lucene.facet.encoding.SortingIntEncoder;
+import org.apache.lucene.facet.encoding.UniqueValuesIntEncoder;
+import org.apache.lucene.facet.params.CategoryListParams;
import org.junit.Test;
/*
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/index/params/FacetIndexingParamsTest.java b/lucene/facet/src/test/org/apache/lucene/facet/params/FacetIndexingParamsTest.java
similarity index 95%
rename from lucene/facet/src/test/org/apache/lucene/facet/index/params/FacetIndexingParamsTest.java
rename to lucene/facet/src/test/org/apache/lucene/facet/params/FacetIndexingParamsTest.java
index f24fec84283..3f58bb509a3 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/index/params/FacetIndexingParamsTest.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/params/FacetIndexingParamsTest.java
@@ -1,6 +1,8 @@
-package org.apache.lucene.facet.index.params;
+package org.apache.lucene.facet.params;
import org.apache.lucene.facet.FacetTestCase;
+import org.apache.lucene.facet.params.CategoryListParams;
+import org.apache.lucene.facet.params.FacetIndexingParams;
import org.apache.lucene.facet.search.DrillDown;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.facet.util.PartitionsUtils;
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/search/params/FacetSearchParamsTest.java b/lucene/facet/src/test/org/apache/lucene/facet/params/FacetSearchParamsTest.java
similarity index 92%
rename from lucene/facet/src/test/org/apache/lucene/facet/search/params/FacetSearchParamsTest.java
rename to lucene/facet/src/test/org/apache/lucene/facet/params/FacetSearchParamsTest.java
index e75d1766ba6..d0fba739d35 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/search/params/FacetSearchParamsTest.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/params/FacetSearchParamsTest.java
@@ -1,6 +1,7 @@
-package org.apache.lucene.facet.search.params;
+package org.apache.lucene.facet.params;
import org.apache.lucene.facet.FacetTestCase;
+import org.apache.lucene.facet.params.FacetSearchParams;
import org.junit.Test;
/*
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/index/params/PerDimensionIndexingParamsTest.java b/lucene/facet/src/test/org/apache/lucene/facet/params/PerDimensionIndexingParamsTest.java
similarity index 93%
rename from lucene/facet/src/test/org/apache/lucene/facet/index/params/PerDimensionIndexingParamsTest.java
rename to lucene/facet/src/test/org/apache/lucene/facet/params/PerDimensionIndexingParamsTest.java
index ef8ec97b336..62d9cfe76ac 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/index/params/PerDimensionIndexingParamsTest.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/params/PerDimensionIndexingParamsTest.java
@@ -1,8 +1,11 @@
-package org.apache.lucene.facet.index.params;
+package org.apache.lucene.facet.params;
import java.util.Collections;
import org.apache.lucene.facet.FacetTestCase;
+import org.apache.lucene.facet.params.CategoryListParams;
+import org.apache.lucene.facet.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.PerDimensionIndexingParams;
import org.apache.lucene.facet.search.DrillDown;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.facet.util.PartitionsUtils;
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/search/sampling/BaseSampleTestTopK.java b/lucene/facet/src/test/org/apache/lucene/facet/sampling/BaseSampleTestTopK.java
similarity index 91%
rename from lucene/facet/src/test/org/apache/lucene/facet/search/sampling/BaseSampleTestTopK.java
rename to lucene/facet/src/test/org/apache/lucene/facet/sampling/BaseSampleTestTopK.java
index d10ce54ac68..8214160e0d7 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/search/sampling/BaseSampleTestTopK.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/sampling/BaseSampleTestTopK.java
@@ -1,16 +1,20 @@
-package org.apache.lucene.facet.search.sampling;
+package org.apache.lucene.facet.sampling;
import java.util.List;
import java.util.Random;
-import org.apache.lucene.facet.index.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.FacetSearchParams;
+import org.apache.lucene.facet.sampling.RandomSampler;
+import org.apache.lucene.facet.sampling.RepeatableSampler;
+import org.apache.lucene.facet.sampling.Sampler;
+import org.apache.lucene.facet.sampling.SamplingParams;
import org.apache.lucene.facet.search.BaseTestTopK;
+import org.apache.lucene.facet.search.FacetRequest;
+import org.apache.lucene.facet.search.FacetResult;
import org.apache.lucene.facet.search.FacetsCollector;
import org.apache.lucene.facet.search.StandardFacetsAccumulator;
-import org.apache.lucene.facet.search.params.FacetRequest;
-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.FacetRequest.ResultMode;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.Term;
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/search/sampling/OversampleWithDepthTest.java b/lucene/facet/src/test/org/apache/lucene/facet/sampling/OversampleWithDepthTest.java
similarity index 88%
rename from lucene/facet/src/test/org/apache/lucene/facet/search/sampling/OversampleWithDepthTest.java
rename to lucene/facet/src/test/org/apache/lucene/facet/sampling/OversampleWithDepthTest.java
index 9f51a0d0512..3a3bdd4f92b 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/search/sampling/OversampleWithDepthTest.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/sampling/OversampleWithDepthTest.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.facet.search.sampling;
+package org.apache.lucene.facet.sampling;
import java.io.IOException;
import java.util.Collections;
@@ -6,15 +6,19 @@ import java.util.Collections;
import org.apache.lucene.document.Document;
import org.apache.lucene.facet.FacetTestCase;
import org.apache.lucene.facet.index.FacetFields;
-import org.apache.lucene.facet.index.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.FacetSearchParams;
+import org.apache.lucene.facet.sampling.RandomSampler;
+import org.apache.lucene.facet.sampling.Sampler;
+import org.apache.lucene.facet.sampling.SamplingAccumulator;
+import org.apache.lucene.facet.sampling.SamplingParams;
+import org.apache.lucene.facet.search.CountFacetRequest;
+import org.apache.lucene.facet.search.FacetRequest;
+import org.apache.lucene.facet.search.FacetResult;
+import org.apache.lucene.facet.search.FacetResultNode;
import org.apache.lucene.facet.search.FacetsCollector;
import org.apache.lucene.facet.search.StandardFacetsAccumulator;
-import org.apache.lucene.facet.search.params.CountFacetRequest;
-import org.apache.lucene.facet.search.params.FacetRequest;
-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.search.FacetRequest.ResultMode;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
import org.apache.lucene.facet.taxonomy.TaxonomyWriter;
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/search/sampling/SamplingAccumulatorTest.java b/lucene/facet/src/test/org/apache/lucene/facet/sampling/SamplingAccumulatorTest.java
similarity index 86%
rename from lucene/facet/src/test/org/apache/lucene/facet/search/sampling/SamplingAccumulatorTest.java
rename to lucene/facet/src/test/org/apache/lucene/facet/sampling/SamplingAccumulatorTest.java
index 621a29230e4..995090437bc 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/search/sampling/SamplingAccumulatorTest.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/sampling/SamplingAccumulatorTest.java
@@ -1,7 +1,9 @@
-package org.apache.lucene.facet.search.sampling;
+package org.apache.lucene.facet.sampling;
+import org.apache.lucene.facet.params.FacetSearchParams;
+import org.apache.lucene.facet.sampling.Sampler;
+import org.apache.lucene.facet.sampling.SamplingAccumulator;
import org.apache.lucene.facet.search.StandardFacetsAccumulator;
-import org.apache.lucene.facet.search.params.FacetSearchParams;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.util.LuceneTestCase.Slow;
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/search/SamplingWrapperTest.java b/lucene/facet/src/test/org/apache/lucene/facet/sampling/SamplingWrapperTest.java
similarity index 83%
rename from lucene/facet/src/test/org/apache/lucene/facet/search/SamplingWrapperTest.java
rename to lucene/facet/src/test/org/apache/lucene/facet/sampling/SamplingWrapperTest.java
index 058e664804e..4eddb07c6bb 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/search/SamplingWrapperTest.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/sampling/SamplingWrapperTest.java
@@ -1,11 +1,12 @@
-package org.apache.lucene.facet.search;
+package org.apache.lucene.facet.sampling;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.util.LuceneTestCase.Slow;
-import org.apache.lucene.facet.search.params.FacetSearchParams;
-import org.apache.lucene.facet.search.sampling.BaseSampleTestTopK;
-import org.apache.lucene.facet.search.sampling.Sampler;
+import org.apache.lucene.facet.params.FacetSearchParams;
+import org.apache.lucene.facet.sampling.Sampler;
+import org.apache.lucene.facet.sampling.SamplingWrapper;
+import org.apache.lucene.facet.search.StandardFacetsAccumulator;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
/*
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/search/AdaptiveAccumulatorTest.java b/lucene/facet/src/test/org/apache/lucene/facet/search/AdaptiveAccumulatorTest.java
index 8775052ed3a..15bce9c2e5e 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/search/AdaptiveAccumulatorTest.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/search/AdaptiveAccumulatorTest.java
@@ -3,9 +3,9 @@ package org.apache.lucene.facet.search;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.util.LuceneTestCase.Slow;
-import org.apache.lucene.facet.search.params.FacetSearchParams;
-import org.apache.lucene.facet.search.sampling.BaseSampleTestTopK;
-import org.apache.lucene.facet.search.sampling.Sampler;
+import org.apache.lucene.facet.params.FacetSearchParams;
+import org.apache.lucene.facet.sampling.BaseSampleTestTopK;
+import org.apache.lucene.facet.sampling.Sampler;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
/*
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/search/BaseTestTopK.java b/lucene/facet/src/test/org/apache/lucene/facet/search/BaseTestTopK.java
index f9f58d9b879..e7176470558 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/search/BaseTestTopK.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/search/BaseTestTopK.java
@@ -11,10 +11,8 @@ import org.apache.lucene.util._TestUtil;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.facet.FacetTestBase;
-import org.apache.lucene.facet.index.params.FacetIndexingParams;
-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.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.FacetSearchParams;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.facet.taxonomy.TaxonomyWriter;
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/search/CategoryListIteratorTest.java b/lucene/facet/src/test/org/apache/lucene/facet/search/CategoryListIteratorTest.java
index a8d9d8bceef..e4fbc3eeb38 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/search/CategoryListIteratorTest.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/search/CategoryListIteratorTest.java
@@ -8,17 +8,17 @@ import org.apache.lucene.analysis.MockTokenizer;
import org.apache.lucene.document.BinaryDocValuesField;
import org.apache.lucene.document.Document;
import org.apache.lucene.facet.FacetTestCase;
+import org.apache.lucene.facet.encoding.DGapIntEncoder;
+import org.apache.lucene.facet.encoding.IntEncoder;
+import org.apache.lucene.facet.encoding.SortingIntEncoder;
+import org.apache.lucene.facet.encoding.UniqueValuesIntEncoder;
+import org.apache.lucene.facet.encoding.VInt8IntEncoder;
import org.apache.lucene.index.AtomicReaderContext;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.RandomIndexWriter;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.IntsRef;
-import org.apache.lucene.util.encoding.DGapIntEncoder;
-import org.apache.lucene.util.encoding.IntEncoder;
-import org.apache.lucene.util.encoding.SortingIntEncoder;
-import org.apache.lucene.util.encoding.UniqueValuesIntEncoder;
-import org.apache.lucene.util.encoding.VInt8IntEncoder;
import org.junit.Test;
/*
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/search/CountingFacetsAggregatorTest.java b/lucene/facet/src/test/org/apache/lucene/facet/search/CountingFacetsAggregatorTest.java
index 383e66785ec..f009536fbf4 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/search/CountingFacetsAggregatorTest.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/search/CountingFacetsAggregatorTest.java
@@ -14,15 +14,13 @@ import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field.Store;
import org.apache.lucene.document.StringField;
import org.apache.lucene.facet.FacetTestCase;
+import org.apache.lucene.facet.collections.ObjectToIntMap;
import org.apache.lucene.facet.index.FacetFields;
-import org.apache.lucene.facet.index.params.CategoryListParams;
-import org.apache.lucene.facet.index.params.CategoryListParams.OrdinalPolicy;
-import org.apache.lucene.facet.index.params.FacetIndexingParams;
-import org.apache.lucene.facet.index.params.PerDimensionOrdinalPolicy;
-import org.apache.lucene.facet.search.params.CountFacetRequest;
-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.params.CategoryListParams;
+import org.apache.lucene.facet.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.FacetSearchParams;
+import org.apache.lucene.facet.params.PerDimensionOrdinalPolicy;
+import org.apache.lucene.facet.params.CategoryListParams.OrdinalPolicy;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
import org.apache.lucene.facet.taxonomy.TaxonomyWriter;
@@ -39,7 +37,6 @@ import org.apache.lucene.search.MatchAllDocsQuery;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.IOUtils;
-import org.apache.lucene.util.collections.ObjectToIntMap;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/search/DrillDownTest.java b/lucene/facet/src/test/org/apache/lucene/facet/search/DrillDownTest.java
index 16846d64842..1c620485afb 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/search/DrillDownTest.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/search/DrillDownTest.java
@@ -12,9 +12,9 @@ import org.apache.lucene.document.Field;
import org.apache.lucene.document.TextField;
import org.apache.lucene.facet.FacetTestCase;
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.params.CategoryListParams;
+import org.apache.lucene.facet.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.PerDimensionIndexingParams;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.facet.taxonomy.TaxonomyWriter;
import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyReader;
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/search/params/FacetRequestTest.java b/lucene/facet/src/test/org/apache/lucene/facet/search/FacetRequestTest.java
similarity index 94%
rename from lucene/facet/src/test/org/apache/lucene/facet/search/params/FacetRequestTest.java
rename to lucene/facet/src/test/org/apache/lucene/facet/search/FacetRequestTest.java
index 46dabe4471e..c68ca4e5e00 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/search/params/FacetRequestTest.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/search/FacetRequestTest.java
@@ -1,6 +1,7 @@
-package org.apache.lucene.facet.search.params;
+package org.apache.lucene.facet.search;
import org.apache.lucene.facet.FacetTestCase;
+import org.apache.lucene.facet.search.CountFacetRequest;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.junit.Test;
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/search/params/MultiCategoryListIteratorTest.java b/lucene/facet/src/test/org/apache/lucene/facet/search/MultiCategoryListIteratorTest.java
similarity index 95%
rename from lucene/facet/src/test/org/apache/lucene/facet/search/params/MultiCategoryListIteratorTest.java
rename to lucene/facet/src/test/org/apache/lucene/facet/search/MultiCategoryListIteratorTest.java
index 861e607a9df..14ced14f77e 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/search/params/MultiCategoryListIteratorTest.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/search/MultiCategoryListIteratorTest.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.facet.search.params;
+package org.apache.lucene.facet.search;
import java.util.ArrayList;
import java.util.HashMap;
@@ -6,9 +6,10 @@ import java.util.Random;
import org.apache.lucene.document.Document;
import org.apache.lucene.facet.FacetTestCase;
+import org.apache.lucene.facet.encoding.IntDecoder;
import org.apache.lucene.facet.index.FacetFields;
-import org.apache.lucene.facet.index.params.CategoryListParams;
-import org.apache.lucene.facet.index.params.PerDimensionIndexingParams;
+import org.apache.lucene.facet.params.CategoryListParams;
+import org.apache.lucene.facet.params.PerDimensionIndexingParams;
import org.apache.lucene.facet.search.CategoryListIterator;
import org.apache.lucene.facet.search.DocValuesCategoryListIterator;
import org.apache.lucene.facet.taxonomy.CategoryPath;
@@ -23,7 +24,6 @@ import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.IOUtils;
import org.apache.lucene.util.IntsRef;
-import org.apache.lucene.util.encoding.IntDecoder;
import org.junit.Test;
/*
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/search/TestDemoFacets.java b/lucene/facet/src/test/org/apache/lucene/facet/search/TestDemoFacets.java
index 1e402cc096c..ac70655af01 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/search/TestDemoFacets.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/search/TestDemoFacets.java
@@ -27,9 +27,7 @@ import org.apache.lucene.document.Document;
import org.apache.lucene.facet.FacetTestCase;
import org.apache.lucene.facet.FacetTestUtils;
import org.apache.lucene.facet.index.FacetFields;
-import org.apache.lucene.facet.search.params.CountFacetRequest;
-import org.apache.lucene.facet.search.params.FacetSearchParams;
-import org.apache.lucene.facet.search.results.FacetResult;
+import org.apache.lucene.facet.params.FacetSearchParams;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyReader;
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/search/TestFacetsCollector.java b/lucene/facet/src/test/org/apache/lucene/facet/search/TestFacetsCollector.java
index d3682661739..53c51880e7c 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/search/TestFacetsCollector.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/search/TestFacetsCollector.java
@@ -1,6 +1,5 @@
package org.apache.lucene.facet.search;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -13,14 +12,10 @@ import org.apache.lucene.document.Field.Store;
import org.apache.lucene.document.StringField;
import org.apache.lucene.facet.FacetTestCase;
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.FacetsCollector.MatchingDocs;
-import org.apache.lucene.facet.search.params.CountFacetRequest;
-import org.apache.lucene.facet.search.params.FacetSearchParams;
-import org.apache.lucene.facet.search.params.SumScoreFacetRequest;
-import org.apache.lucene.facet.search.results.FacetResult;
+import org.apache.lucene.facet.params.CategoryListParams;
+import org.apache.lucene.facet.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.FacetSearchParams;
+import org.apache.lucene.facet.params.PerDimensionIndexingParams;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.facet.taxonomy.TaxonomyWriter;
import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyReader;
@@ -164,34 +159,14 @@ public class TestFacetsCollector extends FacetTestCase {
new CountFacetRequest(new CategoryPath("a"), 10),
new SumScoreFacetRequest(new CategoryPath("b"), 10));
- final Map<CategoryListParams,FacetsAggregator> clpAggregator = new HashMap<CategoryListParams,FacetsAggregator>();
- clpAggregator.put(fip.getCategoryListParams(new CategoryPath("a")), new FastCountingFacetsAggregator());
- clpAggregator.put(fip.getCategoryListParams(new CategoryPath("b")), new SumScoreFacetsAggregator());
+ Map<CategoryListParams,FacetsAggregator> aggregators = new HashMap<CategoryListParams,FacetsAggregator>();
+ aggregators.put(fip.getCategoryListParams(new CategoryPath("a")), new FastCountingFacetsAggregator());
+ aggregators.put(fip.getCategoryListParams(new CategoryPath("b")), new SumScoreFacetsAggregator());
+ final FacetsAggregator aggregator = new PerCategoryListAggregator(aggregators, fip);
FacetsAccumulator fa = new FacetsAccumulator(sParams, r, taxo) {
@Override
public FacetsAggregator getAggregator() {
- return new FacetsAggregator() {
-
- @Override
- public void rollupValues(int ordinal, int[] children, int[] siblings, FacetArrays facetArrays) {
- throw new UnsupportedOperationException("not supported yet");
- }
-
- @Override
- public boolean requiresDocScores() {
- for (FacetsAggregator aggregator : clpAggregator.values()) {
- if (aggregator.requiresDocScores()) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- public void aggregate(MatchingDocs matchingDocs, CategoryListParams clp, FacetArrays facetArrays) throws IOException {
- clpAggregator.get(clp).aggregate(matchingDocs, clp, facetArrays);
- }
- };
+ return aggregator;
}
};
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/search/TestMultipleCategoryLists.java b/lucene/facet/src/test/org/apache/lucene/facet/search/TestMultipleCategoryLists.java
index b407c05cc61..b69c43381b9 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/search/TestMultipleCategoryLists.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/search/TestMultipleCategoryLists.java
@@ -15,15 +15,11 @@ import org.apache.lucene.document.Field;
import org.apache.lucene.document.TextField;
import org.apache.lucene.facet.FacetTestCase;
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.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.params.CategoryListParams;
+import org.apache.lucene.facet.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.FacetSearchParams;
+import org.apache.lucene.facet.params.PerDimensionIndexingParams;
+import org.apache.lucene.facet.search.FacetRequest.ResultMode;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
import org.apache.lucene.facet.taxonomy.TaxonomyWriter;
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/search/TestSameRequestAccumulation.java b/lucene/facet/src/test/org/apache/lucene/facet/search/TestSameRequestAccumulation.java
index 8575d32ca08..83c2859d6a6 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/search/TestSameRequestAccumulation.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/search/TestSameRequestAccumulation.java
@@ -3,11 +3,9 @@ package org.apache.lucene.facet.search;
import java.util.List;
import org.apache.lucene.facet.FacetTestBase;
-import org.apache.lucene.facet.index.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.FacetSearchParams;
import org.apache.lucene.facet.search.FacetsCollector;
-import org.apache.lucene.facet.search.params.CountFacetRequest;
-import org.apache.lucene.facet.search.params.FacetSearchParams;
-import org.apache.lucene.facet.search.results.FacetResult;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.search.MatchAllDocsQuery;
import org.junit.After;
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/search/TestStandardFacetsAccumulator.java b/lucene/facet/src/test/org/apache/lucene/facet/search/TestStandardFacetsAccumulator.java
index 27074764b2b..a348fd38ca0 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/search/TestStandardFacetsAccumulator.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/search/TestStandardFacetsAccumulator.java
@@ -10,13 +10,9 @@ import org.apache.lucene.document.Field.Store;
import org.apache.lucene.document.StringField;
import org.apache.lucene.facet.FacetTestCase;
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.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.results.FacetResult;
-import org.apache.lucene.facet.search.results.FacetResultNode;
+import org.apache.lucene.facet.params.CategoryListParams;
+import org.apache.lucene.facet.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.FacetSearchParams;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.facet.taxonomy.TaxonomyReader;
import org.apache.lucene.facet.taxonomy.TaxonomyWriter;
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/search/TestTopKInEachNodeResultHandler.java b/lucene/facet/src/test/org/apache/lucene/facet/search/TestTopKInEachNodeResultHandler.java
index 7a17bfef307..a192bb43277 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/search/TestTopKInEachNodeResultHandler.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/search/TestTopKInEachNodeResultHandler.java
@@ -11,13 +11,9 @@ import org.apache.lucene.document.Field;
import org.apache.lucene.document.TextField;
import org.apache.lucene.facet.FacetTestCase;
import org.apache.lucene.facet.index.FacetFields;
-import org.apache.lucene.facet.index.params.FacetIndexingParams;
-import org.apache.lucene.facet.search.params.CountFacetRequest;
-import org.apache.lucene.facet.search.params.FacetRequest;
-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.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.FacetSearchParams;
+import org.apache.lucene.facet.search.FacetRequest.ResultMode;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.facet.taxonomy.TaxonomyWriter;
import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyReader;
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/search/TestTopKResultsHandler.java b/lucene/facet/src/test/org/apache/lucene/facet/search/TestTopKResultsHandler.java
index df9f646f5a4..70c03eaf2bd 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/search/TestTopKResultsHandler.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/search/TestTopKResultsHandler.java
@@ -4,14 +4,10 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-import org.apache.lucene.facet.index.params.CategoryListParams.OrdinalPolicy;
-import org.apache.lucene.facet.index.params.FacetIndexingParams;
-import org.apache.lucene.facet.search.params.CountFacetRequest;
-import org.apache.lucene.facet.search.params.FacetRequest;
-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.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.FacetSearchParams;
+import org.apache.lucene.facet.params.CategoryListParams.OrdinalPolicy;
+import org.apache.lucene.facet.search.FacetRequest.ResultMode;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.search.MatchAllDocsQuery;
import org.junit.Test;
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/search/TestTopKResultsHandlerRandom.java b/lucene/facet/src/test/org/apache/lucene/facet/search/TestTopKResultsHandlerRandom.java
index ced4df0c43c..51e673a67c3 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/search/TestTopKResultsHandlerRandom.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/search/TestTopKResultsHandlerRandom.java
@@ -4,10 +4,8 @@ import java.io.IOException;
import java.util.HashMap;
import java.util.List;
-import org.apache.lucene.facet.index.params.FacetIndexingParams;
-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.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.FacetSearchParams;
import org.apache.lucene.search.MatchAllDocsQuery;
import org.apache.lucene.search.Query;
import org.junit.Test;
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyCombined.java b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyCombined.java
index cddee220b51..e7970d2190a 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyCombined.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyCombined.java
@@ -8,6 +8,7 @@ import java.util.Arrays;
import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.lucene.facet.FacetTestCase;
+import org.apache.lucene.facet.SlowRAMDirectory;
import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyReader;
import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter;
import org.apache.lucene.facet.taxonomy.directory.ParallelTaxonomyArrays;
@@ -15,7 +16,6 @@ import org.apache.lucene.store.Directory;
import org.apache.lucene.store.LockObtainFailedException;
import org.apache.lucene.store.RAMDirectory;
import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
-import org.apache.lucene.util.SlowRAMDirectory;
import org.junit.Test;
/*
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/index/OrdinalMappingReaderTest.java b/lucene/facet/src/test/org/apache/lucene/facet/util/OrdinalMappingReaderTest.java
similarity index 93%
rename from lucene/facet/src/test/org/apache/lucene/facet/index/OrdinalMappingReaderTest.java
rename to lucene/facet/src/test/org/apache/lucene/facet/util/OrdinalMappingReaderTest.java
index b224d69140e..7dea42b5e82 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/index/OrdinalMappingReaderTest.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/util/OrdinalMappingReaderTest.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.facet.index;
+package org.apache.lucene.facet.util;
import java.io.IOException;
import java.util.ArrayList;
@@ -8,12 +8,13 @@ import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.analysis.MockTokenizer;
import org.apache.lucene.document.Document;
import org.apache.lucene.facet.FacetTestCase;
-import org.apache.lucene.facet.index.params.FacetIndexingParams;
+import org.apache.lucene.facet.index.FacetFields;
+import org.apache.lucene.facet.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.FacetSearchParams;
+import org.apache.lucene.facet.search.CountFacetRequest;
+import org.apache.lucene.facet.search.FacetResult;
+import org.apache.lucene.facet.search.FacetResultNode;
import org.apache.lucene.facet.search.FacetsCollector;
-import org.apache.lucene.facet.search.params.CountFacetRequest;
-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;
import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyReader;
import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter;
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/index/TestFacetsPayloadMigrationReader.java b/lucene/facet/src/test/org/apache/lucene/facet/util/TestFacetsPayloadMigrationReader.java
similarity index 95%
rename from lucene/facet/src/test/org/apache/lucene/facet/index/TestFacetsPayloadMigrationReader.java
rename to lucene/facet/src/test/org/apache/lucene/facet/util/TestFacetsPayloadMigrationReader.java
index 2fd14d1d36e..71d39082a86 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/index/TestFacetsPayloadMigrationReader.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/util/TestFacetsPayloadMigrationReader.java
@@ -1,4 +1,4 @@
-package org.apache.lucene.facet.index;
+package org.apache.lucene.facet.util;
import java.io.IOException;
import java.util.ArrayList;
@@ -22,24 +22,26 @@ import org.apache.lucene.document.FieldType;
import org.apache.lucene.document.StringField;
import org.apache.lucene.document.TextField;
import org.apache.lucene.facet.FacetTestCase;
-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.index.params.CategoryListParams.OrdinalPolicy;
-import org.apache.lucene.facet.index.params.PerDimensionOrdinalPolicy;
+import org.apache.lucene.facet.index.FacetFields;
+import org.apache.lucene.facet.params.CategoryListParams;
+import org.apache.lucene.facet.params.FacetIndexingParams;
+import org.apache.lucene.facet.params.FacetSearchParams;
+import org.apache.lucene.facet.params.PerDimensionIndexingParams;
+import org.apache.lucene.facet.params.PerDimensionOrdinalPolicy;
+import org.apache.lucene.facet.params.CategoryListParams.OrdinalPolicy;
import org.apache.lucene.facet.search.CategoryListIterator;
+import org.apache.lucene.facet.search.CountFacetRequest;
import org.apache.lucene.facet.search.DrillDown;
+import org.apache.lucene.facet.search.FacetRequest;
+import org.apache.lucene.facet.search.FacetResult;
+import org.apache.lucene.facet.search.FacetResultNode;
import org.apache.lucene.facet.search.FacetsCollector;
-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.results.FacetResult;
-import org.apache.lucene.facet.search.results.FacetResultNode;
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.FacetsPayloadMigrationReader;
import org.apache.lucene.facet.util.PartitionsUtils;
import org.apache.lucene.index.AtomicReader;
import org.apache.lucene.index.AtomicReaderContext;
diff --git a/lucene/facet/src/test/org/apache/lucene/util/UnsafeByteArrayInputStreamTest.java b/lucene/facet/src/test/org/apache/lucene/util/UnsafeByteArrayInputStreamTest.java
deleted file mode 100644
index e88bd22895f..00000000000
--- a/lucene/facet/src/test/org/apache/lucene/util/UnsafeByteArrayInputStreamTest.java
+++ /dev/null
@@ -1,137 +0,0 @@
-package org.apache.lucene.util;
-
-import java.io.IOException;
-import java.util.Arrays;
-
-import org.apache.lucene.facet.FacetTestCase;
-import org.junit.Test;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-public class UnsafeByteArrayInputStreamTest extends FacetTestCase {
-
- @Test
- public void testSimple() throws IOException {
- int length = 256;
- byte[] buffer = new byte[length];
- for (int i = 0; i < length; ++i) {
- buffer[i] = (byte) i;
- }
- byte[] result = new byte[buffer.length];
- UnsafeByteArrayInputStream ubais = new UnsafeByteArrayInputStream(buffer);
-
- int index = 0;
- int by = ubais.read();
- while (by >= 0) {
- result[index++] = (byte) (by);
- by = ubais.read();
- }
-
- assertEquals(length, index);
- assertTrue(Arrays.equals(buffer, result));
- }
-
- @Test
- public void testStartPos() throws IOException {
- int length = 100;
- byte[] buffer = new byte[length];
- for (int i = 0; i < length; ++i) {
- buffer[i] = (byte) i;
- }
- int startPos = 5;
- byte[] result = new byte[buffer.length];
- UnsafeByteArrayInputStream ubais = new UnsafeByteArrayInputStream(buffer, startPos, length);
-
- int index = 0;
- int by = ubais.read();
- while (by >= 0) {
- result[index++] = (byte) (by);
- by = ubais.read();
- }
-
- assertEquals(length - startPos, index);
- for (int i = startPos; i < length; i++) {
- assertEquals(buffer[i], result[i - startPos]);
- }
- }
-
- @Test
- public void testReinit() throws IOException {
- int length = 100;
- byte[] buffer = new byte[length];
- for (int i = 0; i < length; ++i) {
- buffer[i] = (byte) i;
- }
- byte[] result = new byte[buffer.length];
- UnsafeByteArrayInputStream ubais = new UnsafeByteArrayInputStream(buffer);
-
- int index = 0;
- int by = ubais.read();
- while (by >= 0) {
- result[index++] = (byte) (by);
- by = ubais.read();
- }
-
- assertEquals(length, index);
- assertTrue(Arrays.equals(buffer, result));
-
- int length2 = 50;
- byte[] buffer2 = new byte[length2];
- for (int i = 0; i < length2; ++i) {
- buffer2[i] = (byte) (90 + i);
- }
- byte[] result2 = new byte[buffer2.length];
- ubais.reInit(buffer2);
-
- int index2 = 0;
- int by2 = ubais.read();
- while (by2 >= 0) {
- result2[index2++] = (byte) (by2);
- by2 = ubais.read();
- }
-
- assertEquals(length2, index2);
- assertTrue(Arrays.equals(buffer2, result2));
- }
-
- @Test
- public void testDefaultCtor() throws Exception {
- UnsafeByteArrayInputStream ubais = new UnsafeByteArrayInputStream();
- assertEquals(0, ubais.available());
- assertEquals(-1, ubais.read());
- }
-
- @Test
- public void testMark() throws Exception {
- byte[] bytes = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
- UnsafeByteArrayInputStream ubais = new UnsafeByteArrayInputStream(bytes);
- assertTrue(ubais.markSupported());
- int markIndex = 3;
- // Advance the index
- for (int i = 0; i < markIndex; i++) {
- ubais.read();
- }
- ubais.mark(markIndex);
- for (int i = markIndex; i < bytes.length; i++) {
- ubais.read();
- }
- ubais.reset();
- assertEquals(bytes.length - markIndex, ubais.available());
- }
-
-}
diff --git a/lucene/facet/src/test/org/apache/lucene/util/UnsafeByteArrayOutputStreamTest.java b/lucene/facet/src/test/org/apache/lucene/util/UnsafeByteArrayOutputStreamTest.java
deleted file mode 100644
index b7af76aa2f6..00000000000
--- a/lucene/facet/src/test/org/apache/lucene/util/UnsafeByteArrayOutputStreamTest.java
+++ /dev/null
@@ -1,209 +0,0 @@
-package org.apache.lucene.util;
-
-import java.io.IOException;
-
-import org.apache.lucene.facet.FacetTestCase;
-import org.junit.Test;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-public class UnsafeByteArrayOutputStreamTest extends FacetTestCase {
-
- @Test
- public void testSimpleWrite() throws IOException {
- int length = 100;
- byte[] buffer = new byte[length];
- UnsafeByteArrayOutputStream ubaos = new UnsafeByteArrayOutputStream(buffer);
-
- for (int i = 0; i < 100; i++) {
- ubaos.write((byte) i);
- }
-
- byte[] result = ubaos.toByteArray();
-
- assertEquals(length, ubaos.length());
-
- for (int j = 0; j < length; ++j) {
- assertEquals(result[j], j);
- }
- }
-
- @Test
- public void testArrayWrite() throws IOException {
- int length = 100;
- byte[] buffer = new byte[length];
- UnsafeByteArrayOutputStream ubaos = new UnsafeByteArrayOutputStream(buffer);
-
- for (int i = 0; i < 100; i++) {
- ubaos.write((byte) i);
- }
-
- int length2 = 10;
- byte[] buffer2 = new byte[length2];
- for (int i = 0; i < length2; i++) {
- buffer2[i] = (byte) (8 + i);
- }
-
- ubaos.write(buffer2);
-
- byte[] result = ubaos.toByteArray();
-
- assertEquals(length + length2, ubaos.length());
-
- for (int j = 0; j < length; ++j) {
- assertEquals(result[j], j);
- }
- for (int j = 0; j < length2; ++j) {
- assertEquals(result[j + length], buffer2[j]);
- }
- }
-
- @Test
- public void testArrayWriteStartNotZero() throws IOException {
- int length = 100;
- byte[] buffer = new byte[length];
- UnsafeByteArrayOutputStream ubaos = new UnsafeByteArrayOutputStream(buffer);
-
- for (int i = 0; i < 100; i++) {
- ubaos.write((byte) i);
- }
-
- int length2 = 1000;
- byte[] buffer2 = new byte[length2];
- for (int i = 0; i < length2; i++) {
- buffer2[i] = (byte) (8 + i);
- }
-
- int length3 = 5;
- int start = 2;
- ubaos.write(buffer2, start, length3);
-
- byte[] result = ubaos.toByteArray();
-
- assertEquals(length + length3, ubaos.length());
-
- for (int j = 0; j < length; ++j) {
- assertEquals(result[j], j);
- }
- for (int j = 0; j < length3; ++j) {
- assertEquals(result[j + length], buffer2[j + start]);
- }
- }
-
- @Test
- public void testBufferGrow() throws IOException {
- int length = 100;
- byte[] buffer = new byte[length / 10];
- UnsafeByteArrayOutputStream ubaos = new UnsafeByteArrayOutputStream(buffer);
-
- for (int i = 0; i < length; i++) {
- ubaos.write((byte) i);
- }
-
- byte[] result = ubaos.toByteArray();
-
- assertEquals(length, ubaos.length());
-
- for (int j = 0; j < length; ++j) {
- assertEquals(result[j], j);
- }
-
- buffer = ubaos.toByteArray();
-
- int length2 = 10;
- byte[] buffer2 = new byte[length2];
- for (int i = 0; i < length2; i++) {
- buffer2[i] = (byte) (8 + i);
- }
-
- ubaos.reInit(buffer2);
- for (int i = 0; i < length2; i++) {
- ubaos.write(7 + i);
- }
-
- byte[] result2 = ubaos.toByteArray();
-
- assertEquals(length2, ubaos.length());
-
- for (int j = 0; j < length2; ++j) {
- assertEquals(result2[j], j + 7);
- }
-
- for (int i = 0; i < length; i++) {
- assertEquals(buffer[i], i);
- }
- }
-
- @Test
- public void testStartPos() throws Exception {
- byte[] buf = new byte[10];
- for (int i = 0; i < buf.length; i++) {
- buf[i] = (byte) i;
- }
-
- int startPos = 3;
- UnsafeByteArrayOutputStream ubaos = new UnsafeByteArrayOutputStream(buf, startPos);
- int numValues = 5;
- for (int i = 0; i < numValues; i++) {
- ubaos.write((i + 1) * 2);
- }
-
- // the length of the buffer should be whatever was written after startPos
- // and before that.
- assertEquals("invalid buffer length", startPos + numValues, ubaos.length());
-
- assertEquals("invalid startPos", startPos, ubaos.getStartPos());
-
- byte[] bytes = ubaos.toByteArray();
- for (int i = 0; i < startPos; i++) {
- assertEquals(i, bytes[i]);
- }
-
- for (int i = startPos, j = 0; j < numValues; i++, j++) {
- assertEquals((j + 1) * 2, bytes[i]);
- }
-
- for (int i = startPos + numValues; i < buf.length; i++) {
- assertEquals(i, bytes[i]);
- }
-
- }
-
- @Test
- public void testDefaultCtor() throws Exception {
- UnsafeByteArrayOutputStream ubaos = new UnsafeByteArrayOutputStream();
- int numValues = 5;
- for (int i = 0; i < numValues; i++) {
- ubaos.write(i);
- }
-
- assertEquals("invalid buffer length", numValues, ubaos.length());
-
- byte[] bytes = ubaos.toByteArray();
- for (int i = 0; i < numValues; i++) {
- assertEquals(i, bytes[i]);
- }
- }
-
- @Test(expected=IllegalArgumentException.class)
- public void testIllegalBufferSize() throws Exception {
- UnsafeByteArrayOutputStream ubaos = new UnsafeByteArrayOutputStream();
- ubaos.reInit(new byte[0]);
- }
-
-}