Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-10715: Welcome message should work for _introspect

Cao Manh Dat41d12df6d247
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 275710da640..6eb2152f2e7 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -156,6 +156,8 @@ Bug Fixes
* SOLR-10223: Allow running examples as root on Linux with -force option (janhoy)
+* SOLR-10715: /v2/ should not be an alias for /v2/collections (Cao Manh Dat)
+
Optimizations
----------------------
diff --git a/solr/core/src/java/org/apache/solr/api/V2HttpCall.java b/solr/core/src/java/org/apache/solr/api/V2HttpCall.java
index da2781e967b..5e7c0b16e42 100644
--- a/solr/core/src/java/org/apache/solr/api/V2HttpCall.java
+++ b/solr/core/src/java/org/apache/solr/api/V2HttpCall.java
@@ -79,7 +79,7 @@ public class V2HttpCall extends HttpSolrCall {
String fullPath = path = path.substring(7);//strip off '/____v2'
try {
pieces = getPathSegments(path);
- if (pieces.size() == 0) {
+ if (pieces.size() == 0 || (pieces.size() == 1 && path.endsWith(CommonParams.INTROSPECT))) {
api = new Api(null) {
@Override
public void call(SolrQueryRequest req, SolrQueryResponse rsp) {
diff --git a/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java b/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java
index 4741ef4edac..66f5dbe7a57 100644
--- a/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java
@@ -57,6 +57,10 @@ public class V2ApiIntegrationTest extends SolrCloudTestCase {
new V2Request.Builder("").build());
NamedList header = (NamedList) res.get("responseHeader");
assertEquals(0, header.get("status"));
+
+ res = cluster.getSolrClient().request(new V2Request.Builder("/_introspect").build());
+ header = (NamedList) res.get("responseHeader");
+ assertEquals(0, header.get("status"));
}
@Test
diff --git a/solr/core/src/test/org/apache/solr/handler/V2StandaloneTest.java b/solr/core/src/test/org/apache/solr/handler/V2StandaloneTest.java
index 2d5b2a96fa1..ccf2a580dcf 100644
--- a/solr/core/src/test/org/apache/solr/handler/V2StandaloneTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/V2StandaloneTest.java
@@ -42,6 +42,10 @@ public class V2StandaloneTest extends SolrTestCaseJ4{
NamedList res = client.request(new V2Request.Builder("/").build());
NamedList header = (NamedList) res.get("responseHeader");
assertEquals(0, header.get("status"));
+
+ res = client.request(new V2Request.Builder("/_introspect").build());
+ header = (NamedList) res.get("responseHeader");
+ assertEquals(0, header.get("status"));
}
jetty.stop();