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

Add keyword field 'provider' to field mapping #311

Merged
merged 1 commit into from
Feb 29, 2024

Conversation

jonavellecuerdo
Copy link
Contributor

@jonavellecuerdo jonavellecuerdo commented Feb 29, 2024

Purpose and background context

Add new provider keyword field to TIMDEX field mapping to support UI filter "Institution". This work is required as a result
of the change made to the TIMDEX data model in MITLibraries/transmogrifier#137.

How can a reviewer manually see the effects of these changes?

View output from running query on TIMDEX records from source gisogm bulk-indexed into a local OpenSearch Docker Container.

Query

GET gisogm/_search
{
  "size": 0, 
  "aggs": {
    "provider_count": {
      "terms": {
        "field": "provider",
        "size": 50
      }
    }
  },
  "track_total_hits": true
}

Output [REDACTED]:

"aggregations": {
    "provider_count": {
      "doc_count_error_upper_bound": 0,
      "sum_other_doc_count": 0,
      "buckets": [
        {
          "key": "Princeton",
          "doc_count": 38195
        },
        {
          "key": "Stanford",
          "doc_count": 20429
        },
        {
          "key": "Harvard",
          "doc_count": 10988
        },
        {
          "key": "University of Wisconsin-Madison",
          "doc_count": 10380
        },
        {
          "key": "Columbia",
          "doc_count": 6083
        },
        {
          "key": "University of Minnesota",
          "doc_count": 5819
        },
        {
          "key": "Indiana University",
          "doc_count": 4797
        },
        {
          "key": "Rutgers University",
          "doc_count": 4539
        },
        {
          "key": "NYU Libraries",
          "doc_count": 4174
        },
        {
          "key": "Pennsylvania State University",
          "doc_count": 3573
        },
        {
          "key": "University of Iowa",
          "doc_count": 3537
        },
        {
          "key": "University of Illinois",
          "doc_count": 2207
        },
        {
          "key": "Michigan State University",
          "doc_count": 1223
        },
        {
          "key": "University of Michigan",
          "doc_count": 1140
        },
        {
          "key": "UC Berkeley Library",
          "doc_count": 990
        },
        {
          "key": "University of Wisconsin-Milwaukee",
          "doc_count": 777
        },
        {
          "key": "CUGIR, Cornell University",
          "doc_count": 460
        },
        {
          "key": "Ohio State Unviversity",
          "doc_count": 256
        },
        {
          "key": "Purdue University",
          "doc_count": 118
        },
        {
          "key": "University of Chicago",
          "doc_count": 103
        },
        {
          "key": "Lewis and Clark",
          "doc_count": 38
        },
        {
          "key": "University of Maryland",
          "doc_count": 36
        }
      ]
    }

These were the steps taken to produce the output above.

  1. Ran the following command in transmogrifier locally to create a JSON file with TIMDEX records from source gisogm.
    pipenv run transform -i s3://timdex-extract-dev-222053980223/gisogm/gisogm-2024-02-20-full-extracted-records-to-index.jsonl -o output/output_gisogm.json -s gisogm -v
    
  2. Copied transmogrifier/output/output_gisogm.json to timdex-index-manager/output_gisogm.json.
  3. Followed the instructions in the README | Index records into local OpenSearch Docker Container with Dashboard.

Note: When running this locally, I had to temporarily update the version of the Docker images in compose.yaml to 2.11.1. The latest will pull version 2.12, which now requires an env var called OPENSEARCH_INITIAL_ADMIN_PASSWORD to be set.

Includes new or updated dependencies?

NO

Changes expectations for external applications?

NO

What are the relevant tickets?

https://mitlibraries.atlassian.net/browse/GDT-209

Developer

  • All new ENV is documented in README
  • All new ENV has been added to staging and production environments
  • All related Jira tickets are linked in commit message(s)
  • Stakeholder approval has been confirmed (or is not needed)

Code Reviewer(s)

  • The commit message is clear and follows our guidelines (not just this PR message)
  • There are appropriate tests covering any new functionality
  • The provided documentation is sufficient for understanding any new functionality introduced
  • Any manual tests have been performed or provided examples have been verified
  • New dependencies are appropriate or there were no changes

Why these changes are being introduced:
* This is change is required to support the addition of a 'provider'
field to the TIMDEX model.

How this addresses that need:
* Update config to include 'provider' key field

Side effects of this change:
* None

Relevant ticket(s):
* https://mitlibraries.atlassian.net/browse/GDT-209
@jonavellecuerdo jonavellecuerdo marked this pull request as ready for review February 29, 2024 19:14
Copy link
Contributor

@ghukill ghukill left a comment

Choose a reason for hiding this comment

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

Approved! Of course, we'll need some coordination of tagging this release and re-harvesting data, but the code change looks inline with the new field.

@jonavellecuerdo jonavellecuerdo merged commit c41c633 into main Feb 29, 2024
3 checks passed
@jonavellecuerdo jonavellecuerdo deleted the GDT-209-add-provider-field branch February 29, 2024 20:55
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.

3 participants