You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by is...@apache.org on 2023/01/21 19:23:52 UTC

[solr] branch branch_9x updated (2dc585eb641 -> d77b592d952)

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

ishan pushed a change to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git


    from 2dc585eb641 SOLR-6312: Add missing override
     new 51ae8b581a6 A transformer that appends the core name (#1276)
     new fc5e7979023 Add a trivial validator for the new CoreAugmenter transformer (#1281)
     new d77b592d952 SOLR-16630: Bringing back the test, after backporting a2f3f7f33efd765cc6c608c78745d8b9c108b8df and 3247803ea6e97b2d735fde08c12057de3c88086c

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../transform/CoreAugmenterFactory.java}           | 12 +++----
 .../response/transform/TransformerFactory.java     |  1 +
 .../apache/solr/cloud/TestRandomFlRTGCloud.java    | 42 ++++++++++++++++++++++
 .../apache/solr/search/TestCoordinatorRole.java    |  2 +-
 4 files changed, 49 insertions(+), 8 deletions(-)
 copy solr/core/src/java/org/apache/solr/{search/SpatialBoxQParserPlugin.java => response/transform/CoreAugmenterFactory.java} (72%)


[solr] 03/03: SOLR-16630: Bringing back the test, after backporting a2f3f7f33efd765cc6c608c78745d8b9c108b8df and 3247803ea6e97b2d735fde08c12057de3c88086c

Posted by is...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ishan pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git

commit d77b592d952a649ac2450eeb884510d681d2c814
Author: Ishan Chattopadhyaya <is...@apache.org>
AuthorDate: Sun Jan 22 00:53:38 2023 +0530

    SOLR-16630: Bringing back the test, after backporting a2f3f7f33efd765cc6c608c78745d8b9c108b8df and 3247803ea6e97b2d735fde08c12057de3c88086c
---
 solr/core/src/test/org/apache/solr/search/TestCoordinatorRole.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/solr/core/src/test/org/apache/solr/search/TestCoordinatorRole.java b/solr/core/src/test/org/apache/solr/search/TestCoordinatorRole.java
index 6976ec23d5a..b72324498ec 100644
--- a/solr/core/src/test/org/apache/solr/search/TestCoordinatorRole.java
+++ b/solr/core/src/test/org/apache/solr/search/TestCoordinatorRole.java
@@ -108,7 +108,6 @@ public class TestCoordinatorRole extends SolrCloudTestCase {
     }
   }
 
-  @AwaitsFix(bugUrl = "https://issues.apache.org/jira/browse/SOLR-16630")
   public void testNRTRestart() throws Exception {
     // we restart jetty and expect to find on disk data - need a local fs directory
     useFactory(null);
@@ -419,6 +418,7 @@ public class TestCoordinatorRole extends SolrCloudTestCase {
       Thread.sleep(100);
     }
     assertTrue(found);
+    log.info("HELLO: "+docs);
     return (String) docs.get(0).getFieldValue("_core_");
   }
 }


[solr] 01/03: A transformer that appends the core name (#1276)

Posted by is...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ishan pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git

commit 51ae8b581a6a157245e17111ed3f9e966bec82aa
Author: Noble Paul <no...@users.noreply.github.com>
AuthorDate: Mon Jan 9 14:47:59 2023 +1100

    A transformer that appends the core name (#1276)
---
 .../response/transform/CoreAugmenterFactory.java   | 29 ++++++++++++++++++++++
 .../response/transform/TransformerFactory.java     |  1 +
 2 files changed, 30 insertions(+)

diff --git a/solr/core/src/java/org/apache/solr/response/transform/CoreAugmenterFactory.java b/solr/core/src/java/org/apache/solr/response/transform/CoreAugmenterFactory.java
new file mode 100644
index 00000000000..eb53a99a296
--- /dev/null
+++ b/solr/core/src/java/org/apache/solr/response/transform/CoreAugmenterFactory.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr.response.transform;
+
+import org.apache.solr.common.params.SolrParams;
+import org.apache.solr.request.SolrQueryRequest;
+
+public class CoreAugmenterFactory extends TransformerFactory {
+
+  @Override
+  public DocTransformer create(String field, SolrParams params, SolrQueryRequest req) {
+    return new ValueAugmenterFactory.ValueAugmenter(field, req.getCore().getName());
+  }
+}
diff --git a/solr/core/src/java/org/apache/solr/response/transform/TransformerFactory.java b/solr/core/src/java/org/apache/solr/response/transform/TransformerFactory.java
index 51b6b7a1d7b..249a3a9e1d7 100644
--- a/solr/core/src/java/org/apache/solr/response/transform/TransformerFactory.java
+++ b/solr/core/src/java/org/apache/solr/response/transform/TransformerFactory.java
@@ -117,5 +117,6 @@ public abstract class TransformerFactory implements NamedListInitializedPlugin {
     defaultFactories.put("json", new RawValueTransformerFactory("json"));
     defaultFactories.put("xml", new RawValueTransformerFactory("xml"));
     defaultFactories.put("geo", new GeoTransformerFactory());
+    defaultFactories.put("core", new CoreAugmenterFactory());
   }
 }


[solr] 02/03: Add a trivial validator for the new CoreAugmenter transformer (#1281)

Posted by is...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ishan pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git

commit fc5e79790238634802bc268ffe4b89d47ae9f9d3
Author: Michael Gibney <mi...@michaelgibney.net>
AuthorDate: Mon Jan 9 12:10:20 2023 -0500

    Add a trivial validator for the new CoreAugmenter transformer (#1281)
    
    Followup on a2f3f7f33efd765cc6c608c78745d8b9c108b8df
    See: #1276
---
 .../apache/solr/cloud/TestRandomFlRTGCloud.java    | 42 ++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/solr/core/src/test/org/apache/solr/cloud/TestRandomFlRTGCloud.java b/solr/core/src/test/org/apache/solr/cloud/TestRandomFlRTGCloud.java
index 3950de3a43a..e77556936c7 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestRandomFlRTGCloud.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestRandomFlRTGCloud.java
@@ -103,6 +103,8 @@ public class TestRandomFlRTGCloud extends SolrCloudTestCase {
           new DocIdValidator("my_docid_alias"),
           new ShardValidator(),
           new ShardValidator("my_shard_alias"),
+          new CoreValidator(),
+          new CoreValidator("my_core_alias"),
           new ValueAugmenterValidator(42),
           new ValueAugmenterValidator(1976, "val_alias"),
           //
@@ -1035,6 +1037,46 @@ public class TestRandomFlRTGCloud extends SolrCloudTestCase {
     }
   }
 
+  /** Trivial validator of CoreAugmenterFactory */
+  private static class CoreValidator implements FlValidator {
+    private static final String NAME = "core";
+    private static final String USAGE = "[" + NAME + "]";
+    private final String resultKey;
+
+    public CoreValidator(final String resultKey) {
+      this.resultKey = resultKey;
+    }
+
+    public CoreValidator() {
+      this(USAGE);
+    }
+
+    @Override
+    public String getDefaultTransformerFactoryName() {
+      return NAME;
+    }
+
+    @Override
+    public String getFlParam() {
+      return USAGE.equals(resultKey) ? resultKey : resultKey + ":" + USAGE;
+    }
+
+    @Override
+    public Collection<String> assertRTGResults(
+        final Collection<FlValidator> validators,
+        final SolrInputDocument expected,
+        final SolrDocument actual,
+        final String wt) {
+      final Object value = actual.getFirstValue(resultKey);
+      assertNotNull(getFlParam() + " => no value in actual doc", value);
+      assertTrue(USAGE + " must be a String: " + value, value instanceof String);
+
+      // trivial sanity check
+      assertFalse(USAGE + " => blank string", value.toString().trim().isEmpty());
+      return Collections.singleton(resultKey);
+    }
+  }
+
   /** Trivial validator of ValueAugmenter */
   private static class ValueAugmenterValidator implements FlValidator {
     private static final String NAME = "value";