Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0, 6.0
    • Component/s: None
    • Labels:
      None

      Description

      The majority of the logic in StatsValuesFactory for dealing with stats over fields just uses the ValueSource API. There's very little reason we can't generalize this to support computing aggregate stats over any arbitrary function (or the scores from an arbitrary query).

      Example...

      stats.field={!func key=mean_rating mean=true}prod(user_rating,pow(editor_rating,2))
      

      ...would mean that we can compute a conceptual "rating" for each doc by multiplying the user_rating field by the square of the editor_rating field, and then we'd compute the mean of that "rating" across all docs in the set and return it as "mean_rating"

        Attachments

        1. SOLR-6354.patch
          55 kB
          Hoss Man
        2. SOLR-6354.patch
          49 kB
          Hoss Man
        3. SOLR-6354.patch
          15 kB
          Hoss Man
        4. TstStatsComponent.java
          19 kB
          Crawdaddy

          Issue Links

            Activity

              People

              • Assignee:
                hossman Hoss Man
                Reporter:
                hossman Hoss Man
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: