File tree Expand file tree Collapse file tree 1 file changed +8
-14
lines changed
playground/java/src/main/java/com/algolia/playground Expand file tree Collapse file tree 1 file changed +8
-14
lines changed Original file line number Diff line number Diff line change 10
10
import java .util .concurrent .ExecutionException ;
11
11
12
12
class Actor {
13
+
13
14
String name ;
14
15
15
16
Actor (String name ) {
@@ -36,24 +37,17 @@ public static void main(String[] args) {
36
37
String query = dotenv .get ("SEARCH_QUERY" );
37
38
38
39
try {
39
- List <Actor > records = Arrays .asList (
40
- new Actor ("Tom Cruise" ),
41
- new Actor ("Scarlett Johansson" )
42
- );
43
-
40
+ List <Actor > records = Arrays .asList (new Actor ("Tom Cruise" ), new Actor ("Scarlett Johansson" ));
44
41
45
- List <BatchOperation > batch = new ArrayList <>();
42
+ List <BatchOperation > batch = new ArrayList <>();
46
43
47
- for (Actor record : records ) {
48
- batch .add (new BatchOperation ()
49
- .setAction (Action .ADD_OBJECT )
50
- .setBody (record )
51
- );
52
- }
44
+ for (Actor record : records ) {
45
+ batch .add (new BatchOperation ().setAction (Action .ADD_OBJECT ).setBody (record ));
46
+ }
53
47
54
- BatchResponse response = client .batch (indexName , new BatchWriteParams ().setRequests (batch ));
48
+ BatchResponse response = client .batch (indexName , new BatchWriteParams ().setRequests (batch ));
55
49
56
- client .waitForTask (indexName , response .getTaskID ());
50
+ client .waitForTask (indexName , response .getTaskID ());
57
51
58
52
SearchMethodParams searchMethodParams = new SearchMethodParams ();
59
53
List <SearchQuery > requests = new ArrayList <>();
You can’t perform that action at this time.
0 commit comments