Merge branch 'apache-https-master' into jira/solr-8593

This commit is contained in:
Kevin Risden 2016-11-14 10:06:29 -06:00
commit 99a6746011
9 changed files with 587 additions and 333 deletions

View File

@ -102,7 +102,7 @@ public abstract class RollingBuffer<T extends RollingBuffer.Resettable> {
nextPos++;
count++;
}
assert inBounds(pos);
assert inBounds(pos): "pos=" + pos + " nextPos=" + nextPos + " count=" + count;
final int index = getIndex(pos);
//System.out.println(" pos=" + pos + " nextPos=" + nextPos + " -> index=" + index);
//assert buffer[index].pos == pos;
@ -110,11 +110,16 @@ public abstract class RollingBuffer<T extends RollingBuffer.Resettable> {
}
/** Returns the maximum position looked up, or -1 if no
* position has been looked up sinc reset/init. */
* position has been looked up since reset/init. */
public int getMaxPos() {
return nextPos-1;
}
/** Returns how many active positions are in the buffer. */
public int getBufferSize() {
return count;
}
public void freeBefore(int pos) {
final int toFree = count - (nextPos - pos);
assert toFree >= 0;

View File

@ -16,10 +16,6 @@
*/
package org.apache.lucene.search.grouping;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
@ -35,12 +31,15 @@ import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.Sort;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.search.similarities.BM25Similarity;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.mutable.MutableValueStr;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
public class GroupingSearchTest extends LuceneTestCase {
// Tests some very basic usages...
@ -116,7 +115,6 @@ public class GroupingSearchTest extends LuceneTestCase {
w.addDocument(doc);
IndexSearcher indexSearcher = newSearcher(w.getReader());
indexSearcher.setSimilarity(new BM25Similarity());
w.close();
Sort groupSort = Sort.RELEVANCE;

View File

@ -64,7 +64,6 @@ import org.apache.lucene.search.grouping.function.FunctionSecondPassGroupingColl
import org.apache.lucene.search.grouping.term.TermAllGroupsCollector;
import org.apache.lucene.search.grouping.term.TermFirstPassGroupingCollector;
import org.apache.lucene.search.grouping.term.TermSecondPassGroupingCollector;
import org.apache.lucene.search.similarities.BM25Similarity;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.LuceneTestCase;
@ -141,7 +140,6 @@ public class TestGrouping extends LuceneTestCase {
w.addDocument(doc);
IndexSearcher indexSearcher = newSearcher(w.getReader());
indexSearcher.setSimilarity(new BM25Similarity());
w.close();
final Sort groupSort = Sort.RELEVANCE;

View File

@ -91,7 +91,8 @@ public class RandomSimilarity extends PerFieldSimilarityWrapper {
allSims = new ArrayList<>();
allSims.add(new ClassicSimilarity());
allSims.add(new BM25Similarity());
allSims.add(new BooleanSimilarity());
// We cannot do this, because this similarity behaves in "non-traditional" ways:
// allSims.add(new BooleanSimilarity());
for (BasicModel basicModel : BASIC_MODELS) {
for (AfterEffect afterEffect : AFTER_EFFECTS) {
for (Normalization normalization : NORMALIZATIONS) {

View File

@ -79,6 +79,13 @@ Jetty 9.3.8.v20160314
Detailed Change List
----------------------
Upgrade Notes
----------------------
* SOLR-9166: Export handler returns zero for numeric fields that are not in the original doc. One
consequence of this change is that you must be aware that some tuples will not have values if
there were none in the original document.
New Features
----------------------
* SOLR-9293: Solrj client support for hierarchical clusters and other topics

View File

@ -1333,7 +1333,7 @@ public class ExportWriter implements SolrCore.RawWriter, Closeable {
if (vals.advance(docId) == docId) {
val = (int) vals.longValue();
} else {
val = 0;
return false;
}
ew.put(this.field, val);
return true;
@ -1385,7 +1385,7 @@ public class ExportWriter implements SolrCore.RawWriter, Closeable {
if (vals.advance(docId) == docId) {
val = vals.longValue();
} else {
val = 0;
return false;
}
ew.put(field, val);
return true;
@ -1405,7 +1405,7 @@ public class ExportWriter implements SolrCore.RawWriter, Closeable {
if (vals.advance(docId) == docId) {
val = vals.longValue();
} else {
val = 0;
return false;
}
ew.put(this.field, new Date(val));
return true;
@ -1449,7 +1449,7 @@ public class ExportWriter implements SolrCore.RawWriter, Closeable {
if (vals.advance(docId) == docId) {
val = (int)vals.longValue();
} else {
val = 0;
return false;
}
ew.put(this.field, Float.intBitsToFloat(val));
return true;
@ -1469,7 +1469,7 @@ public class ExportWriter implements SolrCore.RawWriter, Closeable {
if (vals.advance(docId) == docId) {
val = vals.longValue();
} else {
val = 0;
return false;
}
ew.put(this.field, Double.longBitsToDouble(val));
return true;

View File

@ -392,7 +392,7 @@ public class StreamExpressionTest extends SolrCloudTestCase {
assertTrue("hello4".equals(tuple.getString("a_s")));
assertNull(tuple.get("s_multi"));
assertNull(tuple.get("i_multi"));
assertEquals(0L, (long)tuple.getLong("a_i"));
assertNull(tuple.getLong("a_i"));
tuple = tuples.get(1);

View File

@ -26,9 +26,9 @@ import org.apache.lucene.util.LuceneTestCase;
*/
public class CommonParamsTest extends LuceneTestCase
{
public void testStart() { assertEquals(CommonParams.START, "start"); }
public void testStartDefault() { assertEquals(CommonParams.START_DEFAULT, 0); }
public void testStart() { assertEquals("start", CommonParams.START); }
public void testStartDefault() { assertEquals(0, CommonParams.START_DEFAULT); }
public void testRows() { assertEquals(CommonParams.ROWS, "rows"); }
public void testRowsDefault() { assertEquals(CommonParams.ROWS_DEFAULT, 10); }
public void testRows() { assertEquals("rows", CommonParams.ROWS); }
public void testRowsDefault() { assertEquals(10, CommonParams.ROWS_DEFAULT); }
}