Origin query
# API
// Semi-native query (can also be classified as a hybrid query, commonly used when customizing Aggregation)
SearchResponse search(LambdaEsQueryWrapper<T> wrapper) throws IOException;
// Standard native query; RequestOptions can be specified
SearchResponse<T> response = client.withTransportOptions(getTransportOptions()).search(searchRequest, entityClass);
2
3
4
5
Friendly Reminder
For scenarios that cannot be resolved using hybrid queries, you can call our provided standard native query method. Both the input parameters and the return values are native to ElasticsearchClient, consistent with using ElasticsearchClient directly. If you need to use ElasticsearchClient in your code, you can simply inject it using the @Autowired annotation. EE has already automatically configured this bean for you.
@Service
public class XxxService{
// Simply inject it where needed
@Autowried
private ElasticsearchClient client;
}
2
3
4
5
6
If you need to customize even the ElasticsearchClient that EE auto-configures, we support that as well, since we have added a @ConditionalOnClass(ElasticsearchClient.class) annotation to the auto-configured class. If you have already configured your own ElasticsearchClient, the framework will use your configuration as the standard. EE provides ultimate flexibility and extensibility, ensuring you can use it with confidence.