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

[Remove] remaining type usage in Client and AbstractClient #2258

Merged
merged 1 commit into from
Feb 25, 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
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void testCustomWordDelimiterQueryString() {
.addMapping("type1", "field1", "type=text,analyzer=my_analyzer", "field2", "type=text,analyzer=my_analyzer")
);

client().prepareIndex("test", "type1", "1").setSource("field1", "foo bar baz", "field2", "not needed").get();
client().prepareIndex("test").setId("1").setSource("field1", "foo bar baz", "field2", "not needed").get();
refresh();

SearchResponse response = client().prepareSearch("test")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public void testNgramHighlightingWithBrokenPositions() throws IOException {
.putList("analysis.analyzer.search_autocomplete.filter", "lowercase", "wordDelimiter")
)
);
client().prepareIndex("test", "test", "1").setSource("name", "ARCOTEL Hotels Deutschland").get();
client().prepareIndex("test").setId("1").setSource("name", "ARCOTEL Hotels Deutschland").get();
refresh();
SearchResponse search = client().prepareSearch("test")
.setQuery(matchQuery("name.autocomplete", "deut tel").operator(Operator.OR))
Expand Down Expand Up @@ -173,7 +173,8 @@ public void testMultiPhraseCutoff() throws IOException {
);

ensureGreen();
client().prepareIndex("test", "test", "1")
client().prepareIndex("test")
.setId("1")
.setSource(
"body",
"Test: http://www.facebook.com http://elasticsearch.org "
Expand Down Expand Up @@ -235,7 +236,7 @@ public void testSynonyms() throws IOException {
);
ensureGreen();

client().prepareIndex("test", "type1", "0").setSource("field1", "The quick brown fox jumps over the lazy dog").get();
client().prepareIndex("test").setId("0").setSource("field1", "The quick brown fox jumps over the lazy dog").get();
refresh();
for (String highlighterType : new String[] { "plain", "fvh", "unified" }) {
logger.info("--> highlighting (type=" + highlighterType + ") and searching on field1");
Expand Down Expand Up @@ -263,10 +264,12 @@ public void testPhrasePrefix() throws IOException {

ensureGreen();

client().prepareIndex("first_test_index", "type1", "0")
client().prepareIndex("first_test_index")
.setId("0")
.setSource("field0", "The quick brown fox jumps over the lazy dog", "field1", "The quick brown fox jumps over the lazy dog")
.get();
client().prepareIndex("first_test_index", "type1", "1")
client().prepareIndex("first_test_index")
.setId("1")
.setSource("field1", "The quick browse button is a fancy thing, right bro?")
.get();
refresh();
Expand Down Expand Up @@ -344,7 +347,8 @@ public void testPhrasePrefix() throws IOException {
)
);
// with synonyms
client().prepareIndex("second_test_index", "doc", "0")
client().prepareIndex("second_test_index")
.setId("0")
.setSource(
"type",
"type2",
Expand All @@ -354,10 +358,11 @@ public void testPhrasePrefix() throws IOException {
"The quick brown fox jumps over the lazy dog"
)
.get();
client().prepareIndex("second_test_index", "doc", "1")
client().prepareIndex("second_test_index")
.setId("1")
.setSource("type", "type2", "field4", "The quick browse button is a fancy thing, right bro?")
.get();
client().prepareIndex("second_test_index", "doc", "2").setSource("type", "type2", "field4", "a quick fast blue car").get();
client().prepareIndex("second_test_index").setId("2").setSource("type", "type2", "field4", "a quick fast blue car").get();
refresh();

source = searchSource().postFilter(termQuery("type", "type2"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,17 @@ public Settings onNodeStopped(String nodeName) {
checkPipelineExists.accept(pipelineIdWithoutScript);
checkPipelineExists.accept(pipelineIdWithScript);

client().prepareIndex("index", "doc", "1")
client().prepareIndex("index")
.setId("1")
.setSource("x", 0)
.setPipeline(pipelineIdWithoutScript)
.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE)
.get();

IllegalStateException exception = expectThrows(
IllegalStateException.class,
() -> client().prepareIndex("index", "doc", "2")
() -> client().prepareIndex("index")
.setId("2")
.setSource("x", 0)
.setPipeline(pipelineIdWithScript)
.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE)
Expand Down Expand Up @@ -236,7 +238,8 @@ public void testPipelineWithScriptProcessorThatHasStoredScript() throws Exceptio
);
client().admin().cluster().preparePutPipeline("_id", pipeline, XContentType.JSON).get();

client().prepareIndex("index", "doc", "1")
client().prepareIndex("index")
.setId("1")
.setSource("x", 0)
.setPipeline("_id")
.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE)
Expand All @@ -254,7 +257,8 @@ public void testPipelineWithScriptProcessorThatHasStoredScript() throws Exceptio
internalCluster().fullRestart();
ensureYellow("index");

client().prepareIndex("index", "doc", "2")
client().prepareIndex("index")
.setId("2")
.setSource("x", 0)
.setPipeline("_id")
.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE)
Expand All @@ -275,7 +279,8 @@ public void testWithDedicatedIngestNode() throws Exception {
);
client().admin().cluster().preparePutPipeline("_id", pipeline, XContentType.JSON).get();

client().prepareIndex("index", "doc", "1")
client().prepareIndex("index")
.setId("1")
.setSource("x", 0)
.setPipeline("_id")
.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE)
Expand All @@ -288,7 +293,8 @@ public void testWithDedicatedIngestNode() throws Exception {
logger.info("Stopping");
internalCluster().restartNode(node, new InternalTestCluster.RestartCallback());

client(ingestNode).prepareIndex("index", "doc", "2")
client(ingestNode).prepareIndex("index")
.setId("2")
.setSource("x", 0)
.setPipeline("_id")
.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE)
Expand Down
Loading