Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>As detailed in the Hibernate Search guide, section 3.6.1, if you are using annotations (by now the default), the listeners which launch indexing on store are registered by default:</p> <blockquote> <p>Hibernate Search is enabled out of the box when using Hibernate Annotations or Hibernate EntityManager. If, for some reason you need to disable it, set hibernate.search.autoregister_listeners to false.</p> </blockquote> <p>An example on how to turn them on by hand: </p> <pre><code> hibConfiguration.setListener("post-update", new FullTextIndexEventListener()); hibConfiguration.setListener("post-insert", new FullTextIndexEventListener()); hibConfiguration.setListener("post-delete", new FullTextIndexEventListener()); </code></pre> <p>All you need to do is annotate the entities which you want to be indexed with the </p> <pre><code>@Indexed(index = "fulltext") </code></pre> <p>annotation, and then do the fine-grained annotation on the fields, as detailed in the user guide.</p> <p>So you should neither launch indexing by hand when storing, neither relaunch indexing whae the application starts, unless you have entities which have been stored before indexing was enabled.</p> <p>You may get performance problems when you are storing an object which say has an "attachment" and so you are indexing that in the same scope of the transaction which is storing the entity. See here:</p> <p><a href="https://www.hibernate.org/432.html" rel="noreferrer">Hibernate Search and offline text extraction</a></p> <p>for a solution that solves this problem.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload