Este conteúdo não está disponível no idioma selecionado.

27.2. Configuration


Hibernate Search is configured either in the META-INF/persistence.xml or hibernate.cfg.xml file.
Hibernate Search configuration has sensible defaults for most configuration parameters. The following is an example of a minimal persistence unit configuration:
<persistence-unit name="sample">
  <jta-data-source>java:/DefaultDS</jta-data-source>
  <properties>
    [...]
    <!-- use a file system based index -->
    <property name="hibernate.search.default.directory_provider" 
              value="org.hibernate.search.store.FSDirectoryProvider"/>
    <!-- directory where the indexes will be stored -->
    <property name="hibernate.search.default.indexBase" 
              value="/Users/prod/apps/dvdstore/dvdindexes"/>
  </properties>
</persistence-unit>
Copy to Clipboard Toggle word wrap

Note

When using Hibernate Search 3.1.x, more event listeners are required, but these are registered automatically by Hibernate Annotations. Refer to the Hibernate Search Reference Guide to learn to configure event listeners without using Hibernate EntityManager and Hibernate Annotations.
The following JARs must be deployed alongside the configuration file:
  • hibernate-search.jar
  • hibernate-commons-annotations.jar
  • lucene-core.jar

Note

If you deploy these in an EAR, remember to update application.xml.
Red Hat logoGithubredditYoutubeTwitter

Aprender

Experimente, compre e venda

Comunidades

Sobre a documentação da Red Hat

Ajudamos os usuários da Red Hat a inovar e atingir seus objetivos com nossos produtos e serviços com conteúdo em que podem confiar. Explore nossas atualizações recentes.

Tornando o open source mais inclusivo

A Red Hat está comprometida em substituir a linguagem problemática em nosso código, documentação e propriedades da web. Para mais detalhes veja o Blog da Red Hat.

Sobre a Red Hat

Fornecemos soluções robustas que facilitam o trabalho das empresas em plataformas e ambientes, desde o data center principal até a borda da rede.

Theme

© 2026 Red Hat
Voltar ao topo