Hibernate.orgCommunity Documentation
Hibernate Search offers access to a Statistics
object via SearchFactory.getStatistics()
. It allows
you for example to determine which classes are indexed and how many entities
are in the index. This information is always available. However, by
specifying the hibernate.search.generate_statistics
property in your configuration you can also collect total and average Lucene
query and object loading timings.
You can also enable access to the statistics via JMX. Setting the
property hibernate.search.jmx_enabled
will
automatically register the StatisticsInfoMBean
.
Depending on your the configuration the
IndexControlMBean
and
IndexingProgressMonitorMBean
will also be
registered. Lets have a closer look at the different MBeans.
If you want to access your JMX beans remotely via JConsole make
sure to set the system property
com.sun.management.jmxremote
to
true
.
This MBean gives you access to Statistics
object as desribed in the previous section.
This MBean allows to build, optimize and purge the index for a
given entity. Indexing occurs via the mass indexing API (seeSection 6.3.2, “Using a MassIndexer”). A requirement for this bean
to be registered in JMX is, that the Hibernate
SessionFactory
is bound to JNDI via the
hibernate.session_factory_name
property. Refer to the
Hibernate Core manual for more information on how to configure JNDI. The
IndexControlMBean
and its API are for now
experimental.
This MBean is an implementation
MassIndexerProgressMonitor
interface. If
hibernate.search.jmx_enabled
is enabled and the mass
indexer API is used the indexing progress can be followed via this bean.
The bean will only be bound to JMX while indexing is in progress. Once
indexing is completed the MBean is not longer available.