Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id DA49B200CDE for ; Mon, 24 Jul 2017 19:27:45 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D8AA3163806; Mon, 24 Jul 2017 17:27:45 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6B426163807 for ; Mon, 24 Jul 2017 19:27:43 +0200 (CEST) Received: (qmail 47667 invoked by uid 500); 24 Jul 2017 17:27:42 -0000 Mailing-List: contact commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list commits@lucene.apache.org Received: (qmail 47637 invoked by uid 99); 24 Jul 2017 17:27:42 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Jul 2017 17:27:42 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 85E26ED313; Mon, 24 Jul 2017 17:27:41 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: hossman@apache.org To: commits@lucene.apache.org Date: Mon, 24 Jul 2017 17:27:43 -0000 Message-Id: <2785bd321784450ba277cdd5b0f280b4@git.apache.org> In-Reply-To: <170af338c4b24e0a846e484e71ff6eb8@git.apache.org> References: <170af338c4b24e0a846e484e71ff6eb8@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [3/6] lucene-solr:branch_7x: SOLR-10494: Make default response format JSON (wt=json), and also indent text responses formats (indent=on) by default archived-at: Mon, 24 Jul 2017 17:27:46 -0000 SOLR-10494: Make default response format JSON (wt=json), and also indent text responses formats (indent=on) by default (cherry picked from commit 6a59253ec34e9e08d6b2306b51c81199d3f3d828) Conflicts: solr/CHANGES.txt Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/8ea4c079 Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/8ea4c079 Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/8ea4c079 Branch: refs/heads/branch_7x Commit: 8ea4c0790d003efafe893db3d6ab33ad494a1213 Parents: 9f56e8f Author: Chris Hostetter Authored: Mon Jul 24 08:42:02 2017 -0700 Committer: Chris Hostetter Committed: Mon Jul 24 08:45:36 2017 -0700 ---------------------------------------------------------------------- solr/CHANGES.txt | 9 ++ .../dataimport/TestHierarchicalDocBuilder.java | 6 +- solr/contrib/ltr/example/README.md | 2 +- .../src/java/org/apache/solr/core/SolrCore.java | 2 +- .../solr/response/TextResponseWriter.java | 2 +- .../solr/servlet/DirectSolrConnection.java | 1 + .../configsets/_default/conf/solrconfig.xml | 7 +- .../test/org/apache/solr/TestCrossCoreJoin.java | 9 +- .../solr/cloud/BasicDistributedZk2Test.java | 1 + .../apache/solr/cloud/SolrCloudExampleTest.java | 2 +- .../apache/solr/cloud/TestConfigSetsAPI.java | 6 +- .../org/apache/solr/cloud/TestCryptoKeys.java | 28 ++-- .../solr/core/TestConfigSetImmutable.java | 4 +- .../org/apache/solr/core/TestCustomStream.java | 4 +- .../apache/solr/core/TestDynamicLoading.java | 38 ++--- .../apache/solr/core/TestSolrConfigHandler.java | 160 +++++++++---------- .../apache/solr/handler/CheckBackupStatus.java | 2 +- .../apache/solr/handler/TestConfigReload.java | 2 +- .../handler/TestReplicationHandlerBackup.java | 4 +- .../apache/solr/handler/TestReqParamsAPI.java | 44 ++--- .../apache/solr/handler/TestRestoreCore.java | 2 +- .../org/apache/solr/handler/TestSQLHandler.java | 5 +- .../handler/TestSolrConfigHandlerCloud.java | 40 ++--- .../TestSolrConfigHandlerConcurrent.java | 4 +- .../apache/solr/response/JSONWriterTest.java | 4 +- .../solr/response/TestRawResponseWriter.java | 11 +- .../solr/rest/schema/TestBulkSchemaAPI.java | 58 +++---- .../schema/TestCopyFieldCollectionResource.java | 12 +- .../schema/TestFieldCollectionResource.java | 24 +-- .../solr/rest/schema/TestFieldTypeResource.java | 14 +- .../rest/schema/TestSchemaNameResource.java | 2 +- .../solr/rest/schema/TestSchemaResource.java | 2 +- .../schema/TestSchemaSimilarityResource.java | 2 +- .../solr/schema/TestBulkSchemaConcurrent.java | 6 +- .../solr/schema/TestUseDocValuesAsStored2.java | 8 +- .../solr/search/TestHashQParserPlugin.java | 7 + .../solr/security/BasicAuthIntegrationTest.java | 2 +- .../solr/servlet/HttpSolrCallGetCoreTest.java | 2 +- .../processor/TestNamedUpdateProcessors.java | 8 +- .../example-DIH/solr/atom/conf/solrconfig.xml | 3 + .../example-DIH/solr/db/conf/solrconfig.xml | 3 + .../example-DIH/solr/mail/conf/solrconfig.xml | 3 + .../example-DIH/solr/solr/conf/solrconfig.xml | 3 + .../example-DIH/solr/tika/conf/solrconfig.xml | 3 + solr/example/exampledocs/test_utf8.sh | 4 +- solr/example/files/conf/solrconfig.xml | 7 +- .../configsets/_default/conf/solrconfig.xml | 7 +- .../conf/solrconfig.xml | 6 + solr/site/quickstart.mdtext | 51 +++--- solr/solr-ref-guide/src/collections-api.adoc | 6 +- .../src/common-query-parameters.adoc | 2 + solr/solr-ref-guide/src/config-api.adoc | 12 +- solr/solr-ref-guide/src/configsets-api.adoc | 2 +- .../solr-ref-guide/src/configuring-logging.adoc | 2 +- .../src/cross-data-center-replication-cdcr.adoc | 2 +- solr/solr-ref-guide/src/enabling-ssl.adoc | 4 +- solr/solr-ref-guide/src/faceting.adoc | 5 +- solr/solr-ref-guide/src/highlighting.adoc | 2 +- .../src/mbean-request-handler.adoc | 6 +- solr/solr-ref-guide/src/metrics-reporting.adoc | 6 +- solr/solr-ref-guide/src/ping.adoc | 2 +- solr/solr-ref-guide/src/query-screen.adoc | 4 +- solr/solr-ref-guide/src/realtime-get.adoc | 2 - .../src/request-parameters-api.adoc | 2 - solr/solr-ref-guide/src/response-writers.adoc | 132 ++++++++------- solr/solr-ref-guide/src/result-grouping.adoc | 12 +- solr/solr-ref-guide/src/schema-api.adoc | 18 +-- solr/solr-ref-guide/src/suggester.adoc | 7 +- .../solr-ref-guide/src/the-terms-component.adoc | 2 +- .../src/transforming-result-documents.adoc | 4 +- solr/solr-ref-guide/src/using-javascript.adoc | 2 +- solr/solr-ref-guide/src/using-python.adoc | 2 +- .../solr/client/solrj/io/stream/SolrStream.java | 2 + .../java/org/apache/solr/SolrTestCaseJ4.java | 7 + .../java/org/apache/solr/util/RestTestBase.java | 2 +- .../org/apache/solr/util/RestTestHarness.java | 6 +- solr/webapp/web/js/angular/controllers/query.js | 5 +- solr/webapp/web/partials/query.html | 7 +- 78 files changed, 488 insertions(+), 415 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8ea4c079/solr/CHANGES.txt ---------------------------------------------------------------------- diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 928e205..f6ed647 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -109,6 +109,11 @@ Jetty 9.3.14.v20161028 Upgrading from Solr 6.x ---------------------- +* The default response type is now JSON ("wt=json") instead of XML, and line indentation is now on by default + ("indent=on"). If you expect the responses to your queries to be returned in the previous format (XML + format, no indentation), you must now you must now explicitly pass in "wt=xml" and "indent=off" as query + parameters, or configure them as defaults on your request handlers. See SOLR-10494 for more details. + * the cluster property 'legacyCloud' is set to false from 7.0. This means 'zookeeper is the truth' by default. If an entry for a replica does not exist in the state.json, that replica cannot get registered. This may affect users who use that feature where they bring up replicas and they are @@ -522,6 +527,10 @@ Other Changes * SOLR-11088: Fix sporadic failures of MetricsHandlerTest.testPropertyFilter on jenkins (shalin) +* SOLR-10494: Make default response format JSON (wt=json), and also indent text responses formats + (indent=on) by default (Trey Grainger & Cassandra Targett via hossman) + + ================== 6.7.0 ================== Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release. http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8ea4c079/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestHierarchicalDocBuilder.java ---------------------------------------------------------------------- diff --git a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestHierarchicalDocBuilder.java b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestHierarchicalDocBuilder.java index 086d7be..103d0dc 100644 --- a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestHierarchicalDocBuilder.java +++ b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestHierarchicalDocBuilder.java @@ -160,9 +160,9 @@ public class TestHierarchicalDocBuilder extends AbstractDataImportHandlerTestCas int totalDocsNum = parentsNum + childrenNum + grandChildrenNum; String resp = runFullImport(THREE_LEVEL_HIERARCHY_CONFIG); - String xpath = "//arr[@name='documents']/lst/arr[@name='id' and .='"+parentId1+"']/../"+ - "arr[@name='_childDocuments_']/lst/arr[@name='id' and .='"+childId+"']/../"+ - "arr[@name='_childDocuments_']/lst/arr[@name='id' and .='"+grandChildrenIds.get(0)+"']"; + String xpath = "//arr[@name='documents']/lst[arr[@name='id']/str='"+parentId1+"']/"+ + "arr[@name='_childDocuments_']/lst[arr[@name='id']/str='"+childId+"']/"+ + "arr[@name='_childDocuments_']/lst[arr[@name='id']/str='"+grandChildrenIds.get(0)+"']"; String results = TestHarness.validateXPath(resp, xpath); assertTrue("Debug documents does not contain child documents\n"+resp+"\n"+ xpath+ http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8ea4c079/solr/contrib/ltr/example/README.md ---------------------------------------------------------------------- diff --git a/solr/contrib/ltr/example/README.md b/solr/contrib/ltr/example/README.md index 77e582a..06a4789 100644 --- a/solr/contrib/ltr/example/README.md +++ b/solr/contrib/ltr/example/README.md @@ -29,7 +29,7 @@ Please refer to the Solr Reference Guide's section on [Learning To Rank](https:/ 4. Search and rerank the results using the trained model ``` -http://localhost:8983/solr/techproducts/query?indent=on&q=test&wt=json&rq={!ltr%20model=exampleModel%20reRankDocs=25%20efi.user_query=%27test%27}&fl=price,score,name +http://localhost:8983/solr/techproducts/query?q=test&rq={!ltr%20model=exampleModel%20reRankDocs=25%20efi.user_query=%27test%27}&fl=price,score,name ``` # Assemble training data http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8ea4c079/solr/core/src/java/org/apache/solr/core/SolrCore.java ---------------------------------------------------------------------- diff --git a/solr/core/src/java/org/apache/solr/core/SolrCore.java b/solr/core/src/java/org/apache/solr/core/SolrCore.java index 5319881..cc6a9c2 100644 --- a/solr/core/src/java/org/apache/solr/core/SolrCore.java +++ b/solr/core/src/java/org/apache/solr/core/SolrCore.java @@ -2565,8 +2565,8 @@ public final class SolrCore implements SolrInfoBean, SolrMetricProducer, Closeab static{ HashMap m= new HashMap<>(15, 1); m.put("xml", new XMLResponseWriter()); - m.put("standard", m.get("xml")); m.put(CommonParams.JSON, new JSONResponseWriter()); + m.put("standard", m.get(CommonParams.JSON)); m.put("geojson", new GeoJSONResponseWriter()); m.put("graphml", new GraphMLResponseWriter()); m.put("python", new PythonResponseWriter()); http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8ea4c079/solr/core/src/java/org/apache/solr/response/TextResponseWriter.java ---------------------------------------------------------------------- diff --git a/solr/core/src/java/org/apache/solr/response/TextResponseWriter.java b/solr/core/src/java/org/apache/solr/response/TextResponseWriter.java index 261daee..4d052ae 100644 --- a/solr/core/src/java/org/apache/solr/response/TextResponseWriter.java +++ b/solr/core/src/java/org/apache/solr/response/TextResponseWriter.java @@ -84,7 +84,7 @@ public abstract class TextResponseWriter implements PushWriter { this.req = req; this.rsp = rsp; String indent = req.getParams().get("indent"); - if (indent != null && !"".equals(indent) && !"off".equals(indent)) { + if (null == indent || !("off".equals(indent) || "false".equals(indent))){ doIndent=true; } returnFields = rsp.getReturnFields(); http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8ea4c079/solr/core/src/java/org/apache/solr/servlet/DirectSolrConnection.java ---------------------------------------------------------------------- diff --git a/solr/core/src/java/org/apache/solr/servlet/DirectSolrConnection.java b/solr/core/src/java/org/apache/solr/servlet/DirectSolrConnection.java index 2d3d683..7fecd29 100644 --- a/solr/core/src/java/org/apache/solr/servlet/DirectSolrConnection.java +++ b/solr/core/src/java/org/apache/solr/servlet/DirectSolrConnection.java @@ -63,6 +63,7 @@ public class DirectSolrConnection * For example: * * String json = solr.request( "/select?qt=dismax&wt=json&q=...", null ); + * String xml = solr.request( "/select?qt=dismax&wt=xml&q=...", null ); * String xml = solr.request( "/update", "<add><doc><field ..." ); */ public String request( String pathAndParams, String body ) throws Exception http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8ea4c079/solr/core/src/test-files/solr/configsets/_default/conf/solrconfig.xml ---------------------------------------------------------------------- diff --git a/solr/core/src/test-files/solr/configsets/_default/conf/solrconfig.xml b/solr/core/src/test-files/solr/configsets/_default/conf/solrconfig.xml index 788aab1..8172e52 100644 --- a/solr/core/src/test-files/solr/configsets/_default/conf/solrconfig.xml +++ b/solr/core/src/test-files/solr/configsets/_default/conf/solrconfig.xml @@ -716,7 +716,12 @@ explicit 10 - + +