[ 
https://issues.apache.org/jira/browse/SOLR-7830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17508682#comment-17508682
 ] 

Tim Owen commented on SOLR-7830:
--------------------------------

I've attached the source file which is standalone and if you include that class 
in your plugin jar it should be loadable as an aggregate with

<valueSourceParser name="agg_topdocs" 
class="com.yourpackage.here.TopDocsAgg$Parser" />

Note, this code is written against 8.6.2 but it might well compile fine under 
later 8.x or later major versions with some minor fixes.

The downside of using this in a plugin is that it's not as convenient to use in 
json faceting, you have to use it in its function form e.g.

facet: \{ "sampledocument":"topdocs(null,0,2)" }

The functionality is the same, though, it's just that the original 
built-into-solr approach allows you to use topdocs as though it was another 
type of json facet like terms/range/query.

> topdocs facet function
> ----------------------
>
>                 Key: SOLR-7830
>                 URL: https://issues.apache.org/jira/browse/SOLR-7830
>             Project: Solr
>          Issue Type: New Feature
>          Components: Facet Module
>            Reporter: Yonik Seeley
>            Priority: Major
>         Attachments: ALT-SOLR-7830.patch, SOLR-7830.patch, SOLR-7830.patch, 
> TopDocsAgg.java
>
>
> A topdocs() facet function would return the top N documents per facet bucket.
> This would be a big step toward unifying grouping and the new facet module.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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

Reply via email to