Uploaded image for project: 'UX Product'
  1. UX Product
  2. UXPROD-2623

Wait for POC of Elastic Search - Round estimated search result hit count (totalRecords)

    XMLWordPrintable

    Details

    • Template:
      UXPROD features
    • Development Team:
      Core: Platform
    • Calculated Total Rank:
      30
    • PO Ranking Note:
      CW: This feature is in an undecided state, due to awaiting the outcome of the POC of using Elastic Search in Inventory.
    • Rank: Chicago (MVP Sum 2020):
      R2
    • Rank: Cornell (Full Sum 2021):
      R1
    • Rank: Duke (Full Sum 2021):
      R1
    • Rank: TAMU (MVP Jan 2021):
      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:

      1. 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"
      2. 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

              Activity

                People

                Assignee:
                jakub Jakub Skoczen
                Reporter:
                julianladisch Julian Ladisch
                Votes:
                0 Vote for this issue
                Watchers:
                20 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    TestRail: Runs

                      TestRail: Cases