You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by yo...@apache.org on 2008/07/13 02:38:27 UTC
svn commit: r676252 - in /lucene/solr/trunk/src:
java/org/apache/solr/request/JSONResponseWriter.java
test/org/apache/solr/TestDistributedSearch.java
Author: yonik
Date: Sat Jul 12 17:38:27 2008
New Revision: 676252
URL: http://svn.apache.org/viewvc?rev=676252&view=rev
Log:
check for null maxScore in JSONResponseWriter
Modified:
lucene/solr/trunk/src/java/org/apache/solr/request/JSONResponseWriter.java
lucene/solr/trunk/src/test/org/apache/solr/TestDistributedSearch.java
Modified: lucene/solr/trunk/src/java/org/apache/solr/request/JSONResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/request/JSONResponseWriter.java?rev=676252&r1=676251&r2=676252&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/request/JSONResponseWriter.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/request/JSONResponseWriter.java Sat Jul 12 17:38:27 2008
@@ -522,7 +522,7 @@
writeKey("start",false);
writeLong(null,docs.getStart());
- if (includeScore) {
+ if (includeScore && docs.getMaxScore() != null) {
writeMapSeparator();
writeKey("maxScore",false);
writeFloat(null,docs.getMaxScore());
Modified: lucene/solr/trunk/src/test/org/apache/solr/TestDistributedSearch.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/test/org/apache/solr/TestDistributedSearch.java?rev=676252&r1=676251&r2=676252&view=diff
==============================================================================
--- lucene/solr/trunk/src/test/org/apache/solr/TestDistributedSearch.java (original)
+++ lucene/solr/trunk/src/test/org/apache/solr/TestDistributedSearch.java Sat Jul 12 17:38:27 2008
@@ -453,6 +453,7 @@
// these queries should be exactly ordered and scores should exactly match
query("q","*:*", "sort",i1+" desc");
+ query("q","*:*", "sort",i1+" desc", "fl","*,score");
handle.put("maxScore", SKIPVAL);
query("q","{!func}"+i1);// does not expect maxScore. So if it comes ,ignore it. NamedListCodec.writeSolrDocumentList()
//is agnostic of request params.