mirror of https://github.com/apache/lucene.git
LUCENE-9902 Minor fixes to the faceting API (#62)
This commit is contained in:
parent
be94a667f2
commit
efeea0b8ee
|
@ -290,7 +290,10 @@ Other
|
|||
|
||||
API Changes
|
||||
---------------------
|
||||
(No changes)
|
||||
|
||||
* LUCENE-9902: Change the getValue method from IntTaxonomyFacets to be protected instead of private.
|
||||
Users can now access the count of an ordinal directly without constructing an extra FacetLabel.
|
||||
Also use variable length arguments for the getOrdinal call in TaxonomyReader. (Gautam Worah)
|
||||
|
||||
New Features
|
||||
---------------------
|
||||
|
|
|
@ -88,7 +88,8 @@ public abstract class IntTaxonomyFacets extends TaxonomyFacets {
|
|||
}
|
||||
}
|
||||
|
||||
private int getValue(int ordinal) {
|
||||
/** Get the count for this ordinal. */
|
||||
protected int getValue(int ordinal) {
|
||||
if (sparseValues != null) {
|
||||
return sparseValues.get(ordinal);
|
||||
} else {
|
||||
|
|
|
@ -202,7 +202,7 @@ public abstract class TaxonomyReader implements Closeable {
|
|||
public abstract int getOrdinal(FacetLabel categoryPath) throws IOException;
|
||||
|
||||
/** Returns ordinal for the dim + path. */
|
||||
public int getOrdinal(String dim, String[] path) throws IOException {
|
||||
public int getOrdinal(String dim, String... path) throws IOException {
|
||||
String[] fullPath = new String[path.length + 1];
|
||||
fullPath[0] = dim;
|
||||
System.arraycopy(path, 0, fullPath, 1, path.length);
|
||||
|
|
Loading…
Reference in New Issue