Skip to content

Commit 317a99c

Browse files
author
Phil Varner
committed
revert mappings back to original ones
1 parent f63db85 commit 317a99c

File tree

1 file changed

+5
-67
lines changed

1 file changed

+5
-67
lines changed

stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/transactions.py

Lines changed: 5 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -32,77 +32,15 @@ class TransactionsClient(BaseTransactionsClient):
3232
settings = ElasticsearchSettings()
3333
client = settings.create_client
3434

35-
dynamicTemplates = [
36-
# Common https://github.com/radiantearth/stac-spec/blob/master/item-spec/common-metadata.md
37-
{
38-
"descriptions": {
39-
"match_mapping_type": "string",
40-
"match": "description",
41-
"mapping": {"type": "text"},
42-
}
43-
},
44-
{
45-
"titles": {
46-
"match_mapping_type": "string",
47-
"match": "title",
48-
"mapping": {"type": "text"},
49-
}
50-
},
51-
# Projection Extension https://github.com/stac-extensions/projection
52-
{"proj_epsg": {"match": "proj:epsg", "mapping": {"type": "integer"}}},
53-
{
54-
"proj_projjson": {
55-
"match": "proj:projjson",
56-
"mapping": {"type": "object", "enabled": False},
57-
}
58-
},
59-
{
60-
"proj_centroid": {
61-
"match_mapping_type": "string",
62-
"match": "proj:centroid",
63-
"mapping": {"type": "geo_point"},
64-
}
65-
},
66-
{
67-
"proj_geometry": {
68-
"match_mapping_type": "string",
69-
"match": "proj:geometry",
70-
"mapping": {"type": "geo_shape"},
71-
}
72-
},
73-
{
74-
"no_index_href": {
75-
"match": "href",
76-
"mapping": {"type": "text", "index": False},
77-
}
78-
},
79-
# Default all other strings not otherwise specified to keyword
80-
{"strings": {"match_mapping_type": "string", "mapping": {"type": "keyword"}}},
81-
{"numerics": {"match_mapping_type": "long", "mapping": {"type": "float"}}},
82-
]
83-
8435
mappings = {
85-
"numeric_detection": False,
86-
"dynamic_templates": dynamicTemplates,
8736
"properties": {
8837
"geometry": {"type": "geo_shape"},
89-
"assets": {"type": "object", "enabled": False},
90-
"links": {"type": "object", "enabled": False},
91-
"properties": {
92-
"type": "object",
93-
"properties": {
94-
# Common https://github.com/radiantearth/stac-spec/blob/master/item-spec/common-metadata.md
95-
"datetime": {"type": "date"},
96-
"start_datetime": {"type": "date"},
97-
"end_datetime": {"type": "date"},
98-
"created": {"type": "date"},
99-
"updated": {"type": "date"},
100-
# Satellite Extension https://github.com/stac-extensions/sat
101-
"sat:absolute_orbit": {"type": "integer"},
102-
"sat:relative_orbit": {"type": "integer"},
103-
},
38+
"id": {"type": "text", "fields": {"keyword": {"type": "keyword"}}},
39+
"properties__datetime": {
40+
"type": "text",
41+
"fields": {"keyword": {"type": "keyword"}},
10442
},
105-
},
43+
}
10644
}
10745

10846
def create_item_index(self):

0 commit comments

Comments
 (0)