Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-12567

Enhance JSON Facet aggregation syntax to support a JSON Object based "type:func" form that supports local params

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 7.5, 8.0
    • None
    • None

    Description

      In SOLR-11709 I proposed adding an "expanded" JSON Object syntax for specifying aggregation stats, as a way to ultimately support applying domain changes to aggregations.

      Having since done more work with the implementation of aggregations and how they use SlotAcc(umulators) and how bucket sorting on aggregations work, I now realize that the goal of SOLR-11709 is pretty hard – but the idea of this "expanded syntax" would still be useful as a way to specify Local Params to the ValueSourceParser used for the aggregation – and would but stats on par with other "type" facets (syntactically).

      For things like relatedness(...) (or other user defined custom aggregations) it would allow for new optional configuration using "named" params w/o needing an unweildy function syntax (see comment#16466664 in SOLR-9480). But even for simple aggregations the expanded syntax may help folks with readability of expressions(w/o needing to resort to global params) ...

      Proposed syntax...

        "average_roi" : {
          "type": "func",
          "func": "avg(div($numer,$denom))",
          "numer": "mul(popularity,rating)",
          "denom": "mul(price,size)"
        }
      

      Attachments

        1. SOLR-12567.patch
          13 kB
          Chris M. Hostetter

        Issue Links

          Activity

            People

              hossman Chris M. Hostetter
              hossman Chris M. Hostetter
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: