use of org.hibernate.search.backend.lucene.index.LuceneIndexManager in project hibernate-search by hibernate.
the class LuceneGetAnalyzerIT method fromIndexManager.
@Test
public void fromIndexManager() {
// tag::fromIndexManager[]
// <1>
SearchMapping mapping = Search.mapping(entityManagerFactory);
// <2>
IndexManager indexManager = mapping.indexManager("Book");
// <3>
LuceneIndexManager luceneIndexManager = indexManager.unwrap(LuceneIndexManager.class);
// <4>
Analyzer indexingAnalyzer = luceneIndexManager.indexingAnalyzer();
// <5>
Analyzer searchAnalyzer = luceneIndexManager.searchAnalyzer();
// end::fromIndexManager[]
assertThat(indexingAnalyzer).isNotNull();
assertThat(searchAnalyzer).isNotNull().isNotSameAs(indexingAnalyzer);
}
use of org.hibernate.search.backend.lucene.index.LuceneIndexManager in project hibernate-search by hibernate.
the class LuceneGetIndexSizeIT method computeIndexSize.
@Test
public void computeIndexSize() {
// tag::computeIndexSize[]
// <1>
SearchMapping mapping = Search.mapping(entityManagerFactory);
// <2>
IndexManager indexManager = mapping.indexManager("Book");
// <3>
LuceneIndexManager luceneIndexManager = indexManager.unwrap(LuceneIndexManager.class);
// <4>
long size = luceneIndexManager.computeSizeInBytes();
// <5>
luceneIndexManager.computeSizeInBytesAsync().thenAccept(sizeInBytes -> {
// ...
});
// end::computeIndexSize[]
assertThat(size).isGreaterThanOrEqualTo(0L);
}
Aggregations