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

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

There's 2 ways to invoke this, hence 2 kinds of parser in that code: the 
function syntax one (which is supported whether it's in solr core or a plugin) 
and the json approach (which only works if the code is built into solr, because 
it hooks into the json facet parsing). So I just meant that if you're using 
this via a plugin, you have to use the function syntax.

There's an example of this json alternative in Yonik's first comment in this 
ticket, where he has a facet with type:topdocs and the parameters written in 
json. As his comment says "This is the first facet function / aggregation that 
supports JSON rather than just function query notation" but that's only true if 
the patch is in solr core - we lose that ability if it's a plugin because 
there's no way to hook custom code into the json parsing (so far).

So for use in a plugin, you just have to write it function style i.e. 
"sampledocument":"topdocs(...)"

p.s. I mistakenly said I'd built this against 8.6.2 but actually that should be 
8.8 which is when the changes to allow plugins to do custom aggregates was 
actually available.

> 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