forked from opensearch-project/ml-commons
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Enhancement] Add schema validation and placeholders to index mappings (
opensearch-project#3240) * feat(index mappings): fetch mappings and version from json file instead of string constants Signed-off-by: Pavan Yekbote <mail2pavanyekbote@gmail.com> * refactor: changing exception being thrown Signed-off-by: Pavan Yekbote <mail2pavanyekbote@gmail.com> * chore: remove unused file Signed-off-by: Pavan Yekbote <mail2pavanyekbote@gmail.com> * chore: fix typo in comment Signed-off-by: Pavan Yekbote <mail2pavanyekbote@gmail.com> * chore: adding new line at the end of files Signed-off-by: Pavan Yekbote <mail2pavanyekbote@gmail.com> * feat: add test cases Signed-off-by: Pavan Yekbote <mail2pavanyekbote@gmail.com> * fix: remove test code Signed-off-by: Pavan Yekbote <mail2pavanyekbote@gmail.com> * fix(test): in main the versions were not updated appropriately Signed-off-by: Pavan Yekbote <mail2pavanyekbote@gmail.com> * refactor: move mapping templates under common module Signed-off-by: Pavan Yekbote <mail2pavanyekbote@gmail.com> * refactor: ensure that conversationindexconstants reference mlindex enums rather than use their own mappings Signed-off-by: Pavan Yekbote <mail2pavanyekbote@gmail.com> * refactor: update comment Signed-off-by: Pavan Yekbote <mail2pavanyekbote@gmail.com> * feat: add enhancements to validate index schema and allow using placeholders Signed-off-by: Pavan Yekbote <mail2pavanyekbote@gmail.com> * refactor: modifying comment Signed-off-by: Pavan Yekbote <mail2pavanyekbote@gmail.com> * test: adding testcase for MLIndex to catch failures before runtime Signed-off-by: Pavan Yekbote <mail2pavanyekbote@gmail.com> * refactor: rename dir from mappings to index-mappings Signed-off-by: Pavan Yekbote <mail2pavanyekbote@gmail.com> * fix: add null checks Signed-off-by: Pavan Yekbote <mail2pavanyekbote@gmail.com> * fix: modify mappin paths for placeholders Signed-off-by: Pavan Yekbote <mail2pavanyekbote@gmail.com> * fix: adding dependencies for testing Signed-off-by: Pavan Yekbote <mail2pavanyekbote@gmail.com> * fix(test): compare json object rather than strings to avoid eol character issue Signed-off-by: Pavan Yekbote <mail2pavanyekbote@gmail.com> * refactor: combine if statements into single check Signed-off-by: Pavan Yekbote <mail2pavanyekbote@gmail.com> * refactoring: null handling + clean code Signed-off-by: Pavan Yekbote <mail2pavanyekbote@gmail.com> * spotless apply Signed-off-by: Pavan Yekbote <mail2pavanyekbote@gmail.com> * tests: adding more UT Signed-off-by: Pavan Yekbote <mail2pavanyekbote@gmail.com> * fix: dependencies to handle jarhell Signed-off-by: Pavan Yekbote <mail2pavanyekbote@gmail.com> * spotless apply Signed-off-by: Pavan Yekbote <mail2pavanyekbote@gmail.com> * refactor: add header and use single instance of mapper Signed-off-by: Pavan Yekbote <mail2pavanyekbote@gmail.com> * fixed: doc syntax Signed-off-by: Pavan Yekbote <mail2pavanyekbote@gmail.com> * refactor: renamed files, efficient loading of resources, better exception handling Signed-off-by: Pavan Yekbote <mail2pavanyekbote@gmail.com> * refactor: cleaner comment Signed-off-by: Pavan Yekbote <mail2pavanyekbote@gmail.com> --------- Signed-off-by: Pavan Yekbote <mail2pavanyekbote@gmail.com>
- Loading branch information
Showing
23 changed files
with
319 additions
and
129 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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
34 changes: 34 additions & 0 deletions
34
common/src/main/resources/index-mappings/placeholders/connector.json
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,34 @@ | ||
{ | ||
"properties": { | ||
"name": { | ||
"type": "text", | ||
"fields": { | ||
"keyword": { | ||
"type": "keyword", | ||
"ignore_above": 256 | ||
} | ||
} | ||
}, | ||
"version": { | ||
"type": "keyword" | ||
}, | ||
"description": { | ||
"type": "text" | ||
}, | ||
"protocol": { | ||
"type": "keyword" | ||
}, | ||
"parameters": { | ||
"type": "flat_object" | ||
}, | ||
"credential": { | ||
"type": "flat_object" | ||
}, | ||
"client_config": { | ||
"type": "flat_object" | ||
}, | ||
"actions": { | ||
"type": "flat_object" | ||
} | ||
} | ||
} |
Oops, something went wrong.