Skip to content

Commit

Permalink
test: add searchQuery parameter queryString test #1534
Browse files Browse the repository at this point in the history
  • Loading branch information
bamthomas committed Sep 18, 2024
1 parent d44f92c commit d63c291
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void test_size_of_search() throws Exception {
}

@Test
public void test_with_query() throws Exception {
public void test_with_query_body() throws Exception {
indexer.add(TEST_INDEX, createDoc("my_id").with("this is my precious doc")
.with(Pipeline.Type.CORENLP).with(project(TEST_INDEX)).build()); // because default is CORENLP so it should fail as of now
Map<String, Object> properties = Map.of(
Expand All @@ -65,4 +65,20 @@ public void test_with_query() throws Exception {
enqueueFromIndex.call();
assertThat(factory.queues.get("test:queue:nlp")).hasSize(2); // with poison
}

@Test
public void test_with_query_string() throws Exception {
indexer.add(TEST_INDEX, createDoc("my_id").with("this is my precious doc")
.with(Pipeline.Type.CORENLP).with(project(TEST_INDEX)).build()); // because default is CORENLP so it should fail as of now
Map<String, Object> properties = Map.of(
"defaultProject", "test-datashare",
"stages", "ENQUEUEIDX",
"queueName", "test:queue",
"searchQuery", "extractionLevel:0");

MemoryDocumentCollectionFactory<String> factory = new MemoryDocumentCollectionFactory<>();
EnqueueFromIndexTask enqueueFromIndex = new EnqueueFromIndexTask(factory, indexer, new Task<>(EnqueueFromIndexTask.class.getName(), new User("test"), properties), null);
enqueueFromIndex.call();
assertThat(factory.queues.get("test:queue:nlp")).hasSize(2); // with poison
}
}

0 comments on commit d63c291

Please sign in to comment.