Joel Bernstein created SOLR-6150:
------------------------------------

             Summary: Add new AnalyticsQuery to support pluggable analytics.
                 Key: SOLR-6150
                 URL: https://issues.apache.org/jira/browse/SOLR-6150
             Project: Solr
          Issue Type: New Feature
            Reporter: Joel Bernstein
            Assignee: Joel Bernstein
            Priority: Minor


It would be great if there was a clean simple approach to plugin custom 
analytics to Solr.

This ticket introduces the AnalyticsQuery class which makes this possible.

To add a custom analytic query you extend AnalyticsQuery and implement:
<code>
  public abstract DelegatingCollector getAnalyticsCollector(ResponseBuilder rb, 
IndexSearcher searcher);
</code>

This method returns a custom DelegatingCollector which handles the collection 
of the analytics.

The DelegatingCollector.finish() method can be used to conveniently finish your 
analytics and place the output onto the response.

The AnalyticsQuery also has a nifty constructor that allows you to pass in a 
MergeStrategy (see SOLR-5973). So, when you extend AnalyticsQuery you can pass 
in a custom MergeStrategy to handle merging of analytic output from the shards 
during a distributed search.

This design is a natural extension of the PostFilter framework. So you can 
plugin your AnalyticsQuery with a custom QParserPlugin, for example:
{code}
q=*:*&fq={!myanalytic param1=p1}
{code}

Just like PostFilters, AnalyticsQueries can be ordered using the "cost" 
parameter. This allows for analytic pipe-lining, where the result of one 
AnalyticsQuery can be pipe-lined to another AnalyticsQuery. 






--
This message was sent by Atlassian JIRA
(v6.2#6252)

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

Reply via email to