-
Notifications
You must be signed in to change notification settings - Fork 531
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat:add create index scripts for opensearch
- Loading branch information
Showing
6 changed files
with
520 additions
and
0 deletions.
There are no files selected for viewing
95 changes: 95 additions & 0 deletions
95
launchers/standalone/src/main/resources/db/opensearch/ai_sql_memory.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,95 @@ | ||
{ | ||
"settings": { | ||
"index": { | ||
"number_of_shards": 6, | ||
"number_of_replicas": 2, | ||
"knn": true | ||
}, | ||
"analysis": { | ||
"analyzer": { | ||
"ik_max_word_lowercase_html_strip": { | ||
"filter": [ | ||
"lowercase", | ||
"asciifolding" | ||
], | ||
"char_filter": [ | ||
"html_strip" | ||
], | ||
"tokenizer": "ik_max_word" | ||
} | ||
} | ||
} | ||
}, | ||
"mappings": { | ||
"properties": { | ||
"metadata": { | ||
"type": "object", | ||
"properties": { | ||
"dbSchema": { | ||
"fields": { | ||
"keyword": { | ||
"type": "keyword", | ||
"ignore_above": 256 | ||
} | ||
}, | ||
"type": "text" | ||
}, | ||
"queryId": { | ||
"fields": { | ||
"keyword": { | ||
"type": "keyword", | ||
"ignore_above": 256 | ||
} | ||
}, | ||
"type": "text" | ||
}, | ||
"question": { | ||
"fields": { | ||
"keyword": { | ||
"type": "keyword", | ||
"ignore_above": 256 | ||
} | ||
}, | ||
"type": "text" | ||
}, | ||
"sideInfo": { | ||
"fields": { | ||
"keyword": { | ||
"type": "keyword", | ||
"ignore_above": 256 | ||
} | ||
}, | ||
"type": "text" | ||
}, | ||
"sql": { | ||
"fields": { | ||
"keyword": { | ||
"type": "keyword", | ||
"ignore_above": 256 | ||
} | ||
}, | ||
"type": "text" | ||
} | ||
} | ||
}, | ||
"text": { | ||
"analyzer": "ik_max_word_lowercase_html_strip", | ||
"search_analyzer": "ik_smart", | ||
"type": "text" | ||
}, | ||
"vector": { | ||
"dimension": 512, | ||
"method": { | ||
"engine": "lucene", | ||
"space_type": "cosinesimil", | ||
"name": "hnsw", | ||
"parameters": { | ||
"ef_construction": 100, | ||
"m": 16 | ||
} | ||
}, | ||
"type": "knn_vector" | ||
} | ||
} | ||
} | ||
} |
98 changes: 98 additions & 0 deletions
98
launchers/standalone/src/main/resources/db/opensearch/ai_sql_memory_template.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,98 @@ | ||
{ | ||
"index_patterns": ["ai_sql_memory_*"], | ||
"template": { | ||
"settings": { | ||
"index": { | ||
"number_of_shards": 6, | ||
"number_of_replicas": 2, | ||
"knn": true | ||
}, | ||
"analysis": { | ||
"analyzer": { | ||
"ik_max_word_lowercase_html_strip": { | ||
"filter": [ | ||
"lowercase", | ||
"asciifolding" | ||
], | ||
"char_filter": [ | ||
"html_strip" | ||
], | ||
"tokenizer": "ik_max_word" | ||
} | ||
} | ||
} | ||
}, | ||
"mappings": { | ||
"properties": { | ||
"metadata": { | ||
"type": "object", | ||
"properties": { | ||
"dbSchema": { | ||
"fields": { | ||
"keyword": { | ||
"type": "keyword", | ||
"ignore_above": 256 | ||
} | ||
}, | ||
"type": "text" | ||
}, | ||
"queryId": { | ||
"fields": { | ||
"keyword": { | ||
"type": "keyword", | ||
"ignore_above": 256 | ||
} | ||
}, | ||
"type": "text" | ||
}, | ||
"question": { | ||
"fields": { | ||
"keyword": { | ||
"type": "keyword", | ||
"ignore_above": 256 | ||
} | ||
}, | ||
"type": "text" | ||
}, | ||
"sideInfo": { | ||
"fields": { | ||
"keyword": { | ||
"type": "keyword", | ||
"ignore_above": 256 | ||
} | ||
}, | ||
"type": "text" | ||
}, | ||
"sql": { | ||
"fields": { | ||
"keyword": { | ||
"type": "keyword", | ||
"ignore_above": 256 | ||
} | ||
}, | ||
"type": "text" | ||
} | ||
} | ||
}, | ||
"text": { | ||
"analyzer": "ik_max_word_lowercase_html_strip", | ||
"search_analyzer": "ik_smart", | ||
"type": "text" | ||
}, | ||
"vector": { | ||
"dimension": 512, | ||
"method": { | ||
"engine": "lucene", | ||
"space_type": "cosinesimil", | ||
"name": "hnsw", | ||
"parameters": { | ||
"ef_construction": 100, | ||
"m": 16 | ||
} | ||
}, | ||
"type": "knn_vector" | ||
} | ||
} | ||
} | ||
} | ||
} |
131 changes: 131 additions & 0 deletions
131
launchers/standalone/src/main/resources/db/opensearch/ai_sql_meta_collection.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,131 @@ | ||
{ | ||
"settings": { | ||
"index": { | ||
"number_of_shards": 6, | ||
"number_of_replicas": 2, | ||
"knn": true | ||
}, | ||
"analysis": { | ||
"analyzer": { | ||
"ik_max_word_lowercase_html_strip": { | ||
"filter": [ | ||
"lowercase", | ||
"asciifolding" | ||
], | ||
"char_filter": [ | ||
"html_strip" | ||
], | ||
"tokenizer": "ik_max_word" | ||
} | ||
} | ||
} | ||
}, | ||
"mappings": { | ||
"properties": { | ||
"metadata": { | ||
"type": "object", | ||
"properties": { | ||
"bizName": { | ||
"fields": { | ||
"keyword": { | ||
"type": "keyword", | ||
"ignore_above": 256 | ||
} | ||
}, | ||
"type": "text" | ||
}, | ||
"defaultAgg": { | ||
"fields": { | ||
"keyword": { | ||
"type": "keyword", | ||
"ignore_above": 256 | ||
} | ||
}, | ||
"type": "text" | ||
}, | ||
"domainId": { | ||
"fields": { | ||
"keyword": { | ||
"type": "keyword", | ||
"ignore_above": 256 | ||
} | ||
}, | ||
"type": "text" | ||
}, | ||
"id": { | ||
"fields": { | ||
"keyword": { | ||
"type": "keyword", | ||
"ignore_above": 256 | ||
} | ||
}, | ||
"type": "text" | ||
}, | ||
"modelId": { | ||
"fields": { | ||
"keyword": { | ||
"type": "keyword", | ||
"ignore_above": 256 | ||
} | ||
}, | ||
"type": "text" | ||
}, | ||
"name": { | ||
"fields": { | ||
"keyword": { | ||
"type": "keyword", | ||
"ignore_above": 256 | ||
} | ||
}, | ||
"type": "text" | ||
}, | ||
"newName": { | ||
"fields": { | ||
"keyword": { | ||
"type": "keyword", | ||
"ignore_above": 256 | ||
} | ||
}, | ||
"type": "text" | ||
}, | ||
"queryId": { | ||
"fields": { | ||
"keyword": { | ||
"type": "keyword", | ||
"ignore_above": 256 | ||
} | ||
}, | ||
"type": "text" | ||
}, | ||
"type": { | ||
"fields": { | ||
"keyword": { | ||
"type": "keyword", | ||
"ignore_above": 256 | ||
} | ||
}, | ||
"type": "text" | ||
} | ||
} | ||
}, | ||
"text": { | ||
"analyzer": "ik_max_word_lowercase_html_strip", | ||
"search_analyzer": "ik_smart", | ||
"type": "text" | ||
}, | ||
"vector": { | ||
"dimension": 512, | ||
"method": { | ||
"engine": "lucene", | ||
"space_type": "cosinesimil", | ||
"name": "hnsw", | ||
"parameters": { | ||
"ef_construction": 100, | ||
"m": 16 | ||
} | ||
}, | ||
"type": "knn_vector" | ||
} | ||
} | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
launchers/standalone/src/main/resources/db/opensearch/ai_sql_preset_query_collection.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,59 @@ | ||
{ | ||
"settings": { | ||
"index": { | ||
"number_of_shards": 6, | ||
"number_of_replicas": 2, | ||
"knn": true | ||
}, | ||
"analysis": { | ||
"analyzer": { | ||
"ik_max_word_lowercase_html_strip": { | ||
"filter": [ | ||
"lowercase", | ||
"asciifolding" | ||
], | ||
"char_filter": [ | ||
"html_strip" | ||
], | ||
"tokenizer": "ik_max_word" | ||
} | ||
} | ||
} | ||
}, | ||
"mappings": { | ||
"properties": { | ||
"metadata": { | ||
"type": "object", | ||
"properties": { | ||
"queryId": { | ||
"type": "text", | ||
"fields": { | ||
"keyword": { | ||
"type": "keyword", | ||
"ignore_above": 256 | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"text": { | ||
"type": "text", | ||
"analyzer": "ik_max_word_lowercase_html_strip", | ||
"search_analyzer": "ik_smart" | ||
}, | ||
"vector": { | ||
"type": "knn_vector", | ||
"dimension": 512, | ||
"method": { | ||
"name": "hnsw", | ||
"engine": "lucene", | ||
"space_type": "cosinesimil", | ||
"parameters": { | ||
"ef_construction": 100, | ||
"m": 16 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.