mirror of
https://github.com/apache/lucene.git
synced 2025-02-10 03:55:46 +00:00
SOLR-13965: In GraphHandler, support <expressible> configuration and deprecate <streamFunctions> configuration.
(Eric Pugh via Christine Poerschke) Closes #1033 pull request.
This commit is contained in:
parent
570109f73d
commit
a5e372369c
@ -26,6 +26,9 @@ New Features
|
||||
|
||||
* SOLR-14241: New delete() Stream Decorator (hossman)
|
||||
|
||||
* SOLR-13965: In GraphHandler, support <expressible> configuration and deprecate <streamFunctions> configuration.
|
||||
(Eric Pugh via Christine Poerschke)
|
||||
|
||||
Improvements
|
||||
---------------------
|
||||
* SOLR-14120: Define JavaScript methods 'includes' and 'startsWith' to ensure AdminUI can be displayed when using
|
||||
|
@ -54,6 +54,28 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Solr Request Handler for graph traversal with streaming functions that responds with GraphML markup.
|
||||
* </p>
|
||||
* <p>
|
||||
* It loads the default set of streaming expression functions via {@link org.apache.solr.client.solrj.io.stream.expr.DefaultStreamFactory}.
|
||||
* </p>
|
||||
* <p>
|
||||
* To add additional functions, just define them as plugins in solrconfig.xml via
|
||||
* {@code
|
||||
* <expressible name="count" class="org.apache.solr.client.solrj.io.stream.RecordCountStream" />
|
||||
* }
|
||||
* </p>
|
||||
* <p>
|
||||
* The @deprecated configuration method as of Solr 8.5 is
|
||||
* {@code
|
||||
* <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>
|
||||
* }
|
||||
*</p>
|
||||
*
|
||||
* @since 6.1.0
|
||||
*/
|
||||
public class GraphHandler extends RequestHandlerBase implements SolrCoreAware, PermissionNameProvider {
|
||||
@ -68,17 +90,6 @@ public class GraphHandler extends RequestHandlerBase implements SolrCoreAware, P
|
||||
}
|
||||
|
||||
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();
|
||||
@ -92,8 +103,12 @@ public class GraphHandler extends RequestHandlerBase implements SolrCoreAware, P
|
||||
}
|
||||
|
||||
// This pulls all the overrides and additions from the config
|
||||
StreamHandler.addExpressiblePlugins(streamFactory, core);
|
||||
|
||||
// Check deprecated approach.
|
||||
Object functionMappingsObj = initArgs.get("streamFunctions");
|
||||
if(null != functionMappingsObj){
|
||||
log.warn("solrconfig.xml: <streamFunctions> is deprecated for adding additional streaming functions to GraphHandler.");
|
||||
NamedList<?> functionMappings = (NamedList<?>)functionMappingsObj;
|
||||
for(Entry<String,?> functionMapping : functionMappings) {
|
||||
String key = functionMapping.getKey();
|
||||
|
@ -126,10 +126,10 @@ The value of `shards.preference` that is used to route requests is determined in
|
||||
=== 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:
|
||||
list of known mappings for the `/stream` and `/graph` handlers, you just need to declare it as a plugin in `solrconfig.xml` via:
|
||||
|
||||
[source,xml]
|
||||
<expressible name="custom" class="org.example.CustomStreamingExpression"/>
|
||||
<expressible name="custom" class="org.example.CustomStreamingExpression"/>
|
||||
|
||||
== Types of Streaming Expressions
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user