Erik: this isn't the final patch that i attached to the issue. it's your earlier patch that still has a bug in reseting "required" so date & range faceting is still broken.
: Date: Tue, 21 May 2013 17:22:03 -0000 : From: [email protected] : Reply-To: [email protected] : To: [email protected] : Subject: svn commit: r1484877 - in /lucene/dev/branches/branch_4x/solr: : CHANGES.txt core/src/java/org/apache/solr/request/SimpleFacets.java : core/src/test/org/apache/solr/request/TestFaceting.java : : Author: ehatcher : Date: Tue May 21 17:22:03 2013 : New Revision: 1484877 : : URL: http://svn.apache.org/r1484877 : Log: : SOLR-4842: Fix facet.field local params from affecting other facet.field's : : Modified: : lucene/dev/branches/branch_4x/solr/CHANGES.txt : lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/request/SimpleFacets.java : lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/request/TestFaceting.java : : Modified: lucene/dev/branches/branch_4x/solr/CHANGES.txt : URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/CHANGES.txt?rev=1484877&r1=1484876&r2=1484877&view=diff : ============================================================================== : --- lucene/dev/branches/branch_4x/solr/CHANGES.txt (original) : +++ lucene/dev/branches/branch_4x/solr/CHANGES.txt Tue May 21 17:22:03 2013 : @@ -78,6 +78,9 @@ Bug Fixes : * SOLR-4790: Throw an error if a core has the same name as another core, both old and : new style solr.xml : : +* SOLR-4842: Fix facet.field local params from affecting other facet.field's. : + (ehatcher) : + : Other Changes : ---------------------- : : : Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/request/SimpleFacets.java : URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/request/SimpleFacets.java?rev=1484877&r1=1484876&r2=1484877&view=diff : ============================================================================== : --- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/request/SimpleFacets.java (original) : +++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/request/SimpleFacets.java Tue May 21 17:22:03 2013 : @@ -149,6 +149,7 @@ public class SimpleFacets { : threads = -1; : : if (localParams == null) { : + params = orig; : return; : } : params = SolrParams.wrapDefaults(localParams, orig); : : Modified: lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/request/TestFaceting.java : URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/request/TestFaceting.java?rev=1484877&r1=1484876&r2=1484877&view=diff : ============================================================================== : --- lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/request/TestFaceting.java (original) : +++ lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/request/TestFaceting.java Tue May 21 17:22:03 2013 : @@ -494,6 +494,104 @@ public class TestFaceting extends SolrTe : ,"//lst[@name='bar']/int[@name='Chauvinist'][.='1']" : ,"//lst[@name='bar']/int[@name='Obnoxious'][.='1']" : ); : + : + assertQ("localparams in one facet variant should not affect defaults in another: facet.sort vs facet.missing", : + req("q", "id:[42 TO 47]" : + ,"rows","0" : + ,"facet", "true" : + ,"fq", "id:[42 TO 45]" : + ,"facet.field", "{!key=foo " + : + "facet.sort=index" + : + "}"+fname : + ,"facet.field", "{!key=bar " + : + "facet.missing=true" + : + "}"+fname : + ) : + // foo is in index order w/o missing : + ,"*[count(//lst[@name='foo']/int)=4]" : + ,"//lst[@name='foo']/int[1][@name='Chauvinist'][.='1']" : + ,"//lst[@name='foo']/int[2][@name='Obnoxious'][.='1']" : + ,"//lst[@name='foo']/int[3][@name='Pig'][.='0']" : + ,"//lst[@name='foo']/int[4][@name='Tool'][.='2']" : + // bar is in count order by default and includes missing : + ,"*[count(//lst[@name='bar']/int)=5]" : + ,"//lst[@name='bar']/int[1][@name='Tool'][.='2']" : + // don't assume tie breaker for slots 3 & 4, behavior undefined? : + ,"//lst[@name='bar']/int[4][@name='Pig'][.='0']" : + ,"//lst[@name='bar']/int[5][not(@name)][.='1']" : + ); : + : + assertQ("localparams in one facet variant should not affect defaults in another: facet.mincount", : + req("q", "id:[42 TO 47]" : + ,"rows","0" : + ,"facet", "true" : + ,"fq", "id:[42 TO 45]" : + ,"facet.field", "{!key=foo " + : + "facet.mincount=2" + : + "}"+fname : + ,"facet.field", "{!key=bar}"+fname : + ) : + // only Tool for foo : + ,"*[count(//lst[@name='foo']/int)=1]" : + ,"//lst[@name='foo']/int[1][@name='Tool'][.='2']" : + // all for bar : + ,"*[count(//lst[@name='bar']/int)=4]" : + ,"//lst[@name='bar']/int[1][@name='Tool'][.='2']" : + // don't assume tie breaker for slots 3 & 4, behavior undefined? : + ,"//lst[@name='bar']/int[4][@name='Pig'][.='0']" : + ); : + : + assertQ("localparams in one facet variant should not affect defaults in another: facet.missing", : + req("q", "id:[42 TO 47]" : + ,"rows","0" : + ,"facet", "true" : + ,"fq", "id:[42 TO 45]" : + ,"facet.field", "{!key=foo " + : + "facet.missing=true" + : + "}"+fname : + ,"facet.field", "{!key=bar}"+fname : + ) : + // foo includes missing : + ,"*[count(//lst[@name='foo']/int)=5]" : + ,"//lst[@name='foo']/int[1][@name='Tool'][.='2']" : + // don't assume tie breaker for slots 3 & 4, behavior undefined? : + ,"//lst[@name='foo']/int[4][@name='Pig'][.='0']" : + ,"//lst[@name='foo']/int[5][not(@name)][.='1']" : + // bar does not : + ,"*[count(//lst[@name='bar']/int)=4]" : + ,"//lst[@name='bar']/int[1][@name='Tool'][.='2']" : + // don't assume tie breaker for slots 3 & 4, behavior undefined? : + ,"//lst[@name='bar']/int[4][@name='Pig'][.='0']" : + ); : + : + assertQ("checking facets when local facet.prefix param used after regular/raw field faceting", : + req("q", "*:*" : + ,"facet", "true" : + ,"facet.field", fname : + ,"facet.field", "{!key=foo " + : + "facet.prefix=T "+ : + "}"+fname : + ) : + ,"*[count(//doc)=6]" : + ,"*[count(//lst[@name='" + fname + "']/int)=4]" : + ,"*[count(//lst[@name='foo']/int)=1]" : + ,"//lst[@name='foo']/int[@name='Tool'][.='2']" : + ); : + : + assertQ("checking facets when local facet.prefix param used before regular/raw field faceting", : + req("q", "*:*" : + ,"facet", "true" : + ,"facet.field", "{!key=foo " + : + "facet.prefix=T "+ : + "}"+fname : + ,"facet.field", fname : + ) : + ,"*[count(//doc)=6]" : + ,"*[count(//lst[@name='" + fname + "']/int)=4]" : + ,"*[count(//lst[@name='foo']/int)=1]" : + ,"//lst[@name='foo']/int[@name='Tool'][.='2']" : + ); : + : clearIndex(); : assertU(commit()); : } : : : -Hoss --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
