Skip to content
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

ISO19139 / ISO19115.3 / Index resource date fields as defined in the metadata. #8365

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

josegar74
Copy link
Member

Previously the values were converted to UTC. If the timezone defined in the server is Europe/Madrid and the metadata has a creation date '2023-01-01T00:00:00', the index field creationYearForResource had the value 2022

Test case:

  1. Create an ISO19139 and add a creation date 2023-01-01T00:00:00.

creation-date

  1. In the UI settings replace the Search application facet creationYearForResource with
  "creationYearForResource": {
    "terms": {
      "field": "creationYearForResource",
      "order": {
        "_key": "desc"
      }
    },
    "meta": {
      "collapsed": true
    }
  },

creation-date-facet

  1. Go to the search page:
  • Without the fix:

facet-no-ok

  • With the fix:

facet-ok


@fxprunayre, instead of extracting the year from the XML content, should we convert the date for these fields, not to UTC, but to the server timezone configured?

With the current change we are not dealing with metadata dates that have a timezone.

Checklist

  • I have read the contribution guidelines
  • Pull request provided for main branch, backports managed with label
  • Good housekeeping of code, cleaning up comments, tests, and documentation
  • Clean commit history broken into understandable chucks, avoiding big commits with hundreds of files, cautious of reformatting and whitespace changes
  • Clean commit messages, longer verbose messages are encouraged
  • API Changes are identified in commit messages
  • Testing provided for features or enhancements using automatic tests
  • User documentation provided for new features or enhancements in manual
  • Build documentation provided for development instructions in README.md files
  • Library management using pom.xml dependency management. Update build documentation with intended library use and library tutorials or documentation

…metadata.

Previously the values were converted to UTC. If the timezone defined in the server is Europe/Madrid and the metadata has a creation date '2023-01-01T00:00:00', the index field creationYearForResource had the value 2022
@fxprunayre
Copy link
Member

instead of extracting the year from the XML content, should we convert the date for these fields, not to UTC, but to the server timezone configured?

On the long run, we should probably rely on https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-datehistogram-aggregation.html#datehistogram-aggregation-time-zone, which means index in UTC and convert and format for a timezone

Copy link
Member

@fxprunayre fxprunayre left a comment

Choose a reason for hiding this comment

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

We can go with that for the short term and investigate date histogram aggs later to better support when we have a mix of timezone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants