[ 
https://issues.apache.org/jira/browse/SOLR-17477?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tim Owen updated SOLR-17477:
----------------------------
    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.

  was:
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.


> Allow plugin code to define custom aggregates
> ---------------------------------------------
>
>                 Key: SOLR-17477
>                 URL: https://issues.apache.org/jira/browse/SOLR-17477
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: Facet Module, Plugin system
>            Reporter: Tim Owen
>            Priority: Major
>
> 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.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to