@Test public void testObjectNestedInArray() { final ArrayField<Object> array = new ArrayField<>("array"); final ArrayField<Object> nestedArray1 = new ArrayField<>("nestedArray"); nestedArray1.add("1"); final EntityObject nestedObject1 = new EntityObject(); final ArrayField<Object> objectArray = new ArrayField<>("nestedArrayInObject"); final EntityObject nestedObject2 = new EntityObject(); nestedObject2.setField(new StringField("nestedKey", "nestedValue")); objectArray.add(nestedObject2); nestedObject1.setField(objectArray); array.add(nestedArray1); array.add(nestedObject1); Entity rootEntity = new Entity( "test" ); rootEntity.setField( array ); final UUID version = UUIDGenerator.newTimeUUID(); EntityUtils.setVersion( rootEntity, version ); final ApplicationScope scope = new ApplicationScopeImpl( createId( "application" ) ); final IndexEdge indexEdge = new IndexEdgeImpl( createId( "source" ), "testEdgeType", SearchEdge.NodeType.SOURCE, 1000 ); final Map<String, Object> entityMap = EntityToMapConverter.convert( scope, indexEdge, rootEntity ); final Set<EntityField> fieldSet = ( Set<EntityField> ) entityMap.get( IndexingUtils.ENTITY_FIELDS ); final List<EntityField> fields = new ArrayList<>(); fields.addAll(fieldSet); assertEquals( 1, fields.size() ); final EntityField field = fields.get( 0 ); final String path = "array.nestedArrayInObject.nestedKey".toLowerCase(); assertEquals( path, field.get( IndexingUtils.FIELD_NAME ) ); }
public static Map<String, Object> convert(ApplicationScope applicationScope, final IndexEdge indexEdge, final Entity entity) { return convert( applicationScope, indexEdge, entity, Optional.absent() ); }
EntityToMapConverter { public static Map<String, Object> convert(ApplicationScope applicationScope, final IndexEdge indexEdge, final Entity entity) { return convert( applicationScope, indexEdge, entity, Optional.absent() ); } }
EntityToMapConverter { public static Map<String, Object> convert(ApplicationScope applicationScope, final IndexEdge indexEdge, final Entity entity) { return convert( applicationScope, indexEdge, entity, Optional.absent() ); }  }
EntityToMapConverter { public static Map<String, Object> convert(ApplicationScope applicationScope, final IndexEdge indexEdge, final Entity entity) { return convert( applicationScope, indexEdge, entity, Optional.absent() ); }  static Map<String, Object> convert(ApplicationScope applicationScope, final IndexEdge indexEdge,
                                              final Entity entity); static Map<String, Object> convert(ApplicationScope applicationScope, final IndexEdge indexEdge,
                                              final Entity entity, Optional<Set<String>> fieldsToIndex); }
EntityToMapConverter { public static Map<String, Object> convert(ApplicationScope applicationScope, final IndexEdge indexEdge, final Entity entity) { return convert( applicationScope, indexEdge, entity, Optional.absent() ); }  static Map<String, Object> convert(ApplicationScope applicationScope, final IndexEdge indexEdge,
                                              final Entity entity); static Map<String, Object> convert(ApplicationScope applicationScope, final IndexEdge indexEdge,
                                              final Entity entity, Optional<Set<String>> fieldsToIndex);  }