spring-projects / spring-data-elasticsearch

Provide support to increase developer productivity in Java when using Elasticsearch. Uses familiar Spring concepts such as a template classes for core API usage and lightweight repository style data access.
https://spring.io/projects/spring-data-elasticsearch/
Apache License 2.0
2.9k stars 1.33k forks source link

Replacement for Deprecated NativeSearchQueryBuilder in Spring Data Elasticsearch 5.3 #2972

Closed stoneLee81 closed 2 weeks ago

stoneLee81 commented 2 weeks ago

I upgraded from Spring Data Elasticsearch 3.2.6 to Spring Data Elasticsearch 5.3 and found that the NativeSearchQueryBuilder class has been deprecated. I would like to ask which class replaces it?

sothawo commented 2 weeks ago

This was changed in 5.0 with the switch to the new Elasticsearch client library. The new class to use is the NativeQuery which is built using NativeQueryBuilder; as for the syntax to build these native queries you have to check out the Elasticsearch documentation