/
SearchBackendContext.java
41 lines (35 loc) · 1.94 KB
/
SearchBackendContext.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* Hibernate Search, full-text search for your domain model
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.search.backend.elasticsearch.search.query.impl;
import org.hibernate.search.backend.elasticsearch.search.impl.ElasticsearchSearchContext;
import org.hibernate.search.backend.elasticsearch.search.impl.ElasticsearchSearchIndexesContext;
import org.hibernate.search.backend.elasticsearch.search.projection.impl.ElasticsearchSearchProjection;
import org.hibernate.search.backend.elasticsearch.search.projection.impl.SearchProjectionBackendContext;
import org.hibernate.search.engine.backend.mapping.spi.BackendMappingContext;
import org.hibernate.search.engine.backend.session.spi.BackendSessionContext;
import org.hibernate.search.engine.search.loading.spi.SearchLoadingContextBuilder;
/**
* An interface with knowledge of the backend internals,
* able to create components related to work execution.
* <p>
* Note this interface exists mainly to more cleanly pass information
* from the backend to the various search-related components.
* If we just passed the backend to the various search-related components,
* we would have a cyclic dependency.
* If we passed all the components held by the backend to the various search-related components,
* we would end up with methods with many parameters.
*/
public interface SearchBackendContext {
SearchProjectionBackendContext getSearchProjectionBackendContext();
ElasticsearchSearchContext createSearchContext(BackendMappingContext mappingContext,
ElasticsearchSearchIndexesContext indexes);
<H> ElasticsearchSearchQueryBuilder<H> createSearchQueryBuilder(
ElasticsearchSearchContext searchContext,
BackendSessionContext sessionContext,
SearchLoadingContextBuilder<?, ?, ?> loadingContextBuilder,
ElasticsearchSearchProjection<?, H> rootProjection);
}