Github user mdunker commented on a diff in the pull request:
https://github.com/apache/usergrid/pull/575#discussion_r141455370
--- Diff:
stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
---
@@ -546,38 +550,32 @@ public void update( Entity entity ) throws Exception {
handleWriteUniqueVerifyException( entity, wuve );
}
- if ( !skipIndexingForType( cpEntity.getId().getType() ) ) {
+ if (!skipIndexingForType) {
+ indexEntity(cpEntity, asyncIndex);
+ deIndexOldVersionsOfEntity(cpEntity);
+ }
+ }
- // queue an event to update the new entity
- indexService.queueEntityIndexUpdate( applicationScope,
cpEntity, 0 );
+ private void
indexEntity(org.apache.usergrid.persistence.model.entity.Entity cpEntity,
Boolean async) {
+ // queue an event to update the new entity
+ indexService.queueEntityIndexUpdate( applicationScope, cpEntity, 0
, async);
+ }
- // queue up an event to clean-up older versions than this one
from the index
- if (entityManagerFig.getDeindexOnUpdate()) {
- indexService.queueDeIndexOldVersion( applicationScope,
cpEntity.getId(), cpEntity.getVersion());
- }
+ private void
deIndexOldVersionsOfEntity(org.apache.usergrid.persistence.model.entity.Entity
cpEntity) {
--- End diff --
ok, sounds good
---