File tree 1 file changed +16
-0
lines changed
src/test/java/org/springframework/data/elasticsearch/core
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -3739,6 +3739,22 @@ void shouldSetIndexedIndexNameProperty() {
3739
3739
assertThat (saved .getIndexedIndexName ()).isEqualTo (indexNameProvider .indexName () + "-indexedindexname" );
3740
3740
}
3741
3741
3742
+ @ Test // #3007
3743
+ @ DisplayName ("should set IndexedIndexName in search result" )
3744
+ void shouldSetIndexedIndexNameInSearchResult () {
3745
+
3746
+ var entity = new IndexedIndexNameEntity ();
3747
+ entity .setId ("42" );
3748
+ entity .setSomeText ("someText" );
3749
+ operations .save (entity );
3750
+
3751
+ var searchHits = operations .search (Query .findAll (), IndexedIndexNameEntity .class );
3752
+
3753
+ assertThat (searchHits .getTotalHits ()).isEqualTo (1 );
3754
+ var foundEntity = searchHits .getSearchHit (0 ).getContent ();
3755
+ assertThat (foundEntity .indexedIndexName ).isEqualTo (indexNameProvider .indexName () + "-indexedindexname" );
3756
+ }
3757
+
3742
3758
@ Test // #1945
3743
3759
@ DisplayName ("should error on sort with unmapped field and default settings" )
3744
3760
void shouldErrorOnSortWithUnmappedFieldAndDefaultSettings () {
You can’t perform that action at this time.
0 commit comments