/** * Wraps an LeafReader, mapping ordinals according to the ordinalMap, using * the provided {@link FacetsConfig} which was used to build the wrapped * reader. */ public OrdinalMappingLeafReader(LeafReader in, int[] ordinalMap, FacetsConfig srcConfig) { super(in); this.ordinalMap = ordinalMap; facetsConfig = new InnerFacetsConfig(); facetFields = new HashSet<>(); for (DimConfig dc : srcConfig.getDimConfigs().values()) { facetFields.add(dc.indexFieldName); } // always add the default indexFieldName. This is because FacetsConfig does // not explicitly record dimensions that were indexed under the default // DimConfig, unless they have a custome DimConfig. facetFields.add(FacetsConfig.DEFAULT_DIM_CONFIG.indexFieldName); }
/** * Wraps an LeafReader, mapping ordinals according to the ordinalMap, using * the provided {@link FacetsConfig} which was used to build the wrapped * reader. */ public OrdinalMappingLeafReader(LeafReader in, int[] ordinalMap, FacetsConfig srcConfig) { super(in); this.ordinalMap = ordinalMap; facetsConfig = new InnerFacetsConfig(); facetFields = new HashSet<>(); for (DimConfig dc : srcConfig.getDimConfigs().values()) { facetFields.add(dc.indexFieldName); } // always add the default indexFieldName. This is because FacetsConfig does // not explicitly record dimensions that were indexed under the default // DimConfig, unless they have a custome DimConfig. facetFields.add(FacetsConfig.DEFAULT_DIM_CONFIG.indexFieldName); }
/** Rolls up any single-valued hierarchical dimensions. */ protected void rollup() throws IOException { // Rollup any necessary dims: for(Map.Entry<String,DimConfig> ent : config.getDimConfigs().entrySet()) { String dim = ent.getKey(); DimConfig ft = ent.getValue(); if (ft.hierarchical && ft.multiValued == false) { int dimRootOrd = taxoReader.getOrdinal(new FacetLabel(dim)); assert dimRootOrd > 0; values[dimRootOrd] += rollup(children[dimRootOrd]); } } }
/** Rolls up any single-valued hierarchical dimensions. */ protected void rollup() throws IOException { // Rollup any necessary dims: for(Map.Entry<String,DimConfig> ent : config.getDimConfigs().entrySet()) { String dim = ent.getKey(); DimConfig ft = ent.getValue(); if (ft.hierarchical && ft.multiValued == false) { int dimRootOrd = taxoReader.getOrdinal(new FacetLabel(dim)); // It can be -1 if this field was declared in the // config but never indexed: if (dimRootOrd > 0) { values[dimRootOrd] += rollup(children[dimRootOrd]); } } } }
/** Rolls up any single-valued hierarchical dimensions. */ protected void rollup() throws IOException { // Rollup any necessary dims: int[] children = getChildren(); for(Map.Entry<String,DimConfig> ent : config.getDimConfigs().entrySet()) { String dim = ent.getKey(); DimConfig ft = ent.getValue(); if (ft.hierarchical && ft.multiValued == false) { int dimRootOrd = taxoReader.getOrdinal(new FacetLabel(dim)); assert dimRootOrd > 0; values[dimRootOrd] += rollup(children[dimRootOrd]); } } }
/** Rolls up any single-valued hierarchical dimensions. */ protected void rollup() throws IOException { // Rollup any necessary dims: int[] children = null; for(Map.Entry<String,DimConfig> ent : config.getDimConfigs().entrySet()) { String dim = ent.getKey(); DimConfig ft = ent.getValue(); if (ft.hierarchical && ft.multiValued == false) { int dimRootOrd = taxoReader.getOrdinal(new FacetLabel(dim)); // It can be -1 if this field was declared in the // config but never indexed: if (dimRootOrd > 0) { if (children == null) { // lazy init children = getChildren(); } increment(dimRootOrd, rollup(children[dimRootOrd])); } } } }
private void checkFacetConfig(final String genericFieldName, final String concreteFieldName) { if (facetsConfig.getDimConfigs().containsKey(concreteFieldName)) return; final FieldTypeInterface fieldType = getFieldType(genericFieldName, concreteFieldName);