Skip to content

Improve Elasticsearch mappings #181

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

Merged
merged 22 commits into from
Mar 2, 2022
Merged

Improve Elasticsearch mappings #181

merged 22 commits into from
Mar 2, 2022

Conversation

philvarner
Copy link
Collaborator

@philvarner philvarner commented Feb 22, 2022

Related Issue(s):

Proposed Changes:

  1. replace several older field names with current ones (e.g., eo:gsd is now gsd)
  2. map numeric values to float (instead of long by default)
  3. disable indexing of projjson field
  4. re-enabled eslint check for quoted JSON values, and fix existing uses of that.

PR Checklist:

  • I have added my changes to the CHANGELOG or a CHANGELOG entry is not required.

Phil Varner and others added 16 commits February 22, 2022 14:09
* PR template: put related issues in list for rich formatting

* fix path of api.yaml in webpack, add npm build to GH Action
)

* fix service-desc link relation type to use OpenAPI yaml media type
* define routes for transaction endpoints
)

* Maintain created time when reingesting an item

* Remove typechecking of tests

* Update CHANGELOG.md

Co-authored-by: Phil Varner <[email protected]>

* Consolidate tests

* Fix test

* Replace items rather than parti-update

* Remove ts-check in test

* Update docs

Co-authored-by: Phil Varner <[email protected]>
@marchuffnagle
Copy link
Contributor

It looks like the main branch needs to be pulled into this branch. It's unclear what needs to be reviewed.

@philvarner
Copy link
Collaborator Author

Yeah, I though I had, and I'm not sure what even happened there. It's up to date now.

@philvarner philvarner marked this pull request as ready for review February 28, 2022 19:16
@@ -1703,7 +1703,7 @@ null
],
"exclude": [
[
"eo:sun_azimuth"
"view:sun_azimuth"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this field used to be in the EO extension, is now in the View extension.

@@ -1,14 +1,15 @@
const common = require('./common')
const dynamicTemplates = require('./dynamicTemplates')
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was the only thing in common, so I made it more explicit.

numerics: {
match_mapping_type: 'long',
mapping: { type: 'float' }
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we now default to mapping any field that's not otherwise explicitly mapped to float instead of long, to avoid a situation where the first time the field and has a non-decimal value that it gets mapped to long, and then all other values for that field, even if they're decimal, will be truncated to longs in the index

}
},
{
proj_projjson: {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a complex object with several different variations. attempting to index a variation that is different than the first one indexed can result in an error, see #108

@@ -562,7 +562,7 @@ components:
max: '2019-07-10T13:44:56Z'
'sci:citation':
- 'Copernicus Sentinel data [Year]'
'eo:gsd':
'gsd':
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gsd used to be in the EO extension, now it's part of the STAC Commons fields that have no prefix.

@philvarner
Copy link
Collaborator Author

okay, now it's ready for review @marchuffnagle

Copy link
Contributor

@marchuffnagle marchuffnagle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a couple questions.

@philvarner philvarner changed the title initial mappings Update Elasticsearch mappings Mar 1, 2022
@philvarner philvarner changed the title Update Elasticsearch mappings Improve Elasticsearch mappings Mar 1, 2022
@philvarner
Copy link
Collaborator Author

PR comments resolved.

@philvarner philvarner requested a review from marchuffnagle March 1, 2022 17:49
@philvarner philvarner merged commit 5f54fbc into main Mar 2, 2022
@philvarner philvarner deleted the pv/es-mapping branch March 2, 2022 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants