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

Allow plugin code to define custom aggregates

    XMLWordPrintableJSON

Details

    Description

      Continuing the work done in SOLR-8673 and also addressing a TODO in the code, I've worked on making it easier for custom plugin code to define aggregates to be used in Json Faceting.

      Currently you can mostly define a custom ValueSourceParser and AggValueSource in plugin code (i.e. outside of the org.apache.solr.search.facet package) but there are still some classes and fields that are not public or protected which make it hard to write a sortable aggregate or use some of the useful built-in SlotAcc implementations.

      Another current limitation is that you can only call a custom aggregate by using the simple functional style syntax e.g. "mycalc":"myagg(somefield,2)" and not the json structured style e.g. it would be good to be able to support "mycalc":

      { type:myagg, f:somefield, limit:2 }

      instead. There is a TODO in the code to support the registration of these types.

      PR addresses these and has been tested using a custom plugin to check it all works together. This allowed us to move a lot of our custom code out of our local Solr build and into a plugin.

      Attachments

        Issue Links

          Activity

            People

              mkhl Mikhail Khludnev
              TimOwen Tim Owen
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 4.5h
                  4.5h