Package org.elasticsearch.index.mapper.selector

Examples of org.elasticsearch.index.mapper.selector.FieldMappersFieldSelector


        // don't load anything
        if (fields.length == 0) {
            return null;
        }

        FieldMappersFieldSelector fieldSelector = null;
        for (String fieldName : fields) {
            FieldMappers x = docMapper.mappers().smartName(fieldName);
            if (x != null && x.mapper().stored()) {
                if (fieldSelector == null) {
                    fieldSelector = new FieldMappersFieldSelector();
                }
                fieldSelector.add(x);
            }
        }

        return fieldSelector;
    }
View Full Code Here


        // don't load the source field in this case, makes little sense to get it with all stored fields
        if (context.fieldNames().get(0).equals("*")) {
            return AllButSourceFieldSelector.INSTANCE;
        }

        FieldMappersFieldSelector fieldSelector = new FieldMappersFieldSelector();
        for (String fieldName : context.fieldNames()) {
            FieldMappers x = context.mapperService().smartNameFieldMappers(fieldName);
            if (x == null) {
                throw new FetchPhaseExecutionException(context, "No mapping for field [" + fieldName + "] in order to load it");
            }
            fieldSelector.add(x);
        }
        fieldSelector.add(UidFieldMapper.NAME);
        return fieldSelector;
    }
View Full Code Here

TOP

Related Classes of org.elasticsearch.index.mapper.selector.FieldMappersFieldSelector

Copyright © 2018 www.massapicom. 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.