I run this testcase
Envelope envelope = new Envelope();
envelope.setId("1");
Envelope saved = envelopeRepository.save(envelope);
assertThat(saved.getId()).isEqualTo("1");
saved and envelope are the same object/reference! So even when the index is incorrect, the test still passes! How to fix this issue?
org.elasticsearch.client.RestClient - request [HEAD http://localhost:9200/null?ignore_throttled=false&ignore_unavailable=false&expand_wildcards=open%2Cclosed&allow_no_indices=false]
Why should the saved entity be a new object? Elasticsearch does not return a document when saving, so there is no need to create a new object here.
What Spring Data Elasticsearch does is update this object with the information returned from the index operation:
id
if it was not already set on the object but was created by Elasticsearchseq_no
and primary_term
if the entity has such a propertyIf the indexing fails, an exception is thrown.
What do you mean with
when the index is incorrect
And what has the HEAD request do do with this?