Skip to content

Commit

Permalink
Remove/replace _type in tests (elastic#14070)
Browse files Browse the repository at this point in the history
  • Loading branch information
ycombinator authored Oct 15, 2019
1 parent 637b0f9 commit 58bd06d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
6 changes: 3 additions & 3 deletions libbeat/outputs/elasticsearch/api_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func TestIndex(t *testing.T) {
params := map[string]string{
"refresh": "true",
}
_, resp, err := client.Index(index, "test", "1", params, body)
_, resp, err := client.Index(index, "_doc", "1", params, body)
if err != nil {
t.Fatalf("Index() returns error: %s", err)
}
Expand Down Expand Up @@ -78,7 +78,7 @@ func TestIndex(t *testing.T) {
t.Errorf("Wrong number of search results: %d", result.Hits.Total.Value)
}

_, resp, err = client.Delete(index, "test", "1", nil)
_, resp, err = client.Delete(index, "_doc", "1", nil)
if err != nil {
t.Errorf("Delete() returns error: %s", err)
}
Expand Down Expand Up @@ -138,7 +138,7 @@ func TestIngest(t *testing.T) {
}

params := map[string]string{"refresh": "true"}
_, resp, err = client.Ingest(index, "test", pipeline, "1", params, obj{
_, resp, err = client.Ingest(index, "_doc", pipeline, "1", params, obj{
"testfield": "TEST",
})
if err != nil {
Expand Down
11 changes: 3 additions & 8 deletions libbeat/outputs/elasticsearch/bulkapi_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ func TestBulk(t *testing.T) {
{
"index": map[string]interface{}{
"_index": index,
"_type": "type1",
"_id": "1",
},
},
Expand All @@ -54,7 +53,7 @@ func TestBulk(t *testing.T) {
params := map[string]string{
"refresh": "true",
}
_, err := client.Bulk(index, "type1", params, body)
_, err := client.Bulk(index, "", params, body)
if err != nil {
t.Fatalf("Bulk() returned error: %s", err)
}
Expand Down Expand Up @@ -87,7 +86,7 @@ func TestEmptyBulk(t *testing.T) {
params := map[string]string{
"refresh": "true",
}
resp, err := client.Bulk(index, "type1", params, body)
resp, err := client.Bulk(index, "", params, body)
if err != nil {
t.Fatalf("Bulk() returned error: %s", err)
}
Expand All @@ -106,7 +105,6 @@ func TestBulkMoreOperations(t *testing.T) {
{
"index": map[string]interface{}{
"_index": index,
"_type": "type1",
"_id": "1",
},
},
Expand All @@ -117,15 +115,13 @@ func TestBulkMoreOperations(t *testing.T) {
{
"delete": map[string]interface{}{
"_index": index,
"_type": "type1",
"_id": "2",
},
},

{
"create": map[string]interface{}{
"_index": index,
"_type": "type1",
"_id": "3",
},
},
Expand All @@ -137,7 +133,6 @@ func TestBulkMoreOperations(t *testing.T) {
"update": map[string]interface{}{
"_id": "1",
"_index": index,
"_type": "type1",
},
},
{
Expand All @@ -155,7 +150,7 @@ func TestBulkMoreOperations(t *testing.T) {
params := map[string]string{
"refresh": "true",
}
resp, err := client.Bulk(index, "type1", params, body)
resp, err := client.Bulk(index, "", params, body)
if err != nil {
t.Fatalf("Bulk() returned error: %s [%s]", err, resp)
}
Expand Down

0 comments on commit 58bd06d

Please sign in to comment.