Solr
  1. Solr
  2. SOLR-1622

Add aggregate Math capabilities to Solr above and beyond the StatsComponent

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: search
    • Labels:
      None

      Description

      It would be really cool if we could have a QueryComponent that enabled doing aggregating calculations on search results similar to what the StatsComponent does, but in a more generic way.

      I also think it makes sense to reuse some of the function query capabilities (like the parser, etc.).

      I imagine the interface might look like:

      math=true&func=recip(sum(A))
      

      This would calculate the reciprocal of the sum of the values in the field A. Then, you could do go across fields, too

      math=true&func=recip(sum(A, B, C))
      

      Which would sum the values across fields A, B and C.

      It is important to make the functions pluggable and reusable. Might be also nice to see if we can share the core calculations between function queries and this capability such that if someone adds a new aggregating function, it can also be used as a new Function query.
      Of course, we'd want plugin functions, too, so that people can plugin their own functions. After this is implemented, I think StatsComponent becomes a derivative of the new MathComponent.

        Issue Links

          Activity

          Steven Bower made changes -
          Field Original Value New Value
          Link This issue relates to SOLR-5302 [ SOLR-5302 ]
          Hide
          Ryan McKinley added a comment -

          we need one capability in the lucene FieldCache, and we could dump the legacy "SortedInt" stuff for good -that's simply the ability to tell of a document had a value or not

          FYI, this now exists in trunk – see: LUCENE-2649

          Show
          Ryan McKinley added a comment - we need one capability in the lucene FieldCache, and we could dump the legacy "SortedInt" stuff for good -that's simply the ability to tell of a document had a value or not FYI, this now exists in trunk – see: LUCENE-2649
          Hide
          Grant Ingersoll added a comment -

          Some notes from IRC:
          -cool - if you go into the stats stuff, dump the silly string based numerics (that we had to do in the past) and also make it per-segment

          • we need one capability in the lucene FieldCache, and we could dump the legacy "SortedInt" stuff for good
            -that's simply the ability to tell of a document had a value or not
          Show
          Grant Ingersoll added a comment - Some notes from IRC: -cool - if you go into the stats stuff, dump the silly string based numerics (that we had to do in the past) and also make it per-segment we need one capability in the lucene FieldCache, and we could dump the legacy "SortedInt" stuff for good -that's simply the ability to tell of a document had a value or not
          Hide
          Grant Ingersoll added a comment -

          Sure, if we can get a patch for it. As of now, though, no patch, so no 1.5.

          Show
          Grant Ingersoll added a comment - Sure, if we can get a patch for it. As of now, though, no patch, so no 1.5.
          Hide
          Randy Prager added a comment -

          any thought on having this as part of 1.5?

          Show
          Randy Prager added a comment - any thought on having this as part of 1.5?
          Grant Ingersoll created issue -

            People

            • Assignee:
              Unassigned
              Reporter:
              Grant Ingersoll
            • Votes:
              5 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:

                Development