mirror of https://github.com/apache/lucene.git
Document how to load your own streaming plugins (#1025)
This commit is contained in:
parent
37512dad48
commit
537862d5bb
|
@ -61,6 +61,19 @@ import org.slf4j.LoggerFactory;
|
|||
import static org.apache.solr.common.params.CommonParams.ID;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Solr Request Handler for streaming data.
|
||||
* </p>
|
||||
* <p>
|
||||
* It loads a default set of mappings via {@link org.apache.solr.handler.SolrDefaultStreamFactory}.
|
||||
* </p>
|
||||
* <p>
|
||||
* To add additional mappings, just define them as plugins in solrconfig.xml via
|
||||
* {@code
|
||||
* <expressible name="count" class="org.apache.solr.client.solrj.io.stream.RecordCountStream" />
|
||||
* }
|
||||
* </p>
|
||||
*
|
||||
* @since 5.1.0
|
||||
*/
|
||||
public class StreamHandler extends RequestHandlerBase implements SolrCoreAware, PermissionNameProvider {
|
||||
|
@ -83,17 +96,6 @@ public class StreamHandler extends RequestHandlerBase implements SolrCoreAware,
|
|||
}
|
||||
|
||||
public void inform(SolrCore core) {
|
||||
|
||||
/*
|
||||
* The stream factory will always contain the zkUrl for the given collection Adds default streams with their
|
||||
* corresponding function names. These defaults can be overridden or added to in the solrConfig in the stream
|
||||
* RequestHandler def. Example config override
|
||||
* <lst name="streamFunctions">
|
||||
* <str name="group">org.apache.solr.client.solrj.io.stream.ReducerStream</str>
|
||||
* <str name="count">org.apache.solr.client.solrj.io.stream.RecordCountStream</str>
|
||||
* </lst>
|
||||
*/
|
||||
|
||||
String defaultCollection;
|
||||
String defaultZkhost;
|
||||
CoreContainer coreContainer = core.getCoreContainer();
|
||||
|
|
|
@ -123,6 +123,16 @@ for the entire expression, it may be faster for the client to send the expressio
|
|||
`&streamLocalOnly=true` and handle merging of the results (if required) locally. This is an advanced option, relying
|
||||
on a convenient organization of the index, and should only be considered if normal usage poses a performance issue.
|
||||
|
||||
=== Adding Custom Expressions
|
||||
|
||||
Creating your own custom expressions can be easily done by implementing the {solr-javadocs}/solr-solrj/org/apache/solr/client/solrj/io/stream/expr/Expressible.html[Expressible] interface. To add a custom expression to the
|
||||
list of known mappings for the `/stream` handler, you just need to declare it as a plugin in `solrconfig.xml` via:
|
||||
|
||||
[source,xml]
|
||||
<expressible name="custom" class="org.example.CustomStreamingExpression"/>
|
||||
|
||||
|
||||
|
||||
== Types of Streaming Expressions
|
||||
|
||||
=== About Stream Sources
|
||||
|
|
Loading…
Reference in New Issue