public void setPath(String path) { this.path = path; MapperService.SmartNameObjectMapper smart = parseContext.smartObjectMapper(path); if (smart == null) { throw new QueryParsingException( parseContext.index(), "[nested] failed to find nested object under path [" + path + "]"); } childDocumentMapper = smart.docMapper(); nestedObjectMapper = smart.mapper(); if (nestedObjectMapper == null) { throw new QueryParsingException( parseContext.index(), "[nested] failed to find nested object under path [" + path + "]"); } if (!nestedObjectMapper.nested().isNested()) { throw new QueryParsingException( parseContext.index(), "[nested] nested object under path [" + path + "] is not of nested type"); } }