This project has retired. For details please refer to its Attic page.
Reindexer Starter Template for Bootstrap
Overview
javax.json serialization
javax.xml serialization
MessagePack serialization
Memory EntityStore
File EntityStore
Geode EntityStore
Hazelcast EntityStore
JClouds EntityStore
JDBM EntityStore
LevelDB EntityStore
MongoDB EntityStore
Preferences EntityStore
Redis EntityStore
Riak EntityStore
SQL EntityStore
Ehcache Cache
Memcache Cache
ElasticSearch Index/Query
OpenRDF Index/Query
Apache Solr Index/Query
SQL Index/Query
Codahale Metrics
Migration
Reindexer

Reindexer

code

docs

tests

This extension allows you to trigger a complete indexing of EntityStores into Index/Query systems.

Table 71. Artifact

Group IDArtifact IDVersion

org.apache.polygene.extensions

org.apache.polygene.extension.reindexer

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;

  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.