Map<String, Object> mapper = new HashMap(); mapper.put("fullName", fieldMapper.names().fullName()); mapper.put("indexName", fieldMapper.names().indexName()); mapper.put("indexNameClean", fieldMapper.names().indexNameClean());
fieldNames = new HashSet<String>(); fieldNames.add(x.mapper().names().indexName()); } else { if (extractFieldNames == null) {
fieldNames = new HashSet<String>(); fieldNames.add(x.mapper().names().indexName()); } else { if (extractFieldNames == null) {
this.indexFieldName = smartMappers.mapper().names().indexName(); this.fieldDataType = smartMappers.mapper().fieldDataType();
public FacetedDateHistogramCollector(String facetName, String keyFieldName, TimeZoneRounding tzRounding, FacetProcessor internalProcessor, byte[] internalFacetConfig, SearchContext context) throws IOException { super(facetName); this.fieldDataCache = context.fieldDataCache(); this.keyFieldName = keyFieldName; MapperService.SmartNameFieldMappers smartMappers = context .smartFieldMappers(keyFieldName); if (smartMappers == null || !smartMappers.hasMapper()) { throw new FacetPhaseExecutionException(facetName, "No mapping found for field [" + keyFieldName + "]"); } // add type filter if there is exact doc mapper associated with it if (smartMappers.explicitTypeInNameWithDocMapper()) { setFilter(context.filterCache().cache( smartMappers.docMapper().typeFilter())); } keyIndexFieldName = smartMappers.mapper().names().indexName(); keyFieldDataType = smartMappers.mapper().fieldDataType(); InternalCollectorFactory colFactory= new InternalCollectorFactory(facetName, internalProcessor, internalFacetConfig, context); logger.debug("Facet {}: Test running internal facet processor ", facetName); this.internalExampleCollector = colFactory.createInternalCollector(); this.histoProc = new DateHistogramProc(facetName,tzRounding,colFactory); }
@Override protected CacheStatsPerFieldStats nodeOperation(CacheStatsPerFieldStatsRequest nodeStatsRequest) throws ElasticSearchException { List<CacheStatsPerFieldStats.FieldEntry> entries = Lists.newArrayList(); for (IndexService indexService : indicesService) { logger.debug("Starting to analyze index {}",indexService.settingsService().index().name()); FieldDataCache fieldData = indexService.cache().fieldData(); for (DocumentMapper mapper : indexService.mapperService()) { for (FieldMapper fieldMapper : mapper.mappers()) { String field = fieldMapper.names().indexName(); logger.debug("Calculating size for field {}",field); long size = fieldData.sizeInBytes(field); if (size > 0) { logger.debug("Size for field {}: {}",field,size); entries.add(new CacheStatsPerFieldStats.FieldEntry(field,size)); } else logger.debug("Field {} is has no cache. Skipping.",field); } } } return new CacheStatsPerFieldStats(clusterService.localNode(),hostname, System.currentTimeMillis(),entries); }