ARCH-35 Technical approach for Browsing by call number type functionality
- 1 Overview
- 1.1 Current UI/UX
- 1.2 Expected UI/UX
- 1.3 Scope
- 2 Current state
- 3 Solutions
- 3.1 Solution 1: Application-side join
- 3.2 Solution 2: Nested objects, nested queries and nested aggregation
- 3.2.1 Implementation details (Solution 2)
- 3.2.1.1 ui-inventory
- 3.2.1.2 mod-search
- 3.2.1.3 endpoints change
- 3.2.1.4 Performance measurements
- 3.2.1 Implementation details (Solution 2)
- 3.3 Solution 3: additional field in instance index for compound call number and call number type
- 4 LOE
- 4.1 Solution 2
- 4.2 Solution 3
- 5 Rationale
- 5.1 Links
Overview
(Approach addresses feature https://folio-org.atlassian.net/browse/UXPROD-3569)
It's required to implement items filtering by Call Number Types (LC, NLM, Dewey Decimal, SuDoc and Local Call Numbers) represented as aggregations (facets). Currently Browse functionality is implemented Browsing by Call Number with one available facet Effective location (item).
Current UI/UX
Expected UI/UX
(NOTE: in the recent requirements there's no need to build aggregation view, instead needs to proceed with a dropdown list. See [UIIN-2358] Add new browse options to limit browse by call number type - FOLIO Issue Tracker )
Context on Call Number Types - Technical Designs and Decisions - FOLIO Wiki
Scope
Back-End implementation (considering OpenSearch (mod-search) or (mod-inventory-storage) Postgres schema change, with corresponding amendments on mod-quick-marc)
Front-End representation ui-quick-marc
Potential performance impact analysis
Current state
Browsing is done by call number, refined by effective location facet filtering. Extra capabilities of filtering by call number type have not been implemented yet.
Nested objects mappings haven't been introduced in any of existing indexes (implies implementation from scratch).
Another concern is on generation of shelving order, as browsing functionality is performed on the first 10 characters from the whole call number that can causes inconsistent search results.
Technical impediments / implications / concerns
1) There are concerns on introducing another mapping (nested) for items (ones belong to holdings and holdings itself belong to instance) in terms of potential performance impact on indexing and querying by nested query as Elasticsearch implicitly creates separate documents.
2) Used marc4j.jar (v2.9.2) library implements only two kinds of Call Number Types: LC and Dewey. No SuDoc, NLM and others specified. As a solution within ItemEffectiveShelvingOrderProcessor#getFieldValue class getValidShelfKey could be generated separately
3) It's possible to encounter multiple call number types per instance: when there are multiple holdings with items that have different call number types.
4) CQL syntax processing does not support distinction in nested queries or not. To be clarified users expectations.
5) Local call number types (with source "local") are not supposed to be distinguished among each other during indexing and filling a new field typedCallNumber.
Solutions
Solution 1: Application-side join
Steps to describe this approach on trying to Browse by call number with type specified:
Check amount of instances by call number type
Get matched instances by call number
Filter by call number type on application side
In case if after filtering amount of left instances is less than expected and less than total amount, continue search in two directions: backward and forward from anchor with corresponding offsets, filtering by call number type.
| Short description | Comments |
|---|---|---|
Pros |
|
|
Cons |
|
|
Cons to be analyzed more.
Solution 2: Nested objects, nested queries and nested aggregation
In case of nested objects introduction there will be possibility to browse by both datasets (call numbers and call number types) as ones will belong to implicitly indexed document (e.g. item that is nested to holding and correspondingly holding is nested to instance - or similar mappings to be considered if required). Nested Objects concept explained - Technical Designs and Decisions - FOLIO Wiki
| Short description | Comment |
|---|---|---|
Pros |
|
|
Cons |
|
|
Trade-off | could be additional mapping instead of substitution to keep back-compatibility for all potentially affected searches | there could be added another sibling mapping for items like (items_nested) with corresponding nested mapping(s) for the entry
|
Actual impact on indexing performance (and ways to speed up one) to be analyzed more, however according to what's probated within the prototype running - impact on indexing performance is far from critical.
Implementation details (Solution 2)
ui-inventory
For ui-inventory module the next changes are implied:
altering request(s) for browsing (by nested queries) with optional call number type parameter inclusion. Particularly request semantic implies to stay the same, except extra parameter adding for refined request.
(facets requirements are considered as skipped https://folio-org.atlassian.net/browse/UIIN-2358) For facet filtering nested bucket aggregation query is implied. There are two ways of how it could be performed:
1st is to count all instances grouped by call number types
2nd is to break results of browsing by search term on groups of call number types (note, only results for current, previous and next pages are counted. If implement aggregation functionality needs to define if it's required to count in aggregations all instance records or just affine around browsing value).