code
docs
tests
This extension allows you to trigger a complete indexing of EntityStores into Index/Query systems.
Table 70. Artifact
Group ID | Artifact ID | Version |
---|---|---|
org.apache.polygene.extensions | org.apache.polygene.extension.reindexer | 3.0.0 |
The Reindexer
is totally under your control and doesn’t kick in automatically in any way or form.
module.services( ReindexerService.class );
It 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.
Reindexer reindexer = serviceFinder.findService( Reindexer.class ).get(); reindexer.reindex();
So, you call reindex()
on the Reindexer
. If you have many reindexers, 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;
entityStates()
, mostly because the
underlying store doesn’t provide a convenient mechanism to iterate
everything.
Additionally, reindexing is not really thread safe, so need to bring the system down while reindexing is happening.