-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Andre Kurait <[email protected]>
- Loading branch information
1 parent
ff52d88
commit 94b5d94
Showing
8 changed files
with
72 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...va/org/opensearch/migrations/transform/JsonTransformerForDocumentTypeRemovalProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package org.opensearch.migrations.transform; | ||
|
||
import java.util.Map; | ||
|
||
/** | ||
* This is a JsonTransformer for doc transforms to remove type. Used for ES7+ and OS | ||
*/ | ||
public class JsonTransformerForDocumentTypeRemovalProvider implements IJsonTransformerProvider { | ||
@Override | ||
public IJsonTransformer createTransformer(Object jsonConfig) { | ||
return new Transformer(); | ||
} | ||
|
||
private static class Transformer implements IJsonTransformer { | ||
@Override | ||
@SuppressWarnings("unchecked") | ||
public Map<String, Object> transformJson(Map<String, Object> incomingJson) { | ||
((Map<String, Object>) incomingJson.get("index")).remove("_type"); | ||
return incomingJson; | ||
} | ||
} | ||
} |
3 changes: 2 additions & 1 deletion
3
.../resources/META-INF/services/org.opensearch.migrations.transform.IJsonTransformerProvider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
org.opensearch.migrations.transform.JsonTransformerForOpenSearch23PlusTargetTransformerProvider | ||
org.opensearch.migrations.transform.JsonTransformerForOpenSearch23PlusTargetTransformerProvider | ||
org.opensearch.migrations.transform.JsonTransformerForDocumentTypeRemovalProvider |