diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 68b61331a79..2fec97d6129 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -96,6 +96,10 @@ Deprecation Removals * SOLR-17576: Remove deprecated master/slave option language from ReplicationHandler. (Eric Pugh) +* SOLR-16781: Support for `` directives (used in solrconfig.xml to add JARs on a core-by-core basis) has been removed. Users + looking for similar functionality can use Solr's package manager. Users that don't need to vary JAR access on a per-core basis + have many options, including the `` tag and directly modifying Solr's classpath prior to JVM startup. (Jason Gerlowski) + Dependency Upgrades --------------------- (No changes) diff --git a/solr/core/src/java/org/apache/solr/cli/RunExampleTool.java b/solr/core/src/java/org/apache/solr/cli/RunExampleTool.java index 783d58e0a57..50c0162881a 100644 --- a/solr/core/src/java/org/apache/solr/cli/RunExampleTool.java +++ b/solr/core/src/java/org/apache/solr/cli/RunExampleTool.java @@ -647,6 +647,11 @@ protected Map startSolr( if (!isWindows && cwdPath.length() > 1 && solrHome.startsWith(cwdPath)) solrHome = solrHome.substring(cwdPath.length() + 1); + final var syspropArg = + ("techproducts".equals(cli.getOptionValue(EXAMPLE_OPTION))) + ? "-Dsolr.modules=clustering,extraction,langid,ltr,scripting -Dsolr.ltr.enabled=true -Dsolr.clustering.enabled=true" + : ""; + String startCmd = String.format( Locale.ROOT, @@ -661,7 +666,8 @@ protected Map startSolr( forceArg, verboseArg, extraArgs, - jvmOptsArg); + jvmOptsArg, + syspropArg); startCmd = startCmd.replaceAll("\\s+", " ").trim(); // for pretty printing echo("\nStarting up Solr on port " + port + " using command:"); diff --git a/solr/core/src/java/org/apache/solr/core/ConfigSetService.java b/solr/core/src/java/org/apache/solr/core/ConfigSetService.java index 53160cd75ee..a9f9b417abf 100644 --- a/solr/core/src/java/org/apache/solr/core/ConfigSetService.java +++ b/solr/core/src/java/org/apache/solr/core/ConfigSetService.java @@ -272,7 +272,7 @@ public final ConfigSet loadConfigSet(CoreDescriptor dcore) { NamedList properties = loadConfigSetProperties(dcore, coreLoader); boolean trusted = isConfigSetTrusted(coreLoader); - SolrConfig solrConfig = createSolrConfig(dcore, coreLoader, trusted); + SolrConfig solrConfig = createSolrConfig(dcore, coreLoader); return new ConfigSet( configSetName(dcore), solrConfig, @@ -314,13 +314,12 @@ public ConfigSetService(SolrResourceLoader loader, boolean shareSchema) { * * @param cd the core's CoreDescriptor * @param loader the core's resource loader - * @param isTrusted is the configset trusted? * @return a SolrConfig object */ - protected SolrConfig createSolrConfig( - CoreDescriptor cd, SolrResourceLoader loader, boolean isTrusted) throws IOException { + protected SolrConfig createSolrConfig(CoreDescriptor cd, SolrResourceLoader loader) + throws IOException { return SolrConfig.readFromResourceLoader( - loader, cd.getConfigName(), isTrusted, cd.getSubstitutableProperties()); + loader, cd.getConfigName(), cd.getSubstitutableProperties()); } /** diff --git a/solr/core/src/java/org/apache/solr/core/SolrConfig.java b/solr/core/src/java/org/apache/solr/core/SolrConfig.java index b3c95a23fe7..e7adaf8d2f6 100644 --- a/solr/core/src/java/org/apache/solr/core/SolrConfig.java +++ b/solr/core/src/java/org/apache/solr/core/SolrConfig.java @@ -17,7 +17,6 @@ package org.apache.solr.core; import static org.apache.solr.common.params.CommonParams.NAME; -import static org.apache.solr.common.params.CommonParams.PATH; import static org.apache.solr.core.ConfigOverlay.ZNODEVER; import static org.apache.solr.core.SolrConfig.PluginOpts.LAZY; import static org.apache.solr.core.SolrConfig.PluginOpts.MULTI_OK; @@ -31,7 +30,6 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.lang.invoke.MethodHandles; -import java.net.MalformedURLException; import java.net.URL; import java.nio.file.Files; import java.nio.file.Path; @@ -96,7 +94,7 @@ /** * Provides a static reference to a Config object modeling the main configuration data for a Solr - * instance -- typically found in "solrconfig.xml". + * core -- typically found in "solrconfig.xml". */ public class SolrConfig implements MapSerializable { @@ -143,16 +141,13 @@ public enum PluginOpts { * @param name the configuration name used by the loader if the stream is null */ public SolrConfig(Path instanceDir, String name) throws IOException { - this(new SolrResourceLoader(instanceDir), name, true, null); + this(new SolrResourceLoader(instanceDir), name, null); } public static SolrConfig readFromResourceLoader( - SolrResourceLoader loader, - String name, - boolean isConfigsetTrusted, - Properties substitutableProperties) { + SolrResourceLoader loader, String name, Properties substitutableProperties) { try { - return new SolrConfig(loader, name, isConfigsetTrusted, substitutableProperties); + return new SolrConfig(loader, name, substitutableProperties); } catch (Exception e) { String resource; if (loader instanceof ZkSolrResourceLoader) { @@ -196,15 +191,9 @@ public InputStream apply(String s) { * * @param loader the resource loader * @param name the configuration name - * @param isConfigsetTrusted false if configset was uploaded using unsecured configset upload API, - * true otherwise * @param substitutableProperties optional properties to substitute into the XML */ - private SolrConfig( - SolrResourceLoader loader, - String name, - boolean isConfigsetTrusted, - Properties substitutableProperties) { + private SolrConfig(SolrResourceLoader loader, String name, Properties substitutableProperties) { this.resourceLoader = loader; this.resourceName = name; this.substituteProperties = substitutableProperties; @@ -237,7 +226,7 @@ private SolrConfig( rootDataHashCode = this.root.txt().hashCode(); getRequestParams(); - initLibs(loader, isConfigsetTrusted); + initLibs(loader); String val = root.child( IndexSchema.LUCENE_MATCH_VERSION_PARAM, @@ -934,11 +923,10 @@ public PluginInfo getPluginInfo(String type) { SolrException.ErrorCode.SERVER_ERROR, "Multiple plugins configured for type: " + type); } - private void initLibs(SolrResourceLoader loader, boolean isConfigsetTrusted) { + private void initLibs(SolrResourceLoader loader) { // TODO Want to remove SolrResourceLoader.getInstancePath; it can be on a Standalone subclass. // For Zk subclass, it's needed for the time being as well. We could remove that one if we - // remove two things in SolrCloud: (1) instancePath/lib and (2) solrconfig lib directives with - // relative paths. Can wait till 9.0. + // remove "instancePath/lib" in SolrCloud. Can wait till 9.0. Path instancePath = loader.getInstancePath(); List urls = new ArrayList<>(); @@ -950,48 +938,15 @@ private void initLibs(SolrResourceLoader loader, boolean isConfigsetTrusted) { log.warn("Couldn't add files from {} to classpath: {}", libPath, e); } } - - List nodes = root.getAll("lib"); - if (nodes != null && nodes.size() > 0) { - if (!isConfigsetTrusted) { - throw new SolrException( - ErrorCode.UNAUTHORIZED, - "The configset for this collection was uploaded without any authentication in place," - + " and use of is not available for collections with untrusted configsets. To use this component, re-upload the configset" - + " after enabling authentication and authorization."); - } - - for (int i = 0; i < nodes.size(); i++) { - ConfigNode node = nodes.get(i); - String baseDir = node.attr("dir"); - String path = node.attr(PATH); - if (null != baseDir) { - // :TODO: add support for a simpler 'glob' mutually exclusive of regex - Path dir = instancePath.resolve(baseDir); - String regex = node.attr("regex"); - try { - if (regex == null) urls.addAll(SolrResourceLoader.getURLs(dir)); - else urls.addAll(SolrResourceLoader.getFilteredURLs(dir, regex)); - } catch (IOException e) { - log.warn("Couldn't add files from {} filtered by {} to classpath: {}", dir, regex, e); - } - } else if (null != path) { - final Path dir = instancePath.resolve(path); - try { - urls.add(dir.toUri().toURL()); - } catch (MalformedURLException e) { - log.warn("Couldn't add file {} to classpath: {}", dir, e); - } - } else { - throw new RuntimeException("lib: missing mandatory attributes: 'dir' or 'path'"); - } - } - } - if (!urls.isEmpty()) { loader.addToClassLoader(urls); loader.reloadLuceneSPI(); } + + List nodes = root.getAll("lib"); + if (nodes != null && nodes.size() > 0) { + log.warn(" entries no longer supported in solrconfig.xml; ignoring..."); + } } public int getMultipartUploadLimitKB() { diff --git a/solr/core/src/java/org/apache/solr/handler/designer/SchemaDesignerAPI.java b/solr/core/src/java/org/apache/solr/handler/designer/SchemaDesignerAPI.java index f34793aa744..1370c775540 100644 --- a/solr/core/src/java/org/apache/solr/handler/designer/SchemaDesignerAPI.java +++ b/solr/core/src/java/org/apache/solr/handler/designer/SchemaDesignerAPI.java @@ -254,7 +254,7 @@ public void updateFileContents(SolrQueryRequest req, SolrQueryResponse rsp) try { InMemoryResourceLoader loader = new InMemoryResourceLoader(coreContainer, mutableId, SOLR_CONFIG_XML, data); - SolrConfig.readFromResourceLoader(loader, SOLR_CONFIG_XML, requestIsTrusted, null); + SolrConfig.readFromResourceLoader(loader, SOLR_CONFIG_XML, null); } catch (Exception exc) { updateFileError = exc; } diff --git a/solr/core/src/java/org/apache/solr/handler/designer/SchemaDesignerConfigSetHelper.java b/solr/core/src/java/org/apache/solr/handler/designer/SchemaDesignerConfigSetHelper.java index 0b14b0d4cf4..955aa1d98a9 100644 --- a/solr/core/src/java/org/apache/solr/handler/designer/SchemaDesignerConfigSetHelper.java +++ b/solr/core/src/java/org/apache/solr/handler/designer/SchemaDesignerConfigSetHelper.java @@ -677,9 +677,7 @@ ManagedIndexSchema deleteNestedDocsFieldsIfNeeded(ManagedIndexSchema schema, boo SolrConfig loadSolrConfig(String configSet) { ZkSolrResourceLoader zkLoader = zkLoaderForConfigSet(configSet); - boolean trusted = isConfigSetTrusted(configSet); - - return SolrConfig.readFromResourceLoader(zkLoader, SOLR_CONFIG_XML, trusted, null); + return SolrConfig.readFromResourceLoader(zkLoader, SOLR_CONFIG_XML, null); } ManagedIndexSchema loadLatestSchema(String configSet) { diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-test-misc.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-test-misc.xml index 1020db8319e..cbfe9752574 100644 --- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-test-misc.xml +++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-test-misc.xml @@ -28,12 +28,6 @@ - - - - - - prefix-${solr.test.sys.prop2}-suffix diff --git a/solr/core/src/test-files/solr/configsets/upload/with-lib-directive/managed-schema.xml b/solr/core/src/test-files/solr/configsets/upload/with-lib-directive/managed-schema.xml deleted file mode 100644 index 25a37e6eee3..00000000000 --- a/solr/core/src/test-files/solr/configsets/upload/with-lib-directive/managed-schema.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - diff --git a/solr/core/src/test-files/solr/configsets/upload/with-lib-directive/solrconfig.xml b/solr/core/src/test-files/solr/configsets/upload/with-lib-directive/solrconfig.xml deleted file mode 100644 index 315bfffbf6c..00000000000 --- a/solr/core/src/test-files/solr/configsets/upload/with-lib-directive/solrconfig.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - ${solr.data.dir:} - - - - ${tests.luceneMatchVersion:LATEST} - - - - - - explicit - true - text - - - - - - - diff --git a/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java b/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java index b41d698ac4c..01614b7218e 100644 --- a/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java +++ b/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java @@ -1421,48 +1421,6 @@ public void testUploadWithScriptUpdateProcessor() throws Exception { scriptRequest("newcollection2"); } - @Test - public void testUploadWithLibDirective() throws Exception { - final String untrustedSuffix = "-untrusted"; - uploadConfigSetWithAssertions("with-lib-directive", untrustedSuffix, null); - // try to create a collection with the uploaded configset - ignoreException("without any authentication in place"); - Throwable thrown = - expectThrows( - SolrClient.RemoteSolrException.class, - () -> { - createCollection( - "newcollection3", - "with-lib-directive" + untrustedSuffix, - 1, - 1, - cluster.getSolrClient()); - }); - unIgnoreException("without any authentication in place"); - - assertThat(thrown.getMessage(), containsString("Underlying core creation failed")); - - // Authorization on - final String trustedSuffix = "-trusted"; - uploadConfigSetWithAssertions("with-lib-directive", trustedSuffix, "solr"); - // try to create a collection with the uploaded configset - CollectionAdminResponse resp = - createCollection( - "newcollection3", "with-lib-directive" + trustedSuffix, 1, 1, cluster.getSolrClient()); - - SolrInputDocument doc = sdoc("id", "4055", "subject", "Solr"); - cluster.getSolrClient().add("newcollection3", doc); - cluster.getSolrClient().commit("newcollection3"); - assertEquals( - "4055", - cluster - .getSolrClient() - .query("newcollection3", params("q", "*:*")) - .getResults() - .get(0) - .get("id")); - } - @Test public void testUploadWithForbiddenContent() throws Exception { // Uploads a config set containing a script, a class file and jar file, will return 400 error diff --git a/solr/core/src/test/org/apache/solr/core/TestConfLoadPerf.java b/solr/core/src/test/org/apache/solr/core/TestConfLoadPerf.java index ee9177b2105..4c348104b35 100644 --- a/solr/core/src/test/org/apache/solr/core/TestConfLoadPerf.java +++ b/solr/core/src/test/org/apache/solr/core/TestConfLoadPerf.java @@ -84,7 +84,7 @@ public InputStream openResource(String resource) throws IOException { long startTime = System.currentTimeMillis(); int numReads = 100; for (int i = 0; i < numReads; i++) { - allConfigs.add(SolrConfig.readFromResourceLoader(srl, "solrconfig.xml", true, null)); + allConfigs.add(SolrConfig.readFromResourceLoader(srl, "solrconfig.xml", null)); } assertEquals(numReads, allConfigs.size()); System.gc(); diff --git a/solr/core/src/test/org/apache/solr/core/TestConfig.java b/solr/core/src/test/org/apache/solr/core/TestConfig.java index 2c17cbf1e1a..745fa21c4c5 100644 --- a/solr/core/src/test/org/apache/solr/core/TestConfig.java +++ b/solr/core/src/test/org/apache/solr/core/TestConfig.java @@ -45,20 +45,6 @@ public static void beforeClass() throws Exception { public void testLib() throws IOException { SolrResourceLoader loader = h.getCore().getResourceLoader(); InputStream data = null; - String[] expectedFiles = - new String[] { - "empty-file-main-lib.txt", - "empty-file-a1.txt", - "empty-file-a2.txt", - "empty-file-b1.txt", - "empty-file-b2.txt", - "empty-file-c1.txt" - }; - for (String f : expectedFiles) { - data = loader.openResource(f); - assertNotNull("Should have found file " + f, data); - data.close(); - } String[] unexpectedFiles = new String[] {"empty-file-c2.txt", "empty-file-d2.txt"}; for (String f : unexpectedFiles) { data = null; diff --git a/solr/core/src/test/org/apache/solr/core/TestMinimalConfig.java b/solr/core/src/test/org/apache/solr/core/TestMinimalConfig.java index 1efa74d2d03..b04420664e8 100644 --- a/solr/core/src/test/org/apache/solr/core/TestMinimalConfig.java +++ b/solr/core/src/test/org/apache/solr/core/TestMinimalConfig.java @@ -29,8 +29,7 @@ public static void beforeClass() throws Exception { initCore("solrconfig-minimal.xml", "schema-minimal.xml"); } - // Make sure the content of the lib/ core subfolder is loaded even if there is no node in - // the solrconfig + // Make sure the content of the lib/ core subfolder is loaded @Test public void testLib() throws IOException { SolrResourceLoader loader = h.getCore().getResourceLoader(); diff --git a/solr/core/src/test/org/apache/solr/schema/TestManagedSchemaThreadSafety.java b/solr/core/src/test/org/apache/solr/schema/TestManagedSchemaThreadSafety.java index bd452178f63..2cc881cecc2 100644 --- a/solr/core/src/test/org/apache/solr/schema/TestManagedSchemaThreadSafety.java +++ b/solr/core/src/test/org/apache/solr/schema/TestManagedSchemaThreadSafety.java @@ -183,8 +183,7 @@ private Runnable indexSchemaLoader(String configsetName, final ZkController zkCo try { SolrResourceLoader loader = new ZkSolrResourceLoader(loaderPath, configsetName, null, zkController); - SolrConfig solrConfig = - SolrConfig.readFromResourceLoader(loader, "solrconfig.xml", true, null); + SolrConfig solrConfig = SolrConfig.readFromResourceLoader(loader, "solrconfig.xml", null); ManagedIndexSchemaFactory factory = new ManagedIndexSchemaFactory(); factory.init(new NamedList<>()); diff --git a/solr/example/README.md b/solr/example/README.md index 09bb2dfb277..f0c8e46a4be 100644 --- a/solr/example/README.md +++ b/solr/example/README.md @@ -73,18 +73,6 @@ For a list of other tutorials and introductory articles. Notes About These Examples -------------------------- -### References to Jar Files Outside This Directory - -Various example SolrHome dirs contained in this directory may use "" -statements in the solrconfig.xml file to reference plugin jars outside of -this directory for loading modules via relative paths. - -If you make a copy of this example server and wish to use the -ExtractingRequestHandler (SolrCell), the clustering component, -or any other modules, you will need to -copy the required jars or update the paths to those jars in your -solrconfig.xml. - ### Logging By default, Jetty & Solr will log to the console and logs/solr.log. This can diff --git a/solr/modules/ltr/src/test-files/solr/collection1/conf/solrconfig-ltr.xml b/solr/modules/ltr/src/test-files/solr/collection1/conf/solrconfig-ltr.xml index b863d61728c..c20ee2026f6 100644 --- a/solr/modules/ltr/src/test-files/solr/collection1/conf/solrconfig-ltr.xml +++ b/solr/modules/ltr/src/test-files/solr/collection1/conf/solrconfig-ltr.xml @@ -16,9 +16,6 @@ - - - diff --git a/solr/solr-ref-guide/modules/configuration-guide/pages/config-sets.adoc b/solr/solr-ref-guide/modules/configuration-guide/pages/config-sets.adoc index 57707e94c6e..b44c8a82825 100644 --- a/solr/solr-ref-guide/modules/configuration-guide/pages/config-sets.adoc +++ b/solr/solr-ref-guide/modules/configuration-guide/pages/config-sets.adoc @@ -39,7 +39,7 @@ The Configsets API has some other operations as well, and likewise, so does the To upload a file to a configset already stored on ZooKeeper, you can use xref:deployment-guide:solr-control-script-reference.adoc#copy-between-local-files-and-zookeeper-znodes[`bin/solr zk cp`]. CAUTION: By default, ZooKeeper's file size limit is 1MB. -If your files are larger than this, you'll need to either xref:deployment-guide:zookeeper-ensemble.adoc#increasing-the-file-size-limit[increase the ZooKeeper file size limit] or store them xref:libs.adoc#lib-directives-in-solrconfig[on the filesystem] of every node in a cluster. +If your files are larger than this, you'll need to either xref:deployment-guide:zookeeper-ensemble.adoc#increasing-the-file-size-limit[increase the ZooKeeper file size limit] or store them xref:libs.adoc[on the filesystem] of every node in a cluster. === Forbidden File Types diff --git a/solr/solr-ref-guide/modules/configuration-guide/pages/configsets-api.adoc b/solr/solr-ref-guide/modules/configuration-guide/pages/configsets-api.adoc index 45987271de6..1a5dc43fe48 100644 --- a/solr/solr-ref-guide/modules/configuration-guide/pages/configsets-api.adoc +++ b/solr/solr-ref-guide/modules/configuration-guide/pages/configsets-api.adoc @@ -97,8 +97,6 @@ Upon creation of a collection using an "untrusted" configset, the following func * The XSLT transformer (`tr` parameter) cannot be used at request processing time. * If specified in the configset, the ScriptUpdateProcessorFactory will not initialize. -* Collections won't initialize if directives are used in the configset. -(Note: Libraries added to Solr's classpath don't need the directive) If you use any of these parameters or features, you must have enabled security features in your Solr installation and you must upload the configset as an authenticated user. diff --git a/solr/solr-ref-guide/modules/configuration-guide/pages/configuring-solr-xml.adoc b/solr/solr-ref-guide/modules/configuration-guide/pages/configuring-solr-xml.adoc index 549753d5f3a..13c90737ffe 100644 --- a/solr/solr-ref-guide/modules/configuration-guide/pages/configuring-solr-xml.adoc +++ b/solr/solr-ref-guide/modules/configuration-guide/pages/configuring-solr-xml.adoc @@ -253,8 +253,7 @@ Note that specifying `sharedLib` will not remove `$SOLR_HOME/lib` from Solr's cl + Takes a list of bundled xref:solr-modules.adoc[] to enable on startup. This way of adding modules will add them to the shared class loader, making them -available to every collection in Solr, unlike `` tag in `solrconfig.xml` which is only -for that one collection. Example value: `extracting,ltr`. See the +available to every collection in Solr. Example value: `extracting,ltr`. See the xref:solr-modules.adoc[Solr Modules] chapter for more details. `allowPaths`:: @@ -506,7 +505,7 @@ Optional parameter to provide a compression implementation for state.json over t |=== + The class to use for logging. -The corresponding JAR file must be available to Solr, perhaps through a `` directive in `solrconfig.xml`. +The corresponding JAR file must be available to Solr, perhaps through a `` directive. `enabled`:: + diff --git a/solr/solr-ref-guide/modules/configuration-guide/pages/configuring-solrconfig-xml.adoc b/solr/solr-ref-guide/modules/configuration-guide/pages/configuring-solrconfig-xml.adoc index 3680b928896..324a1fdd09e 100644 --- a/solr/solr-ref-guide/modules/configuration-guide/pages/configuring-solrconfig-xml.adoc +++ b/solr/solr-ref-guide/modules/configuration-guide/pages/configuring-solrconfig-xml.adoc @@ -49,7 +49,6 @@ The `solrconfig.xml` file is located in the `conf/` directory for each collectio Several well-commented example files can be found in the `server/solr/configsets/` directories demonstrating best practices for many different types of installations. Some `solrconfig.xml` aspects are documented in other sections. -See xref:libs.adoc#lib-directives-in-solrconfig[lib directives in SolrConfig], which can be used for both Plugins and Resources. **** // This tags the below list so it can be used in the parent page section list diff --git a/solr/solr-ref-guide/modules/configuration-guide/pages/libs.adoc b/solr/solr-ref-guide/modules/configuration-guide/pages/libs.adoc index 269e56f4169..2ad86d6355b 100644 --- a/solr/solr-ref-guide/modules/configuration-guide/pages/libs.adoc +++ b/solr/solr-ref-guide/modules/configuration-guide/pages/libs.adoc @@ -47,32 +47,3 @@ Certain plugins or add-ons to plugins require placement here, and they will have Solr incorporates Jetty for providing HTTP server functionality. Jetty has some directories that contain `.jar` files for itself and its own plugins / modules or JVM level plugins (e.g., loggers). Solr plugins won't work in these locations. - -== Lib Directives in SolrConfig - -_Both_ plugin and xref:resource-loading.adoc[resource] file paths are configurable via `` directives in `solrconfig.xml`. -When a directive matches a directory, then resources can be resolved from it. -When a directive matches a `.jar` file, Solr plugins and their dependencies are resolved from it. -Resources can be placed in a `.jar` too but that's unusual. -It's erroneous to refer to any other type of file. - -A `` directive must have one (not both) of these two attributes: - -* `path`: used to refer to a single directory (for resources) or file (for a plugin `.jar`) - -* `dir`: used to refer to _all_ direct descendants of the specified directory. Optionally supply a `regex` attribute to filter these to those matching the regular expression. - -All directories are resolved as relative to the Solr core's `instanceDir`. - -These examples show how to load modules into Solr: - -[source,xml] ----- - - - - - - - ----- diff --git a/solr/solr-ref-guide/modules/configuration-guide/pages/resource-loading.adoc b/solr/solr-ref-guide/modules/configuration-guide/pages/resource-loading.adoc index bcdbe17c5ef..3825f362de0 100644 --- a/solr/solr-ref-guide/modules/configuration-guide/pages/resource-loading.adoc +++ b/solr/solr-ref-guide/modules/configuration-guide/pages/resource-loading.adoc @@ -37,10 +37,5 @@ Prefer to put resources here. == Resources in Other Places -Resources can also be placed in an arbitrary directory and xref:libs.adoc#lib-directives-in-solrconfig[referenced] from a `` directive in `solrconfig.xml`, provided the directive refers to a directory and not the actual resource file. -Example: `` -This choice may make sense if the resource is too large for a configset in ZooKeeper. -However it's up to you to somehow ensure that all nodes in your cluster have access to these resources. - Finally, and this is very unusual, resources can also be packaged inside `.jar` files from which they will be referenced. That might make sense for default resources wherein a plugin user can override it via placing the same-named file in a configSet. diff --git a/solr/solr-ref-guide/modules/configuration-guide/pages/solr-modules.adoc b/solr/solr-ref-guide/modules/configuration-guide/pages/solr-modules.adoc index 93a5f0b4ff6..99740b32db1 100644 --- a/solr/solr-ref-guide/modules/configuration-guide/pages/solr-modules.adoc +++ b/solr/solr-ref-guide/modules/configuration-guide/pages/solr-modules.adoc @@ -45,10 +45,5 @@ You can also specify the modules to include when using the Solr CLI to start Sol bin/solr start -e techproducts -Dsolr.modules=scripting ---- -NOTE: If you only wish to enable a module for certain collections, you may add `` tags to `solrconfig.xml` in applicable configset(s). -as explained in xref:configuration-guide:libs.adoc[Lib Directories]. -Collection-level plugins will work if the module is enabled either per collection (``) or for the whole Solr node. -Node-level plugins such as those specified in `solr.xml` will not work when using the `` option in `solrconfig.xml` because configsets configure collections, not the node. They must be enabled for the entire Solr node, as described above. - Some modules may have been made available as packages for the xref:configuration-guide:package-manager.adoc[Package Manager], check by listing available packages. diff --git a/solr/solr-ref-guide/modules/configuration-guide/pages/update-request-processors.adoc b/solr/solr-ref-guide/modules/configuration-guide/pages/update-request-processors.adoc index 8ac9faf031f..3abebae9747 100644 --- a/solr/solr-ref-guide/modules/configuration-guide/pages/update-request-processors.adoc +++ b/solr/solr-ref-guide/modules/configuration-guide/pages/update-request-processors.adoc @@ -424,7 +424,7 @@ The {solr-javadocs}/modules/langid/index.html[`langid`] module provides:: The {solr-javadocs}/modules/analysis-extras/index.html[`analysis-extras`] module provides:: {solr-javadocs}/modules/analysis-extras/org/apache/solr/update/processor/OpenNLPExtractNamedEntitiesUpdateProcessorFactory.html[OpenNLPExtractNamedEntitiesUpdateProcessorFactory]::: Update document(s) to be indexed with named entities extracted using an OpenNLP NER model. -Note that in order to use model files larger than 1MB on SolrCloud, you must either xref:deployment-guide:zookeeper-ensemble#increasing-the-file-size-limit[configure both ZooKeeper server and clients] or xref:libs.adoc#lib-directives-in-solrconfig[store the model files on the filesystem] on each node hosting a collection replica. +Note that in order to use model files larger than 1MB on SolrCloud, you must xref:deployment-guide:zookeeper-ensemble#increasing-the-file-size-limit[configure both ZooKeeper server and clients]. === Update Processor Factories You Should _Not_ Modify or Remove diff --git a/solr/solr-ref-guide/modules/deployment-guide/pages/rule-based-authorization-plugin.adoc b/solr/solr-ref-guide/modules/deployment-guide/pages/rule-based-authorization-plugin.adoc index 2d4c528c20e..7e99462bc96 100644 --- a/solr/solr-ref-guide/modules/deployment-guide/pages/rule-based-authorization-plugin.adoc +++ b/solr/solr-ref-guide/modules/deployment-guide/pages/rule-based-authorization-plugin.adoc @@ -401,7 +401,6 @@ If edit permissions should only be applied to specific collections, a custom per Note that this allows schema read permissions for _all_ collections. If read permissions should only be applied to specific collections, a custom permission would need to be created. * *config-edit*: this permission is allowed to edit a collection's configuration using the xref:configuration-guide:config-api.adoc[], the xref:configuration-guide:request-parameters-api.adoc[], and other APIs which modify `configoverlay.json`. -Because configs xref:configuration-guide:libs.adoc#lib-directives-in-solrconfig[can add libraries/custom code] from various locations, loading any new code via a trusted SolrConfig is explicitly allowed for users with this permission. Note that this allows configuration edit permissions for _all_ collections. If edit permissions should only be applied to specific collections, a custom permission would need to be created. * *config-read*: this permission is allowed to read a collection's configuration using the xref:configuration-guide:config-api.adoc[], the xref:configuration-guide:request-parameters-api.adoc[], xref:configuration-guide:configsets-api.adoc#configsets-list[Configsets API], the Admin UI's xref:configuration-guide:configuration-files.adoc#files-screen[Files Screen], and other APIs accessing configuration. diff --git a/solr/solr-ref-guide/modules/indexing-guide/pages/indexing-with-tika.adoc b/solr/solr-ref-guide/modules/indexing-guide/pages/indexing-with-tika.adoc index b1344ed5519..b0cdb7eba30 100644 --- a/solr/solr-ref-guide/modules/indexing-guide/pages/indexing-with-tika.adoc +++ b/solr/solr-ref-guide/modules/indexing-guide/pages/indexing-with-tika.adoc @@ -421,13 +421,8 @@ Also see the section <> for an example. If you have started Solr with one of the supplied xref:configuration-guide:config-sets.adoc[example configsets], you may already have the `ExtractingRequestHandler` configured by default. -First, you must enable the xref:#module[Module]. -If `solrconfig.xml` is not already configured, you will need to modify it to find the `ExtractingRequestHandler` and its dependencies: - -[source,xml] ----- - ----- +First, the `extraction` xref:#module[module] must be enabled. +This can be done by specifying the environment variable `SOLR_MODULES=extraction` in your startup configuration. You can then configure the `ExtractingRequestHandler` in `solrconfig.xml`. The following is the default configuration found in Solr's `sample_techproducts_configs` configset, which you can modify as needed: diff --git a/solr/solr-ref-guide/modules/query-guide/pages/learning-to-rank.adoc b/solr/solr-ref-guide/modules/query-guide/pages/learning-to-rank.adoc index 1d3f575ba03..fcdf78e6315 100644 --- a/solr/solr-ref-guide/modules/query-guide/pages/learning-to-rank.adoc +++ b/solr/solr-ref-guide/modules/query-guide/pages/learning-to-rank.adoc @@ -111,10 +111,6 @@ In the form of JSON files your trained model or models (e.g., different models f |(custom) |(custom class extending {solr-javadocs}/modules/ltr/org/apache/solr/ltr/model/LTRScoringModel.html[LTRScoringModel]) |(not applicable) |=== -== Module - -This is provided via the `ltr` xref:configuration-guide:solr-modules.adoc[Solr Module] that needs to be enabled before use. - == Installation of LTR The ltr module requires the `modules/ltr/lib/solr-ltr-*.jar` JARs. @@ -125,13 +121,8 @@ Learning-To-Rank is a module and therefore its plugins must be configured in `so === Minimum Requirements -* Include the required module JARs. -Note that by default paths are relative to the Solr core, so they may need adjustments to your configuration, or an explicit specification of the `$solr.install.dir`. -+ -[source,xml] ----- - ----- +* Enable the `ltr` module to make the LTR classes available on Solr's classpath. +See xref:configuration-guide:solr-modules.adoc[Solr Module] for more details. * Declaration of the `ltr` query parser. + @@ -248,11 +239,11 @@ Assuming that you consider to use a large model placed at `/path/to/models/myMod } ---- -First, add the directory to Solr's resource paths with a xref:configuration-guide:libs.adoc#lib-directives-in-solrconfig[`` directive]: +First, add the directory to Solr's resource paths with a xref:configuration-guide:configuring-solr-xml.adoc#the-solr-element[solr.xml `` directive]: [source,xml] ---- - + /path/to/models" ---- Then, configure `DefaultWrapperModel` to wrap `myModel.json`: @@ -273,8 +264,6 @@ Then, configure `DefaultWrapperModel` to wrap `myModel.json`: NOTE: No `"features"` are configured in `myWrapperModel` because the features of the wrapped model (`myModel`) will be used; also note that the `"store"` configured for the wrapper model must match that of the wrapped model i.e., in this example the feature store called `largeModelsFeatureStore` is used. -CAUTION: `` doesn't work as expected in this case, because `SolrResourceLoader` considers given resources as JAR if `` indicates files. - As an alternative to the above-described `DefaultWrapperModel`, it is possible to xref:deployment-guide:zookeeper-ensemble.adoc#increasing-the-file-size-limit[increase ZooKeeper's file size limit]. === Applying Changes diff --git a/solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-10.adoc b/solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-10.adoc index 2d1902a02fa..af919ebe9d3 100644 --- a/solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-10.adoc +++ b/solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-10.adoc @@ -93,3 +93,7 @@ Please note this also removes the ability to share resource intensive objects ac The removed writer types (invoked as part of the `wt` parameter) include `python`, `ruby`, `php`, and `phps`. * The deprecated support for configuring replication using master/slave terminology is removed. Use leader/follower. + +* Support for the `` directive, which historically could be used in solrconfig.xml to add JARs on a core-by-core basis, was deprecated in 9.8 and has now been removed. +Users that need to vary JAR accessibility on a per-core basis can use Solr's xref:configuration-guide:package-manager.adoc[Package Manager]. +Users who that don't need to vary JAR access on a per-core basis have several options, including the xref:configuration-guide:configuring-solr-xml.adoc[`` tag supported by solr.xml] or manipulation of Solr's classpath prior to JVM startup. diff --git a/solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-9.adoc b/solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-9.adoc index 399ceba5926..fc3a9d27577 100644 --- a/solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-9.adoc +++ b/solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-9.adoc @@ -380,7 +380,7 @@ Other relevant placement strategies should be used instead, such as autoscaling ** The `solrj-deps` (SolrJ Dependencies) are no longer separated out from the other Server jars. ** Please refer to the SolrJ Maven artifact to see the exact dependencies you need to include from `server/solr-webapp/webapp/WEB-INF/lib/` and `server/lib/ext/` if you are loading in SolrJ manually. If you plan on using SolrJ as a JDBC driver, please refer to the xref:query-guide:sql-query.adoc#generic-clients[JDBC documentation] -** More information can be found in the xref:configuration-guide:libs.adoc#lib-directives-in-solrconfig[Libs documentation]. +** More information can be found in the xref:configuration-guide:libs.adoc[Libs documentation]. * SolrJ class `CloudSolrClient` now supports HTTP2. It has a new Builder. See `CloudLegacySolrClient` for the 8.x version of this class. * In Backup request responses, the `response` key now uses a map to return information instead of a list. This is only applicable for users returning information in JSON format, which is the default behavior.