gsmiller commented on a change in pull request #509:
URL: https://github.com/apache/lucene/pull/509#discussion_r781298004
##########
File path:
lucene/facet/src/java/org/apache/lucene/facet/sortedset/DefaultSortedSetDocValuesReaderState.java
##########
@@ -51,20 +55,42 @@
private final Map<String, OrdinalMap> cachedOrdMaps = new HashMap<>();
+ private final FacetsConfig config;
+
+ /** Used for hierarchical dims. */
+ private final Map<String, DimTree> prefixToDimTree = new HashMap<>();
+
+ /** Used for flat dims. */
private final Map<String, OrdRange> prefixToOrdRange = new HashMap<>();
/**
- * Creates this, pulling doc values from the default {@link
+ * Creates this with a config, pulling doc values from the default {@link
+ * FacetsConfig#DEFAULT_INDEX_FIELD_NAME}.
+ */
+ public DefaultSortedSetDocValuesReaderState(IndexReader reader, FacetsConfig
config)
+ throws IOException {
+ this(reader, FacetsConfig.DEFAULT_INDEX_FIELD_NAME, config);
+ }
+
+ /**
+ * Creates this without a config, pulling doc values from the default {@link
* FacetsConfig#DEFAULT_INDEX_FIELD_NAME}.
*/
public DefaultSortedSetDocValuesReaderState(IndexReader reader) throws
IOException {
- this(reader, FacetsConfig.DEFAULT_INDEX_FIELD_NAME);
+ this(reader, FacetsConfig.DEFAULT_INDEX_FIELD_NAME, null);
}
- /** Creates this, pulling doc values from the specified field. */
+ /** Creates this without a config, pulling doc values from the specified
field. */
public DefaultSortedSetDocValuesReaderState(IndexReader reader, String
field) throws IOException {
+ this(reader, field, null);
+ }
+
+ /** Creates this, pulling doc values from the specified field. */
+ public DefaultSortedSetDocValuesReaderState(IndexReader reader, String
field, FacetsConfig config)
+ throws IOException {
this.field = field;
this.reader = reader;
+ this.config = Objects.requireNonNullElse(config, new FacetsConfig());
Review comment:
OK, thanks. My preference would be to avoid defaulting this entirely so
we retain the difference between "we don't know what the config is for this
dim" vs. "this dim uses default config". But I don't think it's a significant
difference at this point and is easy to change if we need to now that it's
being defaulted internally to these faceting implementations, so I'm good with
what you've done here. Thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]