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

Removes usage of mapping types #155

Merged
merged 1 commit into from
Mar 26, 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: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin

buildscript {
ext {
opensearch_version = System.getProperty("opensearch.version", "2.0.0-SNAPSHOT")
opensearch_version = System.getProperty("opensearch.version", "2.0.0-alpha1-SNAPSHOT")
}

repositories {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@

public final class LockService {
private static final Logger logger = LogManager.getLogger(LockService.class);
/**
* This should go away starting ES 7. We use "_doc" for future compatibility as described here:
* https://www.elastic.co/guide/en/elasticsearch/reference/6.x/removal-of-types.html#_schedule_for_removal_of_mapping_types
*/
private static final String MAPPING_TYPE = "_doc";
private static final String LOCK_INDEX_NAME = ".opendistro-job-scheduler-lock";

private final Client client;
Expand Down Expand Up @@ -82,8 +77,7 @@ void createLockIndex(ActionListener<Boolean> listener) {
if (lockIndexExist()) {
listener.onResponse(true);
} else {
final CreateIndexRequest request = new CreateIndexRequest(LOCK_INDEX_NAME)
.mapping(MAPPING_TYPE, lockMapping(), XContentType.JSON);
final CreateIndexRequest request = new CreateIndexRequest(LOCK_INDEX_NAME).mapping(lockMapping());
client.admin().indices().create(request, ActionListener.wrap(
response -> listener.onResponse(response.isAcknowledged()),
exception -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ private Engine.Index getIndexOperation() {
"id_field",
new BytesRef(docId.getBytes(Charset.defaultCharset()), 0, docId.getBytes(Charset.defaultCharset()).length)
);
ParsedDocument parsedDocument = new ParsedDocument(null, null, docId, "_doc", null, docs, source, null, null);
ParsedDocument parsedDocument = new ParsedDocument(null, null, docId, null, docs, source, null, null);

return new Engine.Index(uid, primaryTerm, parsedDocument);
}
Expand All @@ -293,7 +293,7 @@ private Engine.Delete getDeleteOperation(String docId) {
"id_field",
new BytesRef(docId.getBytes(Charset.defaultCharset()), 0, docId.getBytes(Charset.defaultCharset()).length)
);
return new Engine.Delete("_doc", docId, uid, 1L);
return new Engine.Delete(docId, uid, 1L);
}

private BytesReference getTestJsonSource() {
Expand Down