Skip to content

Commit 290c069

Browse files
committed
format
1 parent 162334e commit 290c069

File tree

1 file changed

+8
-14
lines changed
  • playground/java/src/main/java/com/algolia/playground

1 file changed

+8
-14
lines changed

playground/java/src/main/java/com/algolia/playground/Search.java

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import java.util.concurrent.ExecutionException;
1111

1212
class Actor {
13+
1314
String name;
1415

1516
Actor(String name) {
@@ -36,24 +37,17 @@ public static void main(String[] args) {
3637
String query = dotenv.get("SEARCH_QUERY");
3738

3839
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"));
4441

45-
List<BatchOperation> batch = new ArrayList<>();
42+
List<BatchOperation> batch = new ArrayList<>();
4643

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+
}
5347

54-
BatchResponse response = client.batch(indexName, new BatchWriteParams().setRequests(batch));
48+
BatchResponse response = client.batch(indexName, new BatchWriteParams().setRequests(batch));
5549

56-
client.waitForTask(indexName, response.getTaskID());
50+
client.waitForTask(indexName, response.getTaskID());
5751

5852
SearchMethodParams searchMethodParams = new SearchMethodParams();
5953
List<SearchQuery> requests = new ArrayList<>();

0 commit comments

Comments
 (0)