Cool that you figured this out. The Reindexer is totally under your control and doesn't kick in automatically in any way or form. We thought of trying to find a way to figure out when/if the index gets out of sync, but concluded that it was too expensive overhead to do this.
Basically, the Reindexer will be bound to the EntityStore that is VIsible, ask for all Entities, by calling entityStates() and forward those to all StateChangeListeners that are Visible. So, you call reindex() on the Reindexer. If you have many reindexer, you could call reindexAll() which will locate all reindexers and call reindex() on each. This is useful when there are many modules of entity stores. There are two general issues that you need to keep in mind; 1. Not all Entity Stores implements entityStates(), mostly because the underlying store doesn't provide a convenient mechanism to iterate everything. 2. Unless you first clear all in the Index, deletions will not be detected, and therefor the index might contain to many entity references in that case. Additionally, reindexing is not really thread safe, so need to bring the system down while reindexing is happening. I hope that clears the smoke. Niclas On Fri, May 27, 2016 at 10:27 AM, zhuangmz08 <[email protected]> wrote: > ReindexerService, I think this is the answer. More over, could I take more > control on reindexing. > > > > > ------------------ Original ------------------ > From: "";<[email protected]>; > Date: Fri, May 27, 2016 09:47 AM > To: "dev"<[email protected]>; > > Subject: entity composite query > > > > Hi, > I'm confused about the index query. > first time : > 1. setup redis entity store server (RedisMapEntityStoreAssembler). > 2. insert two entity composites: A, B. > 3. remain running the redis server. > second time: > 1. setup in-memory index query (RdfMemoryStoreAssembler). > 2. insert another two entity composites: C, D. > 3. query all the entities, expected 4 entities found, however, only C & D > are found, A & B are missing. > It seems that A & B are never indexed? How could I reindex the whole > entity store? Or, how could I reindex entity store on specific class type > of entity composite? > Thanks a lot. > -- Niclas Hedhman, Software Developer http://zest.apache.org - New Energy for Java
