org.hibernate.search.backend.lucene.LuceneExtension Maven / Gradle / Ivy
Show all versions of hibernate-search-backend-lucene Show documentation
/*
* SPDX-License-Identifier: Apache-2.0
* Copyright Red Hat Inc. and Hibernate Authors
*/
package org.hibernate.search.backend.lucene;
import java.lang.invoke.MethodHandles;
import java.util.Optional;
import org.hibernate.search.backend.lucene.logging.impl.Log;
import org.hibernate.search.backend.lucene.schema.management.LuceneIndexSchemaExport;
import org.hibernate.search.backend.lucene.scope.LuceneIndexScope;
import org.hibernate.search.backend.lucene.search.aggregation.dsl.LuceneSearchAggregationFactory;
import org.hibernate.search.backend.lucene.search.predicate.dsl.LuceneSearchPredicateFactory;
import org.hibernate.search.backend.lucene.search.projection.dsl.LuceneSearchProjectionFactory;
import org.hibernate.search.backend.lucene.search.query.LuceneSearchQuery;
import org.hibernate.search.backend.lucene.search.query.dsl.LuceneSearchQuerySelectStep;
import org.hibernate.search.backend.lucene.search.query.dsl.impl.LuceneSearchQuerySelectStepImpl;
import org.hibernate.search.backend.lucene.search.query.impl.LuceneSearchQueryIndexScope;
import org.hibernate.search.backend.lucene.search.sort.dsl.LuceneSearchSortFactory;
import org.hibernate.search.backend.lucene.types.dsl.LuceneIndexFieldTypeFactory;
import org.hibernate.search.engine.backend.scope.IndexScopeExtension;
import org.hibernate.search.engine.backend.scope.spi.IndexScope;
import org.hibernate.search.engine.backend.session.spi.BackendSessionContext;
import org.hibernate.search.engine.backend.types.dsl.IndexFieldTypeFactory;
import org.hibernate.search.engine.backend.types.dsl.IndexFieldTypeFactoryExtension;
import org.hibernate.search.engine.common.schema.management.SchemaExport;
import org.hibernate.search.engine.common.schema.management.SchemaExportExtension;
import org.hibernate.search.engine.search.aggregation.dsl.SearchAggregationFactory;
import org.hibernate.search.engine.search.aggregation.dsl.SearchAggregationFactoryExtension;
import org.hibernate.search.engine.search.loading.spi.SearchLoadingContext;
import org.hibernate.search.engine.search.loading.spi.SearchLoadingContextBuilder;
import org.hibernate.search.engine.search.predicate.dsl.SearchPredicateFactory;
import org.hibernate.search.engine.search.predicate.dsl.SearchPredicateFactoryExtension;
import org.hibernate.search.engine.search.projection.dsl.SearchProjectionFactory;
import org.hibernate.search.engine.search.projection.dsl.SearchProjectionFactoryExtension;
import org.hibernate.search.engine.search.query.SearchQuery;
import org.hibernate.search.engine.search.query.SearchQueryExtension;
import org.hibernate.search.engine.search.query.dsl.SearchQueryDslExtension;
import org.hibernate.search.engine.search.query.dsl.SearchQuerySelectStep;
import org.hibernate.search.engine.search.query.spi.SearchQueryIndexScope;
import org.hibernate.search.engine.search.sort.dsl.SearchSortFactory;
import org.hibernate.search.engine.search.sort.dsl.SearchSortFactoryExtension;
import org.hibernate.search.util.common.logging.impl.LoggerFactory;
/**
* An extension for the Lucene backend, giving access to Lucene-specific features.
*
* WARNING: while this type is API, because instances should be manipulated by users,
* all of its methods are considered SPIs and therefore should never be called directly by users.
* In short, users are only expected to get instances of this type from an API and pass it to another API.
*
* @param The type of query hits.
* Users should not have to care about this, as the parameter will automatically take the appropriate value when calling
* {@code .extension( LuceneExtension.get() )}.
* @param The entity reference type for projections.
* Users should not have to care about this, as the parameter will automatically take the appropriate value when calling
* {@code .extension( LuceneExtension.get() )}.
* @param entity type for projections.
* Users should not have to care about this, as the parameter will automatically take the appropriate value when calling
* {@code .extension( LuceneExtension.get() )}.
* @param The type of the initial step of the loading options definition DSL.
* Users should not have to care about this, as the parameter will automatically take the appropriate value when calling
* {@code .extension( LuceneExtension.get() )}.
*
* @see #get()
*/
public final class LuceneExtension
implements SearchQueryDslExtension, R, E, LOS>,
SearchQueryExtension, H>,
SearchPredicateFactoryExtension,
SearchSortFactoryExtension,
SearchProjectionFactoryExtension, R, E>,
SearchAggregationFactoryExtension,
IndexFieldTypeFactoryExtension,
IndexScopeExtension,
SchemaExportExtension {
private static final Log log = LoggerFactory.make( Log.class, MethodHandles.lookup() );
private static final LuceneExtension