Hazelcast - 在对象字段上建立索引/属性

Hazelcast - Indexing on object field / property

我想知道这在 Hazelcast 中是否可行。假设我们有一个 Java 实体:

public class BrtWeekDefinitions {

private Long id;
private BrtTimeCharts brtTimeCharts;
private BrtDayDefinitions brtDayDefinitions;
private Long weekDay;
}

并且此实体加载到内存中类型为:Long、BrtWeekDefinitions 的映射中。

BrtTimeCharts 和 BrtDayDefinitions 实体也加载到各自的地图中。

这样可行吗?

//Where mapObject is a map of type <Long,BrtWeekDefinitions>
mapObject.addIndex("BrtTimeCharts.id", false); 
mapObject.addIndex("BrtDayDefinitions.id", false);

或者我必须这样做吗?

//Where mapObject is a map of type <Long,BrtTimeCharts>
mapObject.addIndex("id", false); 

和:

//Where mapObject is a map of type <Long,BrtDayDefinitions>
mapObject.addIndex("id", false); 

阿尔弗雷德·萨拉赫,

这会起作用

//Where mapObject is a map of type <Long,BrtWeekDefinitions>
mapObject.addIndex("brtTimeCharts.id", false); // use property name not type
mapObject.addIndex("brtDayDefinitions.id", false);

有关嵌套索引的更多信息here and here

如果您有任何问题,请告诉我。

干杯, 维克