mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-28 18:35:07 +00:00
parent
33ecb3dd80
commit
9b35547fa5
@ -389,7 +389,10 @@ class ElasticsearchSink(Sink[Entity]):
|
|||||||
service_suggest.append({"input": [table.service.name], "weight": 5})
|
service_suggest.append({"input": [table.service.name], "weight": 5})
|
||||||
database_suggest.append({"input": [database_entity.name.__root__], "weight": 5})
|
database_suggest.append({"input": [database_entity.name.__root__], "weight": 5})
|
||||||
schema_suggest.append(
|
schema_suggest.append(
|
||||||
{"input": [database_schema_entity.name.__root__], "weight": 5}
|
{
|
||||||
|
"input": [database_schema_entity.name.__root__],
|
||||||
|
"weight": 5,
|
||||||
|
}
|
||||||
)
|
)
|
||||||
self._parse_columns(
|
self._parse_columns(
|
||||||
table.columns, None, column_names, column_descriptions, tags
|
table.columns, None, column_names, column_descriptions, tags
|
||||||
|
@ -89,7 +89,7 @@ DASHBOARD_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -126,7 +126,7 @@ DASHBOARD_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -163,7 +163,7 @@ DASHBOARD_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -205,7 +205,7 @@ DASHBOARD_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"followers": {
|
"followers": {
|
||||||
"type": "keyword"
|
"type": "keyword"
|
||||||
@ -255,7 +255,14 @@ DASHBOARD_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
"type": "keyword"
|
"type": "keyword"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"type": "completion"
|
"type": "completion",
|
||||||
|
"contexts": [
|
||||||
|
{
|
||||||
|
"name": "deleted",
|
||||||
|
"type": "category",
|
||||||
|
"path": "deleted"
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"chart_suggest": {
|
"chart_suggest": {
|
||||||
"type": "completion"
|
"type": "completion"
|
||||||
|
@ -78,7 +78,7 @@ GLOSSARY_TERM_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -115,7 +115,7 @@ GLOSSARY_TERM_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -152,7 +152,7 @@ GLOSSARY_TERM_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -189,7 +189,7 @@ GLOSSARY_TERM_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -219,13 +219,20 @@ GLOSSARY_TERM_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"status": {
|
"status": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"type": "completion"
|
"type": "completion",
|
||||||
|
"contexts": [
|
||||||
|
{
|
||||||
|
"name": "deleted",
|
||||||
|
"type": "category",
|
||||||
|
"path": "deleted"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -128,7 +128,7 @@ MLMODEL_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -178,7 +178,7 @@ MLMODEL_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -215,7 +215,7 @@ MLMODEL_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -257,7 +257,7 @@ MLMODEL_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"followers": {
|
"followers": {
|
||||||
"type": "keyword"
|
"type": "keyword"
|
||||||
@ -307,7 +307,14 @@ MLMODEL_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
"type": "keyword"
|
"type": "keyword"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"type": "completion"
|
"type": "completion",
|
||||||
|
"contexts": [
|
||||||
|
{
|
||||||
|
"name": "deleted",
|
||||||
|
"type": "category",
|
||||||
|
"path": "deleted"
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"service_suggest": {
|
"service_suggest": {
|
||||||
"type": "completion"
|
"type": "completion"
|
||||||
|
@ -108,7 +108,7 @@ PIPELINE_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -145,7 +145,7 @@ PIPELINE_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -153,7 +153,7 @@ PIPELINE_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"followers": {
|
"followers": {
|
||||||
"type": "keyword"
|
"type": "keyword"
|
||||||
@ -203,7 +203,14 @@ PIPELINE_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
"type": "keyword"
|
"type": "keyword"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"type": "completion"
|
"type": "completion",
|
||||||
|
"contexts": [
|
||||||
|
{
|
||||||
|
"name": "deleted",
|
||||||
|
"type": "category",
|
||||||
|
"path": "deleted"
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"task_suggest": {
|
"task_suggest": {
|
||||||
"type": "completion"
|
"type": "completion"
|
||||||
|
@ -14,13 +14,26 @@ import textwrap
|
|||||||
TABLE_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
TABLE_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
||||||
"""
|
"""
|
||||||
{
|
{
|
||||||
"mappings":{
|
"settings": {
|
||||||
|
"analysis": {
|
||||||
|
"normalizer": {
|
||||||
|
"lowercase_normalizer": {
|
||||||
|
"type": "custom",
|
||||||
|
"char_filter": [],
|
||||||
|
"filter": [
|
||||||
|
"lowercase"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mappings": {
|
||||||
"properties": {
|
"properties": {
|
||||||
"id": {
|
"id": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"name": {
|
"name": {
|
||||||
"type":"text",
|
"type": "text",
|
||||||
"fields": {
|
"fields": {
|
||||||
"keyword": {
|
"keyword": {
|
||||||
"type": "keyword",
|
"type": "keyword",
|
||||||
@ -29,7 +42,8 @@ TABLE_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"fullyQualifiedName": {
|
"fullyQualifiedName": {
|
||||||
"type":"text"
|
"type": "keyword",
|
||||||
|
"normalizer": "lowercase_normalizer"
|
||||||
},
|
},
|
||||||
"displayName": {
|
"displayName": {
|
||||||
"type": "text",
|
"type": "text",
|
||||||
@ -131,7 +145,7 @@ TABLE_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -168,7 +182,7 @@ TABLE_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -205,7 +219,7 @@ TABLE_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -242,7 +256,7 @@ TABLE_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -279,7 +293,7 @@ TABLE_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -321,7 +335,7 @@ TABLE_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"followers": {
|
"followers": {
|
||||||
"type": "keyword"
|
"type": "keyword"
|
||||||
@ -371,7 +385,14 @@ TABLE_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
"type": "keyword"
|
"type": "keyword"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"type": "completion"
|
"type": "completion",
|
||||||
|
"contexts": [
|
||||||
|
{
|
||||||
|
"name": "deleted",
|
||||||
|
"type": "category",
|
||||||
|
"path": "deleted"
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"column_suggest": {
|
"column_suggest": {
|
||||||
"type": "completion"
|
"type": "completion"
|
||||||
@ -387,6 +408,6 @@ TABLE_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
@ -51,13 +51,20 @@ TAG_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deprecated": {
|
"deprecated": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"type": "completion"
|
"type": "completion",
|
||||||
|
"contexts": [
|
||||||
|
{
|
||||||
|
"name": "deleted",
|
||||||
|
"type": "category",
|
||||||
|
"path": "deleted"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ TEAM_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -112,7 +112,7 @@ TEAM_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -123,13 +123,20 @@ TEAM_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"entityType": {
|
"entityType": {
|
||||||
"type": "keyword"
|
"type": "keyword"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"type": "completion"
|
"type": "completion",
|
||||||
|
"contexts": [
|
||||||
|
{
|
||||||
|
"name": "deleted",
|
||||||
|
"type": "category",
|
||||||
|
"path": "deleted"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -104,7 +104,7 @@ TOPIC_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -141,7 +141,7 @@ TOPIC_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -149,7 +149,7 @@ TOPIC_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"followers": {
|
"followers": {
|
||||||
"type": "keyword"
|
"type": "keyword"
|
||||||
@ -199,7 +199,14 @@ TOPIC_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
"type": "keyword"
|
"type": "keyword"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"type": "completion"
|
"type": "completion",
|
||||||
|
"contexts": [
|
||||||
|
{
|
||||||
|
"name": "deleted",
|
||||||
|
"type": "category",
|
||||||
|
"path": "deleted"
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"service_suggest": {
|
"service_suggest": {
|
||||||
"type": "completion"
|
"type": "completion"
|
||||||
|
@ -78,7 +78,7 @@ USER_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -115,7 +115,7 @@ USER_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -152,7 +152,7 @@ USER_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -160,13 +160,20 @@ USER_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"entityType": {
|
"entityType": {
|
||||||
"type": "keyword"
|
"type": "keyword"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"type": "completion"
|
"type": "completion",
|
||||||
|
"contexts": [
|
||||||
|
{
|
||||||
|
"name": "deleted",
|
||||||
|
"type": "category",
|
||||||
|
"path": "deleted"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package org.openmetadata.service.elasticsearch;
|
package org.openmetadata.service.elasticsearch;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -177,6 +178,7 @@ public class ElasticSearchIndexDefinition {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
@Jacksonized
|
@Jacksonized
|
||||||
@Getter
|
@Getter
|
||||||
@Builder
|
@Builder
|
||||||
|
@ -25,6 +25,7 @@ import io.swagger.v3.oas.annotations.media.Content;
|
|||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import javax.ws.rs.DefaultValue;
|
import javax.ws.rs.DefaultValue;
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.GET;
|
||||||
@ -53,6 +54,7 @@ import org.elasticsearch.search.suggest.Suggest;
|
|||||||
import org.elasticsearch.search.suggest.SuggestBuilder;
|
import org.elasticsearch.search.suggest.SuggestBuilder;
|
||||||
import org.elasticsearch.search.suggest.SuggestBuilders;
|
import org.elasticsearch.search.suggest.SuggestBuilders;
|
||||||
import org.elasticsearch.search.suggest.completion.CompletionSuggestionBuilder;
|
import org.elasticsearch.search.suggest.completion.CompletionSuggestionBuilder;
|
||||||
|
import org.elasticsearch.search.suggest.completion.context.CategoryQueryContext;
|
||||||
import org.openmetadata.schema.api.configuration.elasticsearch.ElasticSearchConfiguration;
|
import org.openmetadata.schema.api.configuration.elasticsearch.ElasticSearchConfiguration;
|
||||||
import org.openmetadata.service.util.ElasticSearchClientUtils;
|
import org.openmetadata.service.util.ElasticSearchClientUtils;
|
||||||
|
|
||||||
@ -225,11 +227,17 @@ public class SearchResource {
|
|||||||
@javax.ws.rs.QueryParam("q")
|
@javax.ws.rs.QueryParam("q")
|
||||||
String query,
|
String query,
|
||||||
@DefaultValue("table_search_index") @javax.ws.rs.QueryParam("index") String index,
|
@DefaultValue("table_search_index") @javax.ws.rs.QueryParam("index") String index,
|
||||||
@DefaultValue("suggest") @javax.ws.rs.QueryParam("field") String fieldName)
|
@DefaultValue("suggest") @javax.ws.rs.QueryParam("field") String fieldName,
|
||||||
|
@DefaultValue("false") @javax.ws.rs.QueryParam("deleted") String deleted)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
SearchRequest searchRequest = new SearchRequest(index);
|
SearchRequest searchRequest = new SearchRequest(index);
|
||||||
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
|
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
|
||||||
CompletionSuggestionBuilder suggestionBuilder = SuggestBuilders.completionSuggestion(fieldName).prefix(query);
|
CompletionSuggestionBuilder suggestionBuilder = SuggestBuilders.completionSuggestion(fieldName).prefix(query);
|
||||||
|
if (fieldName.equalsIgnoreCase("suggest")) {
|
||||||
|
suggestionBuilder.contexts(
|
||||||
|
Collections.singletonMap(
|
||||||
|
"deleted", Collections.singletonList(CategoryQueryContext.builder().setCategory(deleted).build())));
|
||||||
|
}
|
||||||
SuggestBuilder suggestBuilder = new SuggestBuilder();
|
SuggestBuilder suggestBuilder = new SuggestBuilder();
|
||||||
suggestBuilder.addSuggestion("metadata-suggest", suggestionBuilder);
|
suggestBuilder.addSuggestion("metadata-suggest", suggestionBuilder);
|
||||||
searchSourceBuilder.suggest(suggestBuilder);
|
searchSourceBuilder.suggest(suggestBuilder);
|
||||||
|
@ -88,7 +88,7 @@
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -125,7 +125,7 @@
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -162,7 +162,7 @@
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -204,7 +204,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"followers": {
|
"followers": {
|
||||||
"type": "keyword"
|
"type": "keyword"
|
||||||
@ -238,7 +238,14 @@
|
|||||||
"type": "keyword"
|
"type": "keyword"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"type": "completion"
|
"type": "completion",
|
||||||
|
"contexts": [
|
||||||
|
{
|
||||||
|
"name": "deleted",
|
||||||
|
"type": "category",
|
||||||
|
"path": "deleted"
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"chart_suggest": {
|
"chart_suggest": {
|
||||||
"type": "completion"
|
"type": "completion"
|
||||||
|
@ -88,7 +88,7 @@
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -125,7 +125,7 @@
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -162,7 +162,7 @@
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -199,7 +199,7 @@
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -229,13 +229,20 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"status": {
|
"status": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"type": "completion"
|
"type": "completion",
|
||||||
|
"contexts": [
|
||||||
|
{
|
||||||
|
"name": "deleted",
|
||||||
|
"type": "category",
|
||||||
|
"path": "deleted"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -127,7 +127,7 @@
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -177,7 +177,7 @@
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -214,7 +214,7 @@
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -256,7 +256,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"followers": {
|
"followers": {
|
||||||
"type": "keyword"
|
"type": "keyword"
|
||||||
@ -290,7 +290,14 @@
|
|||||||
"type": "keyword"
|
"type": "keyword"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"type": "completion"
|
"type": "completion",
|
||||||
|
"contexts": [
|
||||||
|
{
|
||||||
|
"name": "deleted",
|
||||||
|
"type": "category",
|
||||||
|
"path": "deleted"
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"service_suggest": {
|
"service_suggest": {
|
||||||
"type": "completion"
|
"type": "completion"
|
||||||
|
@ -107,7 +107,7 @@
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -144,7 +144,7 @@
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -152,7 +152,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"followers": {
|
"followers": {
|
||||||
"type": "keyword"
|
"type": "keyword"
|
||||||
@ -186,7 +186,14 @@
|
|||||||
"type": "keyword"
|
"type": "keyword"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"type": "completion"
|
"type": "completion",
|
||||||
|
"contexts": [
|
||||||
|
{
|
||||||
|
"name": "deleted",
|
||||||
|
"type": "category",
|
||||||
|
"path": "deleted"
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"task_suggest": {
|
"task_suggest": {
|
||||||
"type": "completion"
|
"type": "completion"
|
||||||
|
@ -130,7 +130,7 @@
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -167,7 +167,7 @@
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -204,7 +204,7 @@
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -241,7 +241,7 @@
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -278,7 +278,7 @@
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -320,7 +320,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"followers": {
|
"followers": {
|
||||||
"type": "keyword"
|
"type": "keyword"
|
||||||
@ -370,7 +370,14 @@
|
|||||||
"type": "keyword"
|
"type": "keyword"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"type": "completion"
|
"type": "completion",
|
||||||
|
"contexts": [
|
||||||
|
{
|
||||||
|
"name": "deleted",
|
||||||
|
"type": "category",
|
||||||
|
"path": "deleted"
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"column_suggest": {
|
"column_suggest": {
|
||||||
"type": "completion"
|
"type": "completion"
|
||||||
|
@ -59,10 +59,17 @@
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"type": "completion"
|
"type": "completion",
|
||||||
|
"contexts": [
|
||||||
|
{
|
||||||
|
"name": "deleted",
|
||||||
|
"type": "category",
|
||||||
|
"path": "deleted"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -102,7 +102,7 @@
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -113,13 +113,20 @@
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"entityType": {
|
"entityType": {
|
||||||
"type": "keyword"
|
"type": "keyword"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"type": "completion"
|
"type": "completion",
|
||||||
|
"contexts": [
|
||||||
|
{
|
||||||
|
"name": "deleted",
|
||||||
|
"type": "category",
|
||||||
|
"path": "deleted"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -103,7 +103,7 @@
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -140,7 +140,7 @@
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -148,7 +148,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"followers": {
|
"followers": {
|
||||||
"type": "keyword"
|
"type": "keyword"
|
||||||
@ -182,7 +182,14 @@
|
|||||||
"type": "keyword"
|
"type": "keyword"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"type": "completion"
|
"type": "completion",
|
||||||
|
"contexts": [
|
||||||
|
{
|
||||||
|
"name": "deleted",
|
||||||
|
"type": "category",
|
||||||
|
"path": "deleted"
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"service_suggest": {
|
"service_suggest": {
|
||||||
"type": "completion"
|
"type": "completion"
|
||||||
|
@ -74,7 +74,7 @@
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -111,7 +111,7 @@
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -148,7 +148,7 @@
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"href": {
|
"href": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@ -156,7 +156,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
"type": "boolean"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"entityType": {
|
"entityType": {
|
||||||
"type": "keyword"
|
"type": "keyword"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user