在elasticsearch存储库中缓慢保存

时间:2014-05-01 23:02:08

标签: spring elasticsearch

我使用spring-data-elasticsearch(https://github.com/spring-projects/spring-data-elasticsearch),我有两个实体类:

@Document(indexName = "aa", type = "aa", shards = 5, replicas = 1, refreshInterval = "-1", indexStoreType = "memory")
class AA {

     @Id
     private Long Id;

     private BB bb;
     private String field1;

     // ... Many more Fields.

     // ... getters and setters
}

@Document(indexName = "bb", type = "bb", shards = 5, replicas = 1, refreshInterval = "-1", indexStoreType = "memory")
class BB {

     @Id
     private Long Id;

     private BB bbParent;

     // ... Many more Fields.

     // ... getters and setters
}

当我保存到AA存储库

aaRepository.save(aa);

我有一些奇怪的行为:当bbParent为null时,一切都很好,但是当设置bbParent时,保存需要更长时间(> 100倍)。

你有任何提示吗?

0 个答案:

没有答案
相关问题