You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by dw...@apache.org on 2021/03/10 10:09:08 UTC

[lucene] 11/23: merging with master

This is an automated email from the ASF dual-hosted git repository.

dweiss pushed a commit to branch jira/solr14827
in repository https://gitbox.apache.org/repos/asf/lucene.git

commit 5746feef7c6cf029d72e6c88cf25c93c41ef54c6
Author: noble <no...@apache.org>
AuthorDate: Mon Oct 12 11:35:03 2020 +1100

    merging with master
---
 .../java/org/apache/solr/schema/IndexSchema.java   | 26 +---------------------
 .../java/org/apache/solr/common/util/DOMUtil.java  |  2 +-
 2 files changed, 2 insertions(+), 26 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/schema/IndexSchema.java b/solr/core/src/java/org/apache/solr/schema/IndexSchema.java
index 97d786b..839cff4 100644
--- a/solr/core/src/java/org/apache/solr/schema/IndexSchema.java
+++ b/solr/core/src/java/org/apache/solr/schema/IndexSchema.java
@@ -16,7 +16,6 @@
  */
 package org.apache.solr.schema;
 
-import javax.xml.xpath.XPathExpressionException;
 import java.io.IOException;
 import java.io.Writer;
 import java.lang.invoke.MethodHandles;
@@ -120,13 +119,9 @@ public class IndexSchema {
   public static final String UNIQUE_KEY = "uniqueKey";
   public static final String VERSION = "version";
 
-  private static final String AT = "@";
   private static final String DESTINATION_DYNAMIC_BASE = "destDynamicBase";
-  private static final String SOLR_CORE_NAME = "solr.core.name";
   private static final String SOURCE_DYNAMIC_BASE = "sourceDynamicBase";
   private static final String SOURCE_EXPLICIT_FIELDS = "sourceExplicitFields";
-  private static final String TEXT_FUNCTION = "text()";
-  private static final String XPATH_OR = " | ";
 
   private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
   protected String resourceName;
@@ -758,7 +753,7 @@ public class IndexSchema {
   /**
    * Loads the copy fields
    */
-  protected synchronized void loadCopyFields(ConfigNode n) throws XPathExpressionException {
+  protected synchronized void loadCopyFields(ConfigNode n) {
 //    String expression = "//" + COPY_FIELD;
 //    NodeList nodes = (NodeList)xpath.evaluate(expression, document, XPathConstants.NODESET);
 
@@ -803,17 +798,6 @@ public class IndexSchema {
     }
   }
 
-  /**
-   * Converts a sequence of path steps into a rooted path, by inserting slashes in front of each step.
-   * @param steps The steps to join with slashes to form a path
-   * @return a rooted path: a leading slash followed by the given steps joined with slashes
-   */
-  private String stepsToPath(String... steps) {
-    StringBuilder builder = new StringBuilder();
-    for (String step : steps) { builder.append(SLASH).append(step); }
-    return builder.toString();
-  }
-
   /** Returns true if the given name has exactly one asterisk either at the start or end of the name */
   protected static boolean isValidFieldGlob(String name) {
     if (name.startsWith("*") || name.endsWith("*")) {
@@ -1978,14 +1962,6 @@ public class IndexSchema {
     throw new SolrException(ErrorCode.SERVER_ERROR, msg);
   }
 
-  protected String getFieldTypeXPathExpressions() {
-    //               /schema/fieldtype | /schema/fieldType | /schema/types/fieldtype | /schema/types/fieldType
-    String expression = stepsToPath(SCHEMA, FIELD_TYPE.toLowerCase(Locale.ROOT)) // backcompat(?)
-            + XPATH_OR + stepsToPath(SCHEMA, FIELD_TYPE)
-            + XPATH_OR + stepsToPath(SCHEMA, TYPES, FIELD_TYPE.toLowerCase(Locale.ROOT))
-            + XPATH_OR + stepsToPath(SCHEMA, TYPES, FIELD_TYPE);
-    return expression;
-  }
 
   /**
    * Helper method that returns <code>true</code> if the {@link #ROOT_FIELD_NAME} uses the exact
diff --git a/solr/solrj/src/java/org/apache/solr/common/util/DOMUtil.java b/solr/solrj/src/java/org/apache/solr/common/util/DOMUtil.java
index 206d84b..2b3219d 100644
--- a/solr/solrj/src/java/org/apache/solr/common/util/DOMUtil.java
+++ b/solr/solrj/src/java/org/apache/solr/common/util/DOMUtil.java
@@ -40,7 +40,7 @@ public class DOMUtil {
 
   public static final String XML_RESERVED_PREFIX = "xml";
 
-  static final Set<String>  NL_TAGS = ImmutableSet.of("str", "int","long","float","double","bool");
+  public static final Set<String>  NL_TAGS = ImmutableSet.of("str", "int","long","float","double","bool");
 
 
   public static Map<String,String> toMap(NamedNodeMap attrs) {