Details
-
New Feature
-
Status: Closed (View Workflow)
-
TBD
-
Resolution: Won't Do
-
None
-
None
-
None
-
Core: Platform
-
-
CW: This feature is in an undecided state, due to awaiting the outcome of the POC of using Elastic Search in Inventory.
-
R2
-
R1
-
R1
-
R2
Description
CW: This feature is in an undecided state, due to awaiting the outcome of the POC of using Elastic Search in Inventory.
- - - -
Purpose:
The totalRecords search result hit count number returned by RMB is precise if totalRecords is below 1000 and it is only an estimation if totalRecords >= 1000 (details).
The front-end currently displays "8081 records found" for estimations.
This is misleading (false precision).
"about" should be prepended for >= 1000.
The number should be rounded for >= 1000.
Scenarios:
- Scenario
- Given a result count is estimated (current understanding is that result counts above 1,000 are estimates)
- When displayed in FOLIO
- Then:
- Result count should be preceded by "about"
- Result count should be rounded using the "Rounded to first digit" method
- For example:
- Estimated result count from Postgres = 32351
- Displays in FOLIO as "about 30,000 records found"
- Scenario
- Given a result count is NOT estimated (current understanding is that result counts under 1,000 are exact)
- When displayed in FOLIO
- Then:
- Result count should NOT be preceded by "about"
- Result count should NOT be rounded
- For example:
- Exact result count from Postgres = 845
- Displays in FOLIO as "845 records found"
Algorithm for the front-end:
if totalRecordsEstimated is true print "about " + totalRecordsRounded else if totalRecordsEstimated is false print totalRecords // totalRecordsEstimated is undefined until all back-ends have upgraded RMB, // handle this gracefully for folio-testing: else if totalRecords < 1000 print totalRecords else print "about " + totalRecords + " (upgrade back-end for rounding)"
Background Discussion:
- Three rounding proposals were considered
- Option B, "Round to first digit" was selected
Details on Rounding Options Considered:
3 rounding proposals are in the comments of MODINVSTOR-468:
A) Round to magnitude:
about 10,000 | (3,000-29,999) |
about 100,000 | (30,000-299,999) |
about 1,000,000 | (300,000-2,999,999) |
about 10,000,000 | (3,000,000-29,999,999) |
B) Round to first digit:
about 2,000 | (1,500-2,499) |
about 3,000 | (2,500-3,499) |
about 4,000 | (3,500-4,499) |
about 5,000 | (4,500-5,499) |
about 6,000 | (5,500-6,499) |
about 7,000 | (6,500-7,499) |
about 8,000 | (7,500-8,499) |
about 9,000 | (8,500-9,499) |
about 10,000 | (9,500-14,999) |
about 20,000 | (15,000-24,999) |
about 30,000 | (25,000-34,999) |
C) Round first digit to 1, 2 or 5:
about 2,000 | (1,500-3,999) |
about 5,000 | (4,000-7,999) |
about 10,000 | (8,000-14,999) |
about 20,000 | (15,000-39,999) |
about 50,000 | (40,000-79,999) |
This issue is about deciding whether there should be a FOLIO standard for rounding, and if yes, which to choose, and whether the front-end or the back-end should round the number.
Proposed API as of July 28, 2020
If the back-end rounds it should also provide to original (non-rounded) estimate, for example
totalRecords: 1431
totalRecordsRounded: 1000
totalRecordsEstimated: true
No rounding is needed for an exact number:
totalRecords: 1509
totalRecordsEstimated: false
https://github.com/folio-org/raml/blob/raml1.0/schemas/resultInfo.schema needs to be extended accordingly.
TestRail: Results
Attachments
Issue Links
- blocks
-
UXPROD-2695 Display Rounded Result Counts in Apps Using SearchAndSort (Inventory and Requests)
-
- Closed
-
-
UXPROD-2702 Display Rounded Result Counts in Apps Using SearchAndSortQuery (i.e. Users)
-
- Closed
-
- is blocked by
-
UXPROD-2806 Create Elasticsearch indexes for Inventory search
-
- Closed
-
- is defined by
-
RMB-578 Inform whether totalRecords is exact or an estimate
-
- Blocked
-
-
RMB-685 totalRecordsRounded
-
- Blocked
-
-
RMB-695 Add totalRecordsEstimated and totalRecordsRounded to resultInfo.schema
-
- Closed
-
- is duplicated by
-
UIU-1741 Changing patron group for one user doesn't change filter result count when result count is more than 1,000
-
- Closed
-
- relates to
-
MODINVSTOR-468 hitcount related issues in Q1
-
- Closed
-
-
UXPROD-2369 Wait for POC of Elastic Search - Implement exact hit count (when using PostgreSql)
-
- Closed
-
- mentioned in
-
Page Loading...