Add new facets for shared/local flag and tenantId

Description

Purpose/Overview:

Change index mappings to reflect new facets for shared/local flag and tenantId

Requirements/Scope:

  1.  Add new facets:

    1. Shared/Local facet for:

      1. Instances

      2. Contributors

      3. Subjects

    2. TenantId facet for:

      1. Holdings

      2. Items

      3. Contributors

      4. Subjects

Approach:

Align elasticsearch/model json mappings to include shared and tenantId facets, and related REST endpoints.

todo: search for "MSEARCH-534" in a project. There might be some todos or ignored tests to adjust

Acceptance criteria:

  • Covered by unit tests

  • Karate tests are created/updated

  • Module documentation updated

  • Logging is well-defined

Environment

None

Potential Workaround

None

CSP Request Details

None

CSP Rejection Details

None

CSP Approved

None

Attachments

10

Checklist

hide

TestRail: Results

Activity

Show:

Valery_PilkoSeptember 29, 2023 at 9:01 AM

Hey  
Looks like Issue 2 was fixed on https://folio-dev-spitfire-2nd-consortium.ci.folio.org/ , see attached screencast:

Pavlo SmahinSeptember 28, 2023 at 11:46 AM

From and  
When user selects shared = Yes and held by = current_tenant then will see return shadow copies in current tenant
When user selects shared = Yes and held by = another_tenant then any shadow copies in that other tenant
When user selects shared = Yes and held by = central_tenant then Not Possible
When user selects shared = No and held by = current_tenant then no shadow copies are returned and only local records that have holdings
– Exception is browse by subjects and contributors as it will return all local records
When user selects shared = No and held by = another_tenant then NOT possible
When user selects shared = No and held by = central_tenant then NOT possibleBrowse by subjects and contributors

  • Shared by behavior - only check instances

    • Default behavior (no selection) Show all subjects or contributors from both shared instances and local instances for current tenant

      • Number of titles = Shared + Local instances for current tenant-- When user selects shared = Yes then see all subjects or contributors from all shared instances

      • Number of titles = Shared instances-- When user selects shared = No then see all subjects or contributors from all local instances for current tenant

      • Number of titles = Local instances for current tenantCentral tenant will not have the Shared by facet on browse subjects, contributors, and call numbers AND search too (Inventory app)
        Central tenant will not have the Shared by facet on browse authorities and search authorities (MARC authority app)

    • For browse by subjects and contributors >> Held by behavior = only check instances. WILL NOT DO FOR POPPY RELEASE*

Valery_PilkoSeptember 21, 2023 at 11:19 AM

Re-tested on Spitfire Consortium rancher environment:
Issue 1 fixed, see attached screenshot:

Another issue-2 appeared:
"shared" facet doesn't work for Browse by Contributors/Subjects when shared Instance has "shadow" copy on current tenant.
Scenario:
1) Shared Instance with contributor/subject has "shadow" copy on "University" tenant
2) Local Instance with contributor/subject exists on "University" tenant
3) Send GET request "/browse/contributors/instances?query=(name>="contributor" or name<"contributor") and {}instances.shared==false"
4) Send GET request "/browse/contributors/instances?query=(name>="contributor" or name<"contributor") and {}instances.shared==true"
Expected result: 
For step 3 - only local Instance record is returned in response.
For step 4 - only shared Instance record is returned in response.
Actual result:
For step 3 and 4 - both (local and shared) instance records are returned in response.
See attached screenshot:

Valery_PilkoSeptember 19, 2023 at 2:16 PM

According to discussion with PO: previously described scenario works as expected, because contributors/subjects from local Instances regardless of whether the member institution has holdings will be displayed in "Held by" facet options and could be found by browsing with applied "Held by" facet.

One issue to be fixed:
"Number of titles" found in response should include only Local Instances and Shared Instances (which has Holdings) when browse executed from member tenant and same tenant is selected in the "Held by" facet.
See attached screenshot:
1 record is Shared
1 record is Local
Both records don't have Holdings
My request: {{host}}/browse/contributors/instances?query=(name>="Creelman, James Ashmore" or name<"Creelman, James Ashmore") and instances.tenantId==college

Valery_PilkoSeptember 18, 2023 at 8:30 AM

Tested on https://folio-dev-spitfire-2nd-consortium.ci.folio.org/ with following test data (see issues described in 2 and 3 steps):
Only 1 Instance record has "Holdings" on Member tenant ("College" tenant), see screenshot:

  1. Sent GET request "/search/instances/facets?facet=holdings.tenantId&query=id=*" to see possible "Held by" facet options for Search by Instances. - looks like it's expected, I've received only one option for "Held by" facet, because only one "Holdings" was created (second screenshot)

  2. Sent GET request "/search/contributors/facets?facet=instances.tenantId&query=name=*" to see possible "Held by" facet options for Browse contributors.
    Actual result: list of all tenants (institutions) names is displayed as options for "Held by" facet (third screenshot)
    Expected result: only 1 tenant (institution) name ("College") is displayed as option for "Held by" facet

  3. Sent GET request "/browse/contributors/instances?query=(name>="C410756 Contributor Shared MARC" or name<"C410756 Contributor Shared MARC") and instances.tenantId==college" to receive browse contributors result list with applied "Held by" facet ("holdings.tenantId" can't be sent in this request). -
    Actual result: 88 records are returned to the response
    Expected result: only one record is returned in response, which I've created.

Done

Details

Assignee

Reporter

Priority

Story Points

Sprint

Development Team

Spitfire

Fix versions

Release

Poppy (R2 2023)

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs

Created June 1, 2023 at 9:44 AM
Updated October 9, 2023 at 2:54 PM
Resolved October 9, 2023 at 2:54 PM
TestRail: Cases
TestRail: Runs