Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply dumps changes #515

Merged
merged 1 commit into from
Dec 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .code-samples.meilisearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -562,8 +562,6 @@ landing_getting_started_1: |-
);
post_dump_1: |-
client.createDump();
get_dump_status_1: |-
client.getDumpStatus("20201101-110357260");
phrase_search_1: |-
client.index("movies").search("\"african american\" horror");
sorting_guide_update_sortable_attributes_1: |-
Expand Down
30 changes: 10 additions & 20 deletions src/main/java/com/meilisearch/sdk/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -159,26 +159,16 @@ public TaskInfo deleteIndex(String uid) throws MeilisearchException {
return this.indexesHandler.delete(uid);
}

// TODO createDump will return a Task in v0.28
// /**
// * Triggers the creation of a Meilisearch dump.
// * https://docs.meilisearch.com/reference/api/dump.html#create-a-dump
// *
// * @return Dump instance
// * @throws MeilisearchException if an error occurs
// */
// public Dump createDump() throws MeilisearchException {
// return this.dumpHandler.createDump();
// }
// /**
// * Creates a dump https://docs.meilisearch.com/reference/api/dump.html#create-a-dump
// *
// * @return Dump object with Meilisearch API response
// * @throws MeilisearchException if an error occurs
// */
// public Dump createDump() throws MeilisearchException {
// return this.meiliSearchHttpRequest.post("/dumps", "", Dump.class);
// }
/**
* Triggers the creation of a Meilisearch dump.
* https://docs.meilisearch.com/reference/api/dump.html#create-a-dump
*
* @return Meilisearch API response as TaskInfo
* @throws MeilisearchException if an error occurs
*/
public TaskInfo createDump() throws MeilisearchException {
return config.httpClient.post("/dumps", "", TaskInfo.class);
}

/**
* Gets the status and availability of a Meilisearch instance
Expand Down
30 changes: 10 additions & 20 deletions src/test/java/com/meilisearch/integration/ClientTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -237,24 +237,14 @@ public void testIndexMethodCallExistingIndexWithPrimaryKey() throws Exception {
assertEquals(primaryKey, index.getPrimaryKey());
}

// /** Test call to create dump */
// TODO rewrite Dump test
// @Test
// public void testCreateDump() throws Exception {
// Dump dump = client.createDump();
// String status = dump.getStatus();

// assertEquals(status, "in_progress");
// }

// /** Test call to get dump status by uid */
// @Test
// public void testGetDumpStatus() throws Exception {
// Dump dump = client.createDump();
// String uid = dump.getUid();
// String status = client.getDumpStatus(uid);

// assertNotNull(status);
// assertNotNull(uid);
// }
/** Test call to create dump */
@Test
public void testCreateDump() throws Exception {
TaskInfo task = client.createDump();
client.waitForTask(task.getTaskUid());
Task dump = client.getTask(task.getTaskUid());

assertEquals(task.getStatus(), "enqueued");
assertEquals("dumpCreation", dump.getType());
}
}