org.hibernate.search.backend.elasticsearch.ElasticsearchExtension Maven / Gradle / Ivy
Show all versions of hibernate-search-backend-elasticsearch Show documentation
/*
* SPDX-License-Identifier: Apache-2.0
* Copyright Red Hat Inc. and Hibernate Authors
*/
package org.hibernate.search.backend.elasticsearch;
import java.lang.invoke.MethodHandles;
import java.util.Optional;
import org.hibernate.search.backend.elasticsearch.logging.impl.Log;
import org.hibernate.search.backend.elasticsearch.schema.management.ElasticsearchIndexSchemaExport;
import org.hibernate.search.backend.elasticsearch.search.aggregation.dsl.ElasticsearchSearchAggregationFactory;
import org.hibernate.search.backend.elasticsearch.search.predicate.dsl.ElasticsearchSearchPredicateFactory;
import org.hibernate.search.backend.elasticsearch.search.projection.dsl.ElasticsearchSearchProjectionFactory;
import org.hibernate.search.backend.elasticsearch.search.query.ElasticsearchSearchQuery;
import org.hibernate.search.backend.elasticsearch.search.query.dsl.ElasticsearchSearchQuerySelectStep;
import org.hibernate.search.backend.elasticsearch.search.query.dsl.impl.ElasticsearchSearchQuerySelectStepImpl;
import org.hibernate.search.backend.elasticsearch.search.query.impl.ElasticsearchSearchQueryIndexScope;
import org.hibernate.search.backend.elasticsearch.search.sort.dsl.ElasticsearchSearchSortFactory;
import org.hibernate.search.backend.elasticsearch.types.dsl.ElasticsearchIndexFieldTypeFactory;
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 Elasticsearch backend, giving access to Elasticsearch-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( ElasticsearchExtension.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( ElasticsearchExtension.get() }.
* @param The 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( ElasticsearchExtension.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( ElasticsearchExtension.get() }.
*
* @see #get()
*/
public final class ElasticsearchExtension
implements SearchQueryDslExtension, R, E, LOS>,
SearchQueryExtension, H>,
SearchPredicateFactoryExtension,
SearchSortFactoryExtension,
SearchProjectionFactoryExtension, R, E>,
SearchAggregationFactoryExtension,
IndexFieldTypeFactoryExtension,
SchemaExportExtension {
private static final Log log = LoggerFactory.make( Log.class, MethodHandles.lookup() );
private static final ElasticsearchExtension