File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
main/java/org/springframework/data/elasticsearch/core/completion
test/java/org/springframework/data/elasticsearch/core/completion Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 3
3
import java .util .List ;
4
4
import java .util .Map ;
5
5
6
+ import org .springframework .data .annotation .PersistenceConstructor ;
6
7
import org .springframework .lang .Nullable ;
7
8
8
9
/**
@@ -23,6 +24,11 @@ public Completion(String[] input) {
23
24
this .input = input ;
24
25
}
25
26
27
+ @ PersistenceConstructor
28
+ public Completion (List <String > input ) {
29
+ this .input = input .toArray (new String [0 ]);
30
+ }
31
+
26
32
public String [] getInput () {
27
33
return input ;
28
34
}
Original file line number Diff line number Diff line change @@ -87,7 +87,8 @@ private void loadCompletionObjectEntities() {
87
87
indexQueries .add (new CompletionEntityBuilder ("4" ).name ("Artur Konczak" ).suggest (new String [] { "Artur" , "Konczak" })
88
88
.buildIndex ());
89
89
90
- operations .bulkIndex (indexQueries , IndexCoordinates .of ("test-index-core-completion" ).withTypes ("completion-type" ));
90
+ IndexCoordinates index = IndexCoordinates .of ("test-index-core-completion" );
91
+ operations .bulkIndex (indexQueries , index );
91
92
operations .indexOps (CompletionEntity .class ).refresh ();
92
93
}
93
94
@@ -151,6 +152,13 @@ public void shouldFindSuggestionsForGivenCriteriaQueryUsingCompletionEntity() {
151
152
assertThat (options .get (1 ).getText ().string ()).isIn ("Marchand" , "Mohsin" );
152
153
}
153
154
155
+ @ Test // DATAES-754
156
+ void shouldRetrieveEntityWithCompletion () {
157
+ loadCompletionObjectEntities ();
158
+ IndexCoordinates index = IndexCoordinates .of ("test-index-core-completion" );
159
+ operations .get ("1" , CompletionEntity .class , index );
160
+ }
161
+
154
162
@ Test
155
163
public void shouldFindSuggestionsForGivenCriteriaQueryUsingAnnotatedCompletionEntity () {
156
164
You can’t perform that action at this time.
0 commit comments