public ObjectMapper getObjectMapper(String name) { return mapperService.getObjectMapper(name); }
@Override public ObjectMapper getObjectMapper(String name) { return mapperService().getObjectMapper(name); }
/** * Returns the parent {@link ObjectMapper} instance of the specified object mapper or <code>null</code> if there * isn't any. */ public ObjectMapper getParentObjectMapper(MapperService mapperService) { int indexOfLastDot = fullPath().lastIndexOf('.'); if (indexOfLastDot != -1) { String parentNestObjectPath = fullPath().substring(0, indexOfLastDot); return mapperService.getObjectMapper(parentNestObjectPath); } else { return null; } }
/** Returns true if a query on the given field might match nested documents. */ boolean mightMatchNestedDocs(String field) { if (field.startsWith("_")) { // meta field. Every meta field behaves differently, eg. nested // documents have the same _uid as their parent, put their path in // the _type field but do not have _field_names. So we just ignore // meta fields and return true, which is always safe, it just means // we might add a nested filter when it is nor required. return true; } if (mapperService.fullName(field) == null) { // field does not exist return false; } for (String parent = parentObject(field); parent != null; parent = parentObject(parent)) { ObjectMapper mapper = mapperService.getObjectMapper(parent); if (mapper != null && mapper.nested().isNested()) { return true; } } return false; }
ObjectMapper mapper = mapperService.getObjectMapper(parentField); String type = mapper.nested().isNested() ? "nested" : "object"; FieldCapabilities fieldCap = new FieldCapabilities(parentField, type, false, false);
/** Returns true if a query on the given field might match parent documents * or documents that are nested under a different path. */ boolean mightMatchNonNestedDocs(String field, String nestedPath) { if (field.startsWith("_")) { // meta field. Every meta field behaves differently, eg. nested // documents have the same _uid as their parent, put their path in // the _type field but do not have _field_names. So we just ignore // meta fields and return true, which is always safe, it just means // we might add a nested filter when it is nor required. return true; } if (mapperService.fullName(field) == null) { return false; } for (String parent = parentObject(field); parent != null; parent = parentObject(parent)) { ObjectMapper mapper = mapperService.getObjectMapper(parent); if (mapper!= null && mapper.nested().isNested()) { if (mapper.fullPath().equals(nestedPath)) { // If the mapper does not include in its parent or in the root object then // the query might only match nested documents with the given path return mapper.nested().isIncludeInParent() || mapper.nested().isIncludeInRoot(); } else { // the first parent nested mapper does not have the expected path // It might be misconfiguration or a sub nested mapper return true; } } } return true; // the field is not a sub field of the nested path }
public ObjectMapper getObjectMapper(String name) { return mapperService.getObjectMapper(name); }
public ObjectMapper getObjectMapper(String name) { return mapperService.getObjectMapper(name); }
public ObjectMapper getObjectMapper(String name) { return mapperService.getObjectMapper(name); }
@Override public ObjectMapper getObjectMapper(String name) { return mapperService().getObjectMapper(name); }
@Override public ObjectMapper getObjectMapper(String name) { return mapperService().getObjectMapper(name); }
@Override public ObjectMapper getObjectMapper(String name) { return mapperService().getObjectMapper(name); }
public ObjectMapper getObjectMapper(String name) { return indexQueryParser.mapperService.getObjectMapper(name, getTypes()); }
/** * Returns the parent {@link ObjectMapper} instance of the specified object mapper or <code>null</code> if there * isn't any. */ public ObjectMapper getParentObjectMapper(MapperService mapperService) { int indexOfLastDot = fullPath().lastIndexOf('.'); if (indexOfLastDot != -1) { String parentNestObjectPath = fullPath().substring(0, indexOfLastDot); return mapperService.getObjectMapper(parentNestObjectPath); } else { return null; } }
/** * Returns the parent {@link ObjectMapper} instance of the specified object mapper or <code>null</code> if there * isn't any. */ public ObjectMapper getParentObjectMapper(MapperService mapperService) { int indexOfLastDot = fullPath().lastIndexOf('.'); if (indexOfLastDot != -1) { String parentNestObjectPath = fullPath().substring(0, indexOfLastDot); return mapperService.getObjectMapper(parentNestObjectPath); } else { return null; } }
@Override public ObjectMapper getObjectMapper(String name) { return mapperService().getObjectMapper(name, request.types()); }
@Override public ObjectMapper getObjectMapper(String name) { if (mapperService() != null) { return mapperService().getObjectMapper(name); } return null; }
/** Returns true if a query on the given field might match nested documents. */ boolean mightMatchNestedDocs(String field) { if (field.startsWith("_")) { // meta field. Every meta field behaves differently, eg. nested // documents have the same _uid as their parent, put their path in // the _type field but do not have _field_names. So we just ignore // meta fields and return true, which is always safe, it just means // we might add a nested filter when it is nor required. return true; } if (mapperService.fullName(field) == null) { // field does not exist return false; } for (String parent = parentObject(field); parent != null; parent = parentObject(parent)) { ObjectMapper mapper = mapperService.getObjectMapper(parent); if (mapper != null && mapper.nested().isNested()) { return true; } } return false; }
/** Returns true if a query on the given field might match nested documents. */ boolean mightMatchNestedDocs(String field) { if (field.startsWith("_")) { // meta field. Every meta field behaves differently, eg. nested // documents have the same _uid as their parent, put their path in // the _type field but do not have _field_names. So we just ignore // meta fields and return true, which is always safe, it just means // we might add a nested filter when it is nor required. return true; } if (mapperService.fullName(field) == null) { // field does not exist return false; } for (String parent = parentObject(field); parent != null; parent = parentObject(parent)) { ObjectMapper mapper = mapperService.getObjectMapper(parent); if (mapper != null && mapper.nested().isNested()) { return true; } } return false; }
/** Returns true if a query on the given field might match parent documents * or documents that are nested under a different path. */ boolean mightMatchNonNestedDocs(String field, String nestedPath) { if (field.startsWith("_")) { // meta field. Every meta field behaves differently, eg. nested // documents have the same _uid as their parent, put their path in // the _type field but do not have _field_names. So we just ignore // meta fields and return true, which is always safe, it just means // we might add a nested filter when it is nor required. return true; } if (mapperService.fullName(field) == null) { return false; } for (String parent = parentObject(field); parent != null; parent = parentObject(parent)) { ObjectMapper mapper = mapperService.getObjectMapper(parent); if (mapper!= null && mapper.nested().isNested()) { if (mapper.fullPath().equals(nestedPath)) { // If the mapper does not include in its parent or in the root object then // the query might only match nested documents with the given path return mapper.nested().isIncludeInParent() || mapper.nested().isIncludeInRoot(); } else { // the first parent nested mapper does not have the expected path // It might be misconfiguration or a sub nested mapper return true; } } } return true; // the field is not a sub field of the nested path }