Package org.elasticsearch.index.mapper

Examples of org.elasticsearch.index.mapper.FieldMapper.names()


            FieldMapper mapper = mapperService.smartNameFieldMapper(fieldName);
            if (mapper == null) {
                throw new ElasticSearchIllegalArgumentException("No field found for [" + fieldName + "]");
            }
            try {
                fieldData = fieldDataCache.cache(mapper.fieldDataType(), reader, mapper.names().indexName());
            } catch (IOException e) {
                throw new ElasticSearchException("Failed to load field data for [" + fieldName + "]", e);
            }
            localCacheFieldData.put(fieldName, fieldData);
        }
View Full Code Here


        FieldMapper mapper = context.mapperService().smartNameFieldMapper(valueFieldName);
        if (mapper == null) {
            throw new FacetPhaseExecutionException(facetName, "No mapping found for value_field [" + valueFieldName + "]");
        }
        valueIndexFieldName = mapper.names().indexName();
        valueFieldDataType = mapper.fieldDataType();

        this.histoProc = new DateHistogramProc(interval);
    }
View Full Code Here

        for (int i = 0; i < fieldsNames.length; i++) {
            FieldMapper mapper = context.mapperService().smartNameFieldMapper(fieldsNames[i]);
            if (mapper == null) {
                throw new FacetPhaseExecutionException(facetName, "No mapping found for field [" + fieldsNames[i] + "]");
            }
            indexFieldsNames[i] = mapper.names().indexName();
            fieldsDataType[i] = mapper.fieldDataType();
        }
    }

    @Override protected void doCollect(int doc) throws IOException {
View Full Code Here

        if (script == null) {
            FieldMapper fieldMapper = context.mapperService().smartNameFieldMapper(valueFieldName);
            if (fieldMapper == null) {
                throw new ElasticSearchIllegalArgumentException("failed to find mappings for [" + valueFieldName + "]");
            }
            this.valueFieldName = fieldMapper.names().indexName();
            this.valueFieldDataType = fieldMapper.fieldDataType();
            this.script = null;
            this.aggregator = new Aggregator();
        } else {
            this.valueFieldName = null;
View Full Code Here

        String field = null;
        if (request.field() != null) {
            FieldMapper fieldMapper = indexService.mapperService().smartNameFieldMapper(request.field());
            if (fieldMapper != null) {
                analyzer = fieldMapper.indexAnalyzer();
                field = fieldMapper.names().indexName();
            }
        }
        if (field == null) {
            field = "_all";
        }
View Full Code Here

        ifd = new IndexFieldDataService(new Index("test"), new NoneCircuitBreakerService());
        ifd.setIndexService(new StubIndexService(null));

        MapperService mapperService = mock(MapperService.class);
        FieldMapper fieldMapper = mock(FieldMapper.class);
        when(fieldMapper.names()).thenReturn(fieldName());
        when(fieldMapper.fieldDataType()).thenReturn(fieldType());
        when(mapperService.smartNameFieldMapper(anyString(), Matchers.<String[]>any())).thenReturn(fieldMapper);


        IndexFieldData<?> fieldData = ifd.getForField(fieldMapper);
View Full Code Here

            SortOrder sortOrder = new SortOrder(context.reverseFlag, context.nullFirst);
            IndexFieldData.XFieldComparatorSource fieldComparatorSource =
                    searchContext.fieldData().getForField(fieldMapper).comparatorSource(sortOrder.missing(), sortMode);

            return new SortField(
                    fieldMapper.names().indexName(),
                    fieldComparatorSource,
                    context.reverseFlag
            );
        }
View Full Code Here

        FieldMapper mapper = null;
        final String field;
        MapperService.SmartNameFieldMappers smartNameFieldMappers = searchContext.smartFieldMappers(fieldName);
        if (smartNameFieldMappers != null && smartNameFieldMappers.hasMapper()) {
            mapper = smartNameFieldMappers.mapper();
            field = mapper.names().indexName();
        } else {
            field = fieldName;
        }

        if (mapper != null && mapper.useTermQueryWithQueryString() && !forceAnalyzeQueryString()) {
View Full Code Here

            throw new QueryParsingException(parseContext.index(), "field_masking_span must have [field] set for it");
        }

        FieldMapper mapper = parseContext.fieldMapper(field);
        if (mapper != null) {
            field = mapper.names().indexName();
        }

        FieldMaskingSpanQuery query = new FieldMaskingSpanQuery(inner, field);
        query.setBoost(boost);
        if (queryName != null) {
View Full Code Here

    public String indexName(String name) {
        FieldMapper smartMapper = fieldMapper(name);
        if (smartMapper == null) {
            return name;
        }
        return smartMapper.names().indexName();
    }

    public List<String> simpleMatchToIndexNames(String pattern) {
        return indexQueryParser.mapperService.simpleMatchToIndexNames(pattern, getTypes());
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.