Spring data elasticsearch or java elasticsearch api is better

Hi Team,

I am working for an application. This application does CRUD operations to elasticsearch along with search queries.

I am using spring data elasticsearch repositories/elasticsearchTemplate for CRUD operations.
and I am using native elasticsearch api for search queries.

for Eg:

					.must(QueryBuilders.termsQuery("partId", partIdList))
					.must(QueryBuilders.matchQuery("partTypeId", partTypeId))
					.must(QueryBuilders.matchQuery("facetId", facetId)))

The above search query uses java elasticsearch api but not spring data elasticsearch.

is this the right way to use both spring data elasticsearch(CRUD) and java elasticsearch api(search) in a single application.

if I have to use only spring data elasticsearch alone, is there any way that I can use the methods instead of @query annotation.

Please let me know I am in the right direction, or should I do any modification.


This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.