You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by dw...@apache.org on 2015/07/14 14:31:20 UTC
svn commit: r1690913 - in /lucene/dev/branches/solr7790: ./ lucene/
lucene/grouping/src/java/org/apache/lucene/search/grouping/
lucene/licenses/ solr/contrib/clustering/
solr/core/src/java/org/apache/solr/handler/component/
solr/core/src/java/org/apach...
Author: dweiss
Date: Tue Jul 14 12:31:19 2015
New Revision: 1690913
URL: http://svn.apache.org/r1690913
Log:
Branch for SOLR-7790
Added:
lucene/dev/branches/solr7790/ (props changed)
- copied from r1690879, lucene/dev/trunk/
lucene/dev/branches/solr7790/lucene/licenses/morfologik-fsa-1.10.0.jar.sha1 (with props)
lucene/dev/branches/solr7790/lucene/licenses/morfologik-polish-1.10.0.jar.sha1 (with props)
lucene/dev/branches/solr7790/lucene/licenses/morfologik-stemming-1.10.0.jar.sha1 (with props)
lucene/dev/branches/solr7790/solr/licenses/attributes-binder-1.2.2.jar.sha1 (with props)
lucene/dev/branches/solr7790/solr/licenses/carrot2-mini-3.10.1.jar.sha1 (with props)
lucene/dev/branches/solr7790/solr/licenses/guava-18.0.jar.sha1 (with props)
lucene/dev/branches/solr7790/solr/licenses/hppc-0.7.1.jar.sha1 (with props)
lucene/dev/branches/solr7790/solr/licenses/morfologik-fsa-1.10.0.jar.sha1 (with props)
lucene/dev/branches/solr7790/solr/licenses/morfologik-polish-1.10.0.jar.sha1 (with props)
lucene/dev/branches/solr7790/solr/licenses/morfologik-stemming-1.10.0.jar.sha1 (with props)
lucene/dev/branches/solr7790/solr/licenses/simple-xml-2.7.1.jar.sha1 (with props)
Removed:
lucene/dev/branches/solr7790/lucene/licenses/morfologik-fsa-1.7.1.jar.sha1
lucene/dev/branches/solr7790/lucene/licenses/morfologik-polish-1.7.1.jar.sha1
lucene/dev/branches/solr7790/lucene/licenses/morfologik-stemming-1.7.1.jar.sha1
lucene/dev/branches/solr7790/solr/licenses/attributes-binder-1.2.1.jar.sha1
lucene/dev/branches/solr7790/solr/licenses/carrot2-mini-3.9.0.jar.sha1
lucene/dev/branches/solr7790/solr/licenses/guava-14.0.1.jar.sha1
lucene/dev/branches/solr7790/solr/licenses/hppc-0.5.2.jar.sha1
lucene/dev/branches/solr7790/solr/licenses/morfologik-fsa-1.7.1.jar.sha1
lucene/dev/branches/solr7790/solr/licenses/morfologik-polish-1.7.1.jar.sha1
lucene/dev/branches/solr7790/solr/licenses/morfologik-stemming-1.7.1.jar.sha1
lucene/dev/branches/solr7790/solr/licenses/simple-xml-2.7.jar.sha1
Modified:
lucene/dev/branches/solr7790/lucene/grouping/src/java/org/apache/lucene/search/grouping/AbstractSecondPassGroupingCollector.java
lucene/dev/branches/solr7790/lucene/ivy-versions.properties
lucene/dev/branches/solr7790/solr/contrib/clustering/ivy.xml
lucene/dev/branches/solr7790/solr/core/src/java/org/apache/solr/handler/component/ExpandComponent.java
lucene/dev/branches/solr7790/solr/core/src/java/org/apache/solr/handler/component/QueryElevationComponent.java
lucene/dev/branches/solr7790/solr/core/src/java/org/apache/solr/handler/component/StatsValuesFactory.java
lucene/dev/branches/solr7790/solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java
lucene/dev/branches/solr7790/solr/core/src/java/org/apache/solr/search/ReRankQParserPlugin.java
lucene/dev/branches/solr7790/solr/core/src/test/org/apache/solr/handler/component/TestDistributedStatsComponentCardinality.java
Modified: lucene/dev/branches/solr7790/lucene/grouping/src/java/org/apache/lucene/search/grouping/AbstractSecondPassGroupingCollector.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solr7790/lucene/grouping/src/java/org/apache/lucene/search/grouping/AbstractSecondPassGroupingCollector.java?rev=1690913&r1=1690879&r2=1690913&view=diff
==============================================================================
--- lucene/dev/branches/solr7790/lucene/grouping/src/java/org/apache/lucene/search/grouping/AbstractSecondPassGroupingCollector.java (original)
+++ lucene/dev/branches/solr7790/lucene/grouping/src/java/org/apache/lucene/search/grouping/AbstractSecondPassGroupingCollector.java Tue Jul 14 12:31:19 2015
@@ -142,7 +142,7 @@ public abstract class AbstractSecondPass
// TODO: merge with SearchGroup or not?
// ad: don't need to build a new hashmap
// disad: blows up the size of SearchGroup if we need many of them, and couples implementations
- public class SearchGroupDocs<GROUP_VALUE_TYPE> {
+ public static class SearchGroupDocs<GROUP_VALUE_TYPE> {
public final GROUP_VALUE_TYPE groupValue;
public final TopDocsCollector<?> collector;
Modified: lucene/dev/branches/solr7790/lucene/ivy-versions.properties
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solr7790/lucene/ivy-versions.properties?rev=1690913&r1=1690879&r2=1690913&view=diff
==============================================================================
--- lucene/dev/branches/solr7790/lucene/ivy-versions.properties (original)
+++ lucene/dev/branches/solr7790/lucene/ivy-versions.properties Tue Jul 14 12:31:19 2015
@@ -11,7 +11,7 @@ com.carrotsearch.randomizedtesting.versi
/com.carrotsearch.randomizedtesting/junit4-ant = ${com.carrotsearch.randomizedtesting.version}
/com.carrotsearch.randomizedtesting/randomizedtesting-runner = ${com.carrotsearch.randomizedtesting.version}
-/com.carrotsearch/hppc = 0.5.2
+/com.carrotsearch/hppc = 0.7.1
com.codahale.metrics.version = 3.0.1
/com.codahale.metrics/metrics-core = ${com.codahale.metrics.version}
@@ -30,7 +30,7 @@ com.fasterxml.jackson.core.version = 2.5
/com.github.ben-manes.caffeine/caffeine = 1.0.1
-/com.google.guava/guava = 14.0.1
+/com.google.guava/guava = 18.0
com.google.inject.guice.version = 3.0
/com.google.inject.extensions/guice-servlet = ${com.google.inject.guice.version}
@@ -213,10 +213,10 @@ org.bouncycastle.version = 1.45
/org.bouncycastle/bcmail-jdk15 = ${org.bouncycastle.version}
/org.bouncycastle/bcprov-jdk15 = ${org.bouncycastle.version}
-/org.carrot2.attributes/attributes-binder = 1.2.1
-/org.carrot2/carrot2-mini = 3.9.0
+/org.carrot2.attributes/attributes-binder = 1.2.2
+/org.carrot2/carrot2-mini = 3.10.1
-org.carrot2.morfologik.version = 1.7.1
+org.carrot2.morfologik.version = 1.10.0
/org.carrot2/morfologik-fsa = ${org.carrot2.morfologik.version}
/org.carrot2/morfologik-polish = ${org.carrot2.morfologik.version}
/org.carrot2/morfologik-stemming = ${org.carrot2.morfologik.version}
@@ -288,7 +288,7 @@ org.restlet.jee.version = 2.3.0
/org.restlet.jee/org.restlet = ${org.restlet.jee.version}
/org.restlet.jee/org.restlet.ext.servlet = ${org.restlet.jee.version}
-/org.simpleframework/simple-xml = 2.7
+/org.simpleframework/simple-xml = 2.7.1
org.slf4j.version = 1.7.7
/org.slf4j/jcl-over-slf4j = ${org.slf4j.version}
Added: lucene/dev/branches/solr7790/lucene/licenses/morfologik-fsa-1.10.0.jar.sha1
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solr7790/lucene/licenses/morfologik-fsa-1.10.0.jar.sha1?rev=1690913&view=auto
==============================================================================
--- lucene/dev/branches/solr7790/lucene/licenses/morfologik-fsa-1.10.0.jar.sha1 (added)
+++ lucene/dev/branches/solr7790/lucene/licenses/morfologik-fsa-1.10.0.jar.sha1 Tue Jul 14 12:31:19 2015
@@ -0,0 +1 @@
+87100c6baf60f096b42b9af06dafeb20f686cd02
Added: lucene/dev/branches/solr7790/lucene/licenses/morfologik-polish-1.10.0.jar.sha1
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solr7790/lucene/licenses/morfologik-polish-1.10.0.jar.sha1?rev=1690913&view=auto
==============================================================================
--- lucene/dev/branches/solr7790/lucene/licenses/morfologik-polish-1.10.0.jar.sha1 (added)
+++ lucene/dev/branches/solr7790/lucene/licenses/morfologik-polish-1.10.0.jar.sha1 Tue Jul 14 12:31:19 2015
@@ -0,0 +1 @@
+0f8eeb58acb5a39e162c0d49fcf29a70744cc2bc
Added: lucene/dev/branches/solr7790/lucene/licenses/morfologik-stemming-1.10.0.jar.sha1
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solr7790/lucene/licenses/morfologik-stemming-1.10.0.jar.sha1?rev=1690913&view=auto
==============================================================================
--- lucene/dev/branches/solr7790/lucene/licenses/morfologik-stemming-1.10.0.jar.sha1 (added)
+++ lucene/dev/branches/solr7790/lucene/licenses/morfologik-stemming-1.10.0.jar.sha1 Tue Jul 14 12:31:19 2015
@@ -0,0 +1 @@
+a74ad7ceb29ff1d8194eb161f5b2dfbd636626a5
Modified: lucene/dev/branches/solr7790/solr/contrib/clustering/ivy.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solr7790/solr/contrib/clustering/ivy.xml?rev=1690913&r1=1690879&r2=1690913&view=diff
==============================================================================
--- lucene/dev/branches/solr7790/solr/contrib/clustering/ivy.xml (original)
+++ lucene/dev/branches/solr7790/solr/contrib/clustering/ivy.xml Tue Jul 14 12:31:19 2015
@@ -25,24 +25,20 @@
<dependencies>
<dependency org="org.carrot2" name="carrot2-mini" rev="${/org.carrot2/carrot2-mini}" conf="compile"/>
- <dependency org="com.carrotsearch" name="hppc" rev="${/com.carrotsearch/hppc}" conf="compile"/>
<dependency org="org.carrot2.attributes" name="attributes-binder" rev="${/org.carrot2.attributes/attributes-binder}" conf="compile"/>
<dependency org="org.simpleframework" name="simple-xml" rev="${/org.simpleframework/simple-xml}" conf="compile"/>
- <dependency org="org.apache.mahout" name="mahout-math" rev="${/org.apache.mahout/mahout-math}" conf="compile"/>
+ <dependency org="org.apache.mahout" name="mahout-math" rev="${/org.apache.mahout/mahout-math}" conf="compile"/>
<dependency org="org.apache.mahout" name="mahout-collections" rev="${/org.apache.mahout/mahout-collections}" conf="compile"/>
- <dependency org="org.codehaus.jackson" name="jackson-core-asl" rev="${/org.codehaus.jackson/jackson-core-asl}" conf="compile"/>
- <dependency org="org.codehaus.jackson" name="jackson-mapper-asl" rev="${/org.codehaus.jackson/jackson-mapper-asl}" conf="compile"/>
-
- <!--
- Included as part of Solr's environment.
-
- com.google.guava:guava:jar:14.0.1:compile
- commons-lang:commons-lang:jar:2.6:compile
- -->
-
+ <dependency org="com.fasterxml.jackson.core" name="jackson-annotations" rev="${/com.fasterxml.jackson.core/jackson-annotations}" conf="compile"/>
+ <dependency org="com.fasterxml.jackson.core" name="jackson-databind" rev="${/com.fasterxml.jackson.core/jackson-databind}" conf="compile"/>
+
<dependency org="org.slf4j" name="jcl-over-slf4j" rev="${/org.slf4j/jcl-over-slf4j}" conf="test"/>
+
+ <!--
+ NOTE: There are dependencies that are part of core Solr server (jackson-core, HPPC, etc.).
+ -->
<exclude org="*" ext="*" matcher="regexp" type="${ivy.exclude.types}"/>
</dependencies>
Modified: lucene/dev/branches/solr7790/solr/core/src/java/org/apache/solr/handler/component/ExpandComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solr7790/solr/core/src/java/org/apache/solr/handler/component/ExpandComponent.java?rev=1690913&r1=1690879&r2=1690913&view=diff
==============================================================================
--- lucene/dev/branches/solr7790/solr/core/src/java/org/apache/solr/handler/component/ExpandComponent.java (original)
+++ lucene/dev/branches/solr7790/solr/core/src/java/org/apache/solr/handler/component/ExpandComponent.java Tue Jul 14 12:31:19 2015
@@ -27,11 +27,11 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import com.carrotsearch.hppc.IntObjectOpenHashMap;
-import com.carrotsearch.hppc.IntOpenHashSet;
+import com.carrotsearch.hppc.IntHashSet;
+import com.carrotsearch.hppc.IntObjectHashMap;
+import com.carrotsearch.hppc.LongHashSet;
+import com.carrotsearch.hppc.LongObjectHashMap;
import com.carrotsearch.hppc.LongObjectMap;
-import com.carrotsearch.hppc.LongObjectOpenHashMap;
-import com.carrotsearch.hppc.LongOpenHashSet;
import com.carrotsearch.hppc.cursors.IntObjectCursor;
import com.carrotsearch.hppc.cursors.LongCursor;
import com.carrotsearch.hppc.cursors.LongObjectCursor;
@@ -247,9 +247,9 @@ public class ExpandComponent extends Sea
}
FixedBitSet groupBits = null;
- LongOpenHashSet groupSet = null;
+ LongHashSet groupSet = null;
DocList docList = rb.getResults().docList;
- IntOpenHashSet collapsedSet = new IntOpenHashSet(docList.size() * 2);
+ IntHashSet collapsedSet = new IntHashSet(docList.size() * 2);
//Gather the groups for the current page of documents
DocIterator idit = docList.iterator();
@@ -269,7 +269,7 @@ public class ExpandComponent extends Sea
int currentContext = 0;
int currentDocBase = contexts.get(currentContext).docBase;
int nextDocBase = (currentContext+1)<contexts.size() ? contexts.get(currentContext+1).docBase : Integer.MAX_VALUE;
- IntObjectOpenHashMap<BytesRef> ordBytes = null;
+ IntObjectHashMap<BytesRef> ordBytes = null;
if(values != null) {
groupBits = new FixedBitSet(values.getValueCount());
MultiDocValues.OrdinalMap ordinalMap = null;
@@ -284,7 +284,7 @@ public class ExpandComponent extends Sea
}
int count = 0;
- ordBytes = new IntObjectOpenHashMap();
+ ordBytes = new IntObjectHashMap<>();
for(int i=0; i<globalDocs.length; i++) {
int globalDoc = globalDocs[i];
@@ -329,7 +329,7 @@ public class ExpandComponent extends Sea
}
}
} else {
- groupSet = new LongOpenHashSet((int)(docList.size()*1.25));
+ groupSet = new LongHashSet(docList.size());
NumericDocValues collapseValues = contexts.get(currentContext).reader().getNumericDocValues(field);
int count = 0;
for(int i=0; i<globalDocs.length; i++) {
@@ -389,12 +389,12 @@ public class ExpandComponent extends Sea
.build();
searcher.search(q, collector);
}
- LongObjectMap groups = ((GroupCollector)groupExpandCollector).getGroups();
+ LongObjectMap<Collector> groups = ((GroupCollector) groupExpandCollector).getGroups();
NamedList outMap = new SimpleOrderedMap();
CharsRefBuilder charsRef = new CharsRefBuilder();
- for (LongObjectCursor cursor : (Iterable<LongObjectCursor>) groups) {
+ for (LongObjectCursor<Collector> cursor : groups) {
long groupValue = cursor.key;
- TopDocsCollector topDocsCollector = (TopDocsCollector) cursor.value;
+ TopDocsCollector<?> topDocsCollector = TopDocsCollector.class.cast(cursor.value);
TopDocs topDocs = topDocsCollector.topDocs();
ScoreDoc[] scoreDocs = topDocs.scoreDocs;
if (scoreDocs.length > 0) {
@@ -502,11 +502,11 @@ public class ExpandComponent extends Sea
private LongObjectMap<Collector> groups;
private FixedBitSet groupBits;
- private IntOpenHashSet collapsedSet;
+ private IntHashSet collapsedSet;
- public GroupExpandCollector(SortedDocValues docValues, FixedBitSet groupBits, IntOpenHashSet collapsedSet, int limit, Sort sort) throws IOException {
+ public GroupExpandCollector(SortedDocValues docValues, FixedBitSet groupBits, IntHashSet collapsedSet, int limit, Sort sort) throws IOException {
int numGroups = collapsedSet.size();
- groups = new LongObjectOpenHashMap<>(numGroups * 2);
+ groups = new LongObjectHashMap<>(numGroups);
DocIdSetIterator iterator = new BitSetIterator(groupBits, 0); // cost is not useful here
int group;
while ((group = iterator.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) {
@@ -536,7 +536,7 @@ public class ExpandComponent extends Sea
this.segmentOrdinalMap = ordinalMap.getGlobalOrds(context.ord);
}
- final LongObjectMap<LeafCollector> leafCollectors = new LongObjectOpenHashMap<>();
+ final LongObjectMap<LeafCollector> leafCollectors = new LongObjectHashMap<>();
for (LongObjectCursor<Collector> entry : groups) {
leafCollectors.put(entry.key, entry.value.getLeafCollector(context));
}
@@ -578,17 +578,16 @@ public class ExpandComponent extends Sea
private class NumericGroupExpandCollector implements Collector, GroupCollector {
private NumericDocValues docValues;
-
private String field;
- private LongObjectOpenHashMap<Collector> groups;
+ private LongObjectHashMap<Collector> groups;
- private IntOpenHashSet collapsedSet;
+ private IntHashSet collapsedSet;
private long nullValue;
- public NumericGroupExpandCollector(String field, long nullValue, LongOpenHashSet groupSet, IntOpenHashSet collapsedSet, int limit, Sort sort) throws IOException {
+ public NumericGroupExpandCollector(String field, long nullValue, LongHashSet groupSet, IntHashSet collapsedSet, int limit, Sort sort) throws IOException {
int numGroups = collapsedSet.size();
this.nullValue = nullValue;
- groups = new LongObjectOpenHashMap(numGroups * 2);
+ groups = new LongObjectHashMap<>(numGroups);
Iterator<LongCursor> iterator = groupSet.iterator();
while (iterator.hasNext()) {
LongCursor cursor = iterator.next();
@@ -609,7 +608,7 @@ public class ExpandComponent extends Sea
final int docBase = context.docBase;
this.docValues = context.reader().getNumericDocValues(this.field);
- final LongObjectOpenHashMap<LeafCollector> leafCollectors = new LongObjectOpenHashMap<>();
+ final LongObjectHashMap<LeafCollector> leafCollectors = new LongObjectHashMap<>();
for (LongObjectCursor<Collector> entry : groups) {
leafCollectors.put(entry.key, entry.value.getLeafCollector(context));
@@ -627,29 +626,30 @@ public class ExpandComponent extends Sea
@Override
public void collect(int docId) throws IOException {
long value = docValues.get(docId);
- if (value != nullValue && leafCollectors.containsKey(value) && !collapsedSet.contains(docId + docBase)) {
- LeafCollector c = leafCollectors.lget();
- c.collect(docId);
+ final int index;
+ if (value != nullValue &&
+ (index = leafCollectors.indexOf(value)) >= 0 &&
+ !collapsedSet.contains(docId + docBase)) {
+ leafCollectors.indexGet(index).collect(docId);
}
}
};
}
- public LongObjectOpenHashMap<Collector> getGroups() {
+ public LongObjectHashMap<Collector> getGroups() {
return groups;
}
}
private interface GroupCollector {
- public LongObjectMap getGroups();
-
+ public LongObjectMap<Collector> getGroups();
}
private Query getGroupQuery(String fname,
FieldType ft,
int size,
- LongOpenHashSet groupSet) {
+ LongHashSet groupSet) {
BytesRef[] bytesRefs = new BytesRef[size];
BytesRefBuilder term = new BytesRefBuilder();
@@ -676,8 +676,7 @@ public class ExpandComponent extends Sea
private Query getGroupQuery(String fname,
int size,
- IntObjectOpenHashMap<BytesRef> ordBytes) throws Exception {
-
+ IntObjectHashMap<BytesRef> ordBytes) throws Exception {
BytesRef[] bytesRefs = new BytesRef[size];
int index = -1;
Iterator<IntObjectCursor<BytesRef>>it = ordBytes.iterator();
@@ -728,7 +727,7 @@ public class ExpandComponent extends Sea
public FieldInfos getFieldInfos() {
Iterator<FieldInfo> it = in.getFieldInfos().iterator();
- List<FieldInfo> newInfos = new ArrayList();
+ List<FieldInfo> newInfos = new ArrayList<>();
while(it.hasNext()) {
FieldInfo fieldInfo = it.next();
Modified: lucene/dev/branches/solr7790/solr/core/src/java/org/apache/solr/handler/component/QueryElevationComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solr7790/solr/core/src/java/org/apache/solr/handler/component/QueryElevationComponent.java?rev=1690913&r1=1690879&r2=1690913&view=diff
==============================================================================
--- lucene/dev/branches/solr7790/solr/core/src/java/org/apache/solr/handler/component/QueryElevationComponent.java (original)
+++ lucene/dev/branches/solr7790/solr/core/src/java/org/apache/solr/handler/component/QueryElevationComponent.java Tue Jul 14 12:31:19 2015
@@ -17,8 +17,6 @@
package org.apache.solr.handler.component;
-import com.carrotsearch.hppc.IntIntOpenHashMap;
-
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
@@ -73,6 +71,8 @@ import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
+import com.carrotsearch.hppc.IntIntHashMap;
+
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpressionException;
@@ -536,16 +536,16 @@ public class QueryElevationComponent ext
}
- public static IntIntOpenHashMap getBoostDocs(SolrIndexSearcher indexSearcher, Map<BytesRef, Integer>boosted, Map context) throws IOException {
+ public static IntIntHashMap getBoostDocs(SolrIndexSearcher indexSearcher, Map<BytesRef, Integer>boosted, Map context) throws IOException {
- IntIntOpenHashMap boostDocs = null;
+ IntIntHashMap boostDocs = null;
if(boosted != null) {
//First see if it's already in the request context. Could have been put there
//by another caller.
if(context != null) {
- boostDocs = (IntIntOpenHashMap)context.get(BOOSTED_DOCIDS);
+ boostDocs = (IntIntHashMap) context.get(BOOSTED_DOCIDS);
}
if(boostDocs != null) {
@@ -555,13 +555,13 @@ public class QueryElevationComponent ext
SchemaField idField = indexSearcher.getSchema().getUniqueKeyField();
String fieldName = idField.getName();
- HashSet<BytesRef> localBoosts = new HashSet(boosted.size()*2);
+ HashSet<BytesRef> localBoosts = new HashSet<>(boosted.size()*2);
Iterator<BytesRef> boostedIt = boosted.keySet().iterator();
while(boostedIt.hasNext()) {
localBoosts.add(boostedIt.next());
}
- boostDocs = new IntIntOpenHashMap(boosted.size()*2);
+ boostDocs = new IntIntHashMap(boosted.size());
List<LeafReaderContext>leaves = indexSearcher.getTopReaderContext().leaves();
PostingsEnum postingsEnum = null;
Modified: lucene/dev/branches/solr7790/solr/core/src/java/org/apache/solr/handler/component/StatsValuesFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solr7790/solr/core/src/java/org/apache/solr/handler/component/StatsValuesFactory.java?rev=1690913&r1=1690879&r2=1690913&view=diff
==============================================================================
--- lucene/dev/branches/solr7790/solr/core/src/java/org/apache/solr/handler/component/StatsValuesFactory.java (original)
+++ lucene/dev/branches/solr7790/solr/core/src/java/org/apache/solr/handler/component/StatsValuesFactory.java Tue Jul 14 12:31:19 2015
@@ -20,6 +20,7 @@ package org.apache.solr.handler.componen
import java.io.IOException;
import java.util.*;
import java.nio.ByteBuffer;
+import java.nio.charset.StandardCharsets;
import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.queries.function.FunctionValues;
@@ -36,6 +37,7 @@ import com.tdunning.math.stats.AVLTreeDi
import net.agkn.hll.HLL;
import net.agkn.hll.HLLType;
+
import com.google.common.hash.Hashing;
import com.google.common.hash.HashFunction;
@@ -823,8 +825,7 @@ class StringStatsValues extends Abstract
@Override
public long hash(String v) {
- // NOTE: renamed hashUnencodedChars starting with guava 15
- return hasher.hashString(v).asLong();
+ return hasher.hashUnencodedChars(v).asLong();
}
@Override
Modified: lucene/dev/branches/solr7790/solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solr7790/solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java?rev=1690913&r1=1690879&r2=1690913&view=diff
==============================================================================
--- lucene/dev/branches/solr7790/solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java (original)
+++ lucene/dev/branches/solr7790/solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java Tue Jul 14 12:31:19 2015
@@ -27,8 +27,8 @@ import java.util.Map;
import com.carrotsearch.hppc.FloatArrayList;
import com.carrotsearch.hppc.IntArrayList;
-import com.carrotsearch.hppc.IntIntOpenHashMap;
-import com.carrotsearch.hppc.IntLongOpenHashMap;
+import com.carrotsearch.hppc.IntIntHashMap;
+import com.carrotsearch.hppc.IntLongHashMap;
import com.carrotsearch.hppc.cursors.IntIntCursor;
import com.carrotsearch.hppc.cursors.IntLongCursor;
import org.apache.lucene.index.DocValues;
@@ -228,8 +228,8 @@ public class CollapsingQParserPlugin ext
}
}
- private IntIntOpenHashMap getBoostDocs(SolrIndexSearcher indexSearcher, Map<BytesRef, Integer> boosted, Map context) throws IOException {
- IntIntOpenHashMap boostDocs = QueryElevationComponent.getBoostDocs(indexSearcher, boosted, context);
+ private IntIntHashMap getBoostDocs(SolrIndexSearcher indexSearcher, Map<BytesRef, Integer> boosted, Map context) throws IOException {
+ IntIntHashMap boostDocs = QueryElevationComponent.getBoostDocs(indexSearcher, boosted, context);
return boostDocs;
}
@@ -242,7 +242,7 @@ public class CollapsingQParserPlugin ext
//We have to deal with it here rather then the constructor because
//because the QueryElevationComponent runs after the Queries are constructed.
- IntIntOpenHashMap boostDocsMap = null;
+ IntIntHashMap boostDocsMap = null;
Map context = null;
SolrRequestInfo info = SolrRequestInfo.getRequestInfo();
if(info != null) {
@@ -413,7 +413,7 @@ public class CollapsingQParserPlugin ext
int segments,
SortedDocValues collapseValues,
int nullPolicy,
- IntIntOpenHashMap boostDocsMap) {
+ IntIntHashMap boostDocsMap) {
this.maxDoc = maxDoc;
this.contexts = new LeafReaderContext[segments];
this.collapsedSet = new FixedBitSet(maxDoc);
@@ -608,7 +608,7 @@ public class CollapsingQParserPlugin ext
private LeafReaderContext[] contexts;
private FixedBitSet collapsedSet;
private NumericDocValues collapseValues;
- private IntLongOpenHashMap cmap;
+ private IntLongHashMap cmap;
private int maxDoc;
private int nullPolicy;
private float nullScore = -Float.MAX_VALUE;
@@ -627,7 +627,7 @@ public class CollapsingQParserPlugin ext
int nullPolicy,
int size,
String field,
- IntIntOpenHashMap boostDocsMap) {
+ IntIntHashMap boostDocsMap) {
this.maxDoc = maxDoc;
this.contexts = new LeafReaderContext[segments];
this.collapsedSet = new FixedBitSet(maxDoc);
@@ -636,7 +636,7 @@ public class CollapsingQParserPlugin ext
if(nullPolicy == CollapsingPostFilter.NULL_POLICY_EXPAND) {
nullScores = new FloatArrayList();
}
- this.cmap = new IntLongOpenHashMap(size);
+ this.cmap = new IntLongHashMap(size);
this.field = field;
if(boostDocsMap != null) {
@@ -680,18 +680,19 @@ public class CollapsingQParserPlugin ext
if(collapseValue != nullValue) {
float score = scorer.score();
- if(cmap.containsKey(collapseValue)) {
- long scoreDoc = cmap.lget();
+ final int idx;
+ if((idx = cmap.indexOf(collapseValue)) >= 0) {
+ long scoreDoc = cmap.indexGet(idx);
int testScore = (int)(scoreDoc>>32);
int currentScore = Float.floatToRawIntBits(score);
if(currentScore > testScore) {
//Current score is higher so replace the old scoreDoc with the current scoreDoc
- cmap.lset((((long)currentScore)<<32)+globalDoc);
+ cmap.indexReplace(idx, (((long)currentScore)<<32)+globalDoc);
}
} else {
//Combine the score and document into a long.
long scoreDoc = (((long)Float.floatToRawIntBits(score))<<32)+globalDoc;
- cmap.put(collapseValue, scoreDoc);
+ cmap.indexInsert(idx, collapseValue, scoreDoc);
}
} else if(nullPolicy == CollapsingPostFilter.NULL_POLICY_COLLAPSE) {
float score = scorer.score();
@@ -807,7 +808,7 @@ public class CollapsingQParserPlugin ext
boolean max,
boolean needsScores,
FieldType fieldType,
- IntIntOpenHashMap boostDocs,
+ IntIntHashMap boostDocs,
FunctionQuery funcQuery, IndexSearcher searcher) throws IOException{
this.maxDoc = maxDoc;
@@ -975,7 +976,7 @@ public class CollapsingQParserPlugin ext
boolean max,
boolean needsScores,
FieldType fieldType,
- IntIntOpenHashMap boostDocsMap,
+ IntIntHashMap boostDocsMap,
FunctionQuery funcQuery,
IndexSearcher searcher) throws IOException{
@@ -1035,7 +1036,7 @@ public class CollapsingQParserPlugin ext
DocIdSetIterator it = new BitSetIterator(collapseStrategy.getCollapsedSet(), 0); // cost is not useful here
int globalDoc = -1;
int nullScoreIndex = 0;
- IntIntOpenHashMap cmap = collapseStrategy.getCollapseMap();
+ IntIntHashMap cmap = collapseStrategy.getCollapseMap();
int[] docs = collapseStrategy.getDocs();
float[] scores = collapseStrategy.getScores();
FloatArrayList nullScores = collapseStrategy.getNullScores();
@@ -1090,7 +1091,7 @@ public class CollapsingQParserPlugin ext
String hint,
boolean needsScores,
int size,
- IntIntOpenHashMap boostDocs,
+ IntIntHashMap boostDocs,
SolrIndexSearcher searcher) throws IOException {
@@ -1285,7 +1286,7 @@ public class CollapsingQParserPlugin ext
int nullPolicy,
boolean max,
boolean needsScores,
- IntIntOpenHashMap boostDocsMap,
+ IntIntHashMap boostDocsMap,
SortedDocValues values) {
this.field = field;
this.nullPolicy = nullPolicy;
@@ -1376,7 +1377,7 @@ public class CollapsingQParserPlugin ext
int[] ords,
boolean max,
boolean needsScores,
- IntIntOpenHashMap boostDocs,
+ IntIntHashMap boostDocs,
SortedDocValues values) throws IOException {
super(maxDoc, field, nullPolicy, max, needsScores, boostDocs, values);
this.ords = ords;
@@ -1457,7 +1458,7 @@ public class CollapsingQParserPlugin ext
int[] ords,
boolean max,
boolean needsScores,
- IntIntOpenHashMap boostDocs,
+ IntIntHashMap boostDocs,
SortedDocValues values) throws IOException {
super(maxDoc, field, nullPolicy, max, needsScores, boostDocs, values);
this.ords = ords;
@@ -1539,7 +1540,7 @@ public class CollapsingQParserPlugin ext
int[] ords,
boolean max,
boolean needsScores,
- IntIntOpenHashMap boostDocs, SortedDocValues values) throws IOException {
+ IntIntHashMap boostDocs, SortedDocValues values) throws IOException {
super(maxDoc, field, nullPolicy, max, needsScores, boostDocs, values);
this.ords = ords;
this.ordVals = new long[ords.length];
@@ -1623,7 +1624,7 @@ public class CollapsingQParserPlugin ext
int[] ords,
boolean max,
boolean needsScores,
- IntIntOpenHashMap boostDocs,
+ IntIntHashMap boostDocs,
FunctionQuery funcQuery,
IndexSearcher searcher,
SortedDocValues values) throws IOException {
@@ -1707,7 +1708,7 @@ public class CollapsingQParserPlugin ext
private abstract class IntFieldValueStrategy {
protected int nullPolicy;
- protected IntIntOpenHashMap cmap;
+ protected IntIntHashMap cmap;
protected Scorer scorer;
protected FloatArrayList nullScores;
protected float nullScore;
@@ -1736,7 +1737,7 @@ public class CollapsingQParserPlugin ext
int nullPolicy,
boolean max,
boolean needsScores,
- IntIntOpenHashMap boostDocsMap) {
+ IntIntHashMap boostDocsMap) {
this.field = field;
this.collapseField = collapseField;
this.nullValue = nullValue;
@@ -1744,7 +1745,7 @@ public class CollapsingQParserPlugin ext
this.max = max;
this.needsScores = needsScores;
this.collapsedSet = new FixedBitSet(maxDoc);
- this.cmap = new IntIntOpenHashMap(size);
+ this.cmap = new IntIntHashMap(size);
if(boostDocsMap != null) {
this.boosts = true;
this.boostDocs = new IntArrayList();
@@ -1801,7 +1802,7 @@ public class CollapsingQParserPlugin ext
return nullScores;
}
- public IntIntOpenHashMap getCollapseMap() {
+ public IntIntHashMap getCollapseMap() {
return cmap;
}
@@ -1842,7 +1843,7 @@ public class CollapsingQParserPlugin ext
int nullPolicy,
boolean max,
boolean needsScores,
- IntIntOpenHashMap boostDocs) throws IOException {
+ IntIntHashMap boostDocs) throws IOException {
super(maxDoc, size, collapseField, field, nullValue, nullPolicy, max, needsScores, boostDocs);
@@ -1881,8 +1882,9 @@ public class CollapsingQParserPlugin ext
int currentVal = (int) minMaxVals.get(contextDoc);
if(collapseKey != nullValue) {
- if(cmap.containsKey(collapseKey)) {
- int pointer = cmap.lget();
+ final int idx;
+ if((idx = cmap.indexOf(collapseKey)) >= 0) {
+ int pointer = cmap.indexGet(idx);
if(comp.test(currentVal, testValues[pointer])) {
testValues[pointer]= currentVal;
docs[pointer] = globalDoc;
@@ -1942,7 +1944,7 @@ public class CollapsingQParserPlugin ext
int nullPolicy,
boolean max,
boolean needsScores,
- IntIntOpenHashMap boostDocs) throws IOException {
+ IntIntHashMap boostDocs) throws IOException {
super(maxDoc, size, collapseField, field, nullValue, nullPolicy, max, needsScores, boostDocs);
@@ -1982,8 +1984,9 @@ public class CollapsingQParserPlugin ext
float currentVal = Float.intBitsToFloat(minMaxVal);
if(collapseKey != nullValue) {
- if(cmap.containsKey(collapseKey)) {
- int pointer = cmap.lget();
+ final int idx;
+ if((idx = cmap.indexOf(collapseKey)) >= 0) {
+ int pointer = cmap.indexGet(idx);
if(comp.test(currentVal, testValues[pointer])) {
testValues[pointer] = currentVal;
docs[pointer] = globalDoc;
@@ -2054,7 +2057,7 @@ public class CollapsingQParserPlugin ext
int nullPolicy,
boolean max,
boolean needsScores,
- IntIntOpenHashMap boostDocs,
+ IntIntHashMap boostDocs,
FunctionQuery funcQuery,
IndexSearcher searcher) throws IOException {
@@ -2108,8 +2111,9 @@ public class CollapsingQParserPlugin ext
float currentVal = functionValues.floatVal(contextDoc);
if(collapseKey != nullValue) {
- if(cmap.containsKey(collapseKey)) {
- int pointer = cmap.lget();
+ final int idx;
+ if((idx = cmap.indexOf(collapseKey)) >= 0) {
+ int pointer = cmap.indexGet(idx);
if(comp.test(currentVal, testValues[pointer])) {
testValues[pointer] = currentVal;
docs[pointer] = globalDoc;
Modified: lucene/dev/branches/solr7790/solr/core/src/java/org/apache/solr/search/ReRankQParserPlugin.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solr7790/solr/core/src/java/org/apache/solr/search/ReRankQParserPlugin.java?rev=1690913&r1=1690879&r2=1690913&view=diff
==============================================================================
--- lucene/dev/branches/solr7790/solr/core/src/java/org/apache/solr/search/ReRankQParserPlugin.java (original)
+++ lucene/dev/branches/solr7790/solr/core/src/java/org/apache/solr/search/ReRankQParserPlugin.java Tue Jul 14 12:31:19 2015
@@ -23,8 +23,9 @@ import java.util.Comparator;
import java.util.Map;
import java.util.Set;
-import com.carrotsearch.hppc.IntFloatOpenHashMap;
-import com.carrotsearch.hppc.IntIntOpenHashMap;
+import com.carrotsearch.hppc.IntFloatHashMap;
+import com.carrotsearch.hppc.IntIntHashMap;
+
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.index.Term;
@@ -42,7 +43,6 @@ import org.apache.lucene.search.TopDocsC
import org.apache.lucene.search.TopFieldCollector;
import org.apache.lucene.search.TopScoreDocCollector;
import org.apache.lucene.search.Weight;
-import org.apache.lucene.util.Bits;
import org.apache.lucene.util.BytesRef;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.params.CommonParams;
@@ -292,7 +292,7 @@ public class ReRankQParserPlugin extends
requestContext = info.getReq().getContext();
}
- IntIntOpenHashMap boostedDocs = QueryElevationComponent.getBoostDocs((SolrIndexSearcher)searcher, boostedPriority, requestContext);
+ IntIntHashMap boostedDocs = QueryElevationComponent.getBoostDocs((SolrIndexSearcher)searcher, boostedPriority, requestContext);
ScoreDoc[] mainScoreDocs = mainDocs.scoreDocs;
ScoreDoc[] reRankScoreDocs = new ScoreDoc[Math.min(mainScoreDocs.length, reRankDocs)];
@@ -391,14 +391,15 @@ public class ReRankQParserPlugin extends
}
public class BoostedComp implements Comparator {
- IntFloatOpenHashMap boostedMap;
+ IntFloatHashMap boostedMap;
- public BoostedComp(IntIntOpenHashMap boostedDocs, ScoreDoc[] scoreDocs, float maxScore) {
- this.boostedMap = new IntFloatOpenHashMap(boostedDocs.size()*2);
+ public BoostedComp(IntIntHashMap boostedDocs, ScoreDoc[] scoreDocs, float maxScore) {
+ this.boostedMap = new IntFloatHashMap(boostedDocs.size()*2);
for(int i=0; i<scoreDocs.length; i++) {
- if(boostedDocs.containsKey(scoreDocs[i].doc)) {
- boostedMap.put(scoreDocs[i].doc, maxScore+boostedDocs.lget());
+ final int idx;
+ if((idx = boostedDocs.indexOf(scoreDocs[i].doc)) >= 0) {
+ boostedMap.put(scoreDocs[i].doc, maxScore+boostedDocs.indexGet(idx));
} else {
break;
}
@@ -410,21 +411,16 @@ public class ReRankQParserPlugin extends
ScoreDoc doc2 = (ScoreDoc) o2;
float score1 = doc1.score;
float score2 = doc2.score;
- if(boostedMap.containsKey(doc1.doc)) {
- score1 = boostedMap.lget();
+ int idx;
+ if((idx = boostedMap.indexOf(doc1.doc)) >= 0) {
+ score1 = boostedMap.indexGet(idx);
}
- if(boostedMap.containsKey(doc2.doc)) {
- score2 = boostedMap.lget();
+ if((idx = boostedMap.indexOf(doc2.doc)) >= 0) {
+ score2 = boostedMap.indexGet(idx);
}
- if(score1 > score2) {
- return -1;
- } else if(score1 < score2) {
- return 1;
- } else {
- return 0;
- }
+ return -Float.compare(score1, score2);
}
}
}
\ No newline at end of file
Modified: lucene/dev/branches/solr7790/solr/core/src/test/org/apache/solr/handler/component/TestDistributedStatsComponentCardinality.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solr7790/solr/core/src/test/org/apache/solr/handler/component/TestDistributedStatsComponentCardinality.java?rev=1690913&r1=1690879&r2=1690913&view=diff
==============================================================================
--- lucene/dev/branches/solr7790/solr/core/src/test/org/apache/solr/handler/component/TestDistributedStatsComponentCardinality.java (original)
+++ lucene/dev/branches/solr7790/solr/core/src/test/org/apache/solr/handler/component/TestDistributedStatsComponentCardinality.java Tue Jul 14 12:31:19 2015
@@ -88,8 +88,7 @@ public class TestDistributedStatsCompone
"long_l", ""+longValue,
"long_l_prehashed_l", ""+HASHER.hashLong(longValue).asLong(),
"string_s", strValue,
- // NOTE: renamed hashUnencodedChars starting with guava 15
- "string_s_prehashed_l", ""+HASHER.hashString(strValue).asLong()));
+ "string_s_prehashed_l", ""+HASHER.hashUnencodedChars(strValue).asLong()));
longValue -= BIG_PRIME;
}
Added: lucene/dev/branches/solr7790/solr/licenses/attributes-binder-1.2.2.jar.sha1
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solr7790/solr/licenses/attributes-binder-1.2.2.jar.sha1?rev=1690913&view=auto
==============================================================================
--- lucene/dev/branches/solr7790/solr/licenses/attributes-binder-1.2.2.jar.sha1 (added)
+++ lucene/dev/branches/solr7790/solr/licenses/attributes-binder-1.2.2.jar.sha1 Tue Jul 14 12:31:19 2015
@@ -0,0 +1 @@
+dc783c3874bc476cc9e8a68dd1a9075b3b659dc8
Added: lucene/dev/branches/solr7790/solr/licenses/carrot2-mini-3.10.1.jar.sha1
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solr7790/solr/licenses/carrot2-mini-3.10.1.jar.sha1?rev=1690913&view=auto
==============================================================================
--- lucene/dev/branches/solr7790/solr/licenses/carrot2-mini-3.10.1.jar.sha1 (added)
+++ lucene/dev/branches/solr7790/solr/licenses/carrot2-mini-3.10.1.jar.sha1 Tue Jul 14 12:31:19 2015
@@ -0,0 +1 @@
+0a71a0e4998ce82d3ecf1f95e5224ef2a5137299
Added: lucene/dev/branches/solr7790/solr/licenses/guava-18.0.jar.sha1
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solr7790/solr/licenses/guava-18.0.jar.sha1?rev=1690913&view=auto
==============================================================================
--- lucene/dev/branches/solr7790/solr/licenses/guava-18.0.jar.sha1 (added)
+++ lucene/dev/branches/solr7790/solr/licenses/guava-18.0.jar.sha1 Tue Jul 14 12:31:19 2015
@@ -0,0 +1 @@
+cce0823396aa693798f8882e64213b1772032b09
Added: lucene/dev/branches/solr7790/solr/licenses/hppc-0.7.1.jar.sha1
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solr7790/solr/licenses/hppc-0.7.1.jar.sha1?rev=1690913&view=auto
==============================================================================
--- lucene/dev/branches/solr7790/solr/licenses/hppc-0.7.1.jar.sha1 (added)
+++ lucene/dev/branches/solr7790/solr/licenses/hppc-0.7.1.jar.sha1 Tue Jul 14 12:31:19 2015
@@ -0,0 +1 @@
+8b5057f74ea378c0150a1860874a3ebdcb713767
Added: lucene/dev/branches/solr7790/solr/licenses/morfologik-fsa-1.10.0.jar.sha1
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solr7790/solr/licenses/morfologik-fsa-1.10.0.jar.sha1?rev=1690913&view=auto
==============================================================================
--- lucene/dev/branches/solr7790/solr/licenses/morfologik-fsa-1.10.0.jar.sha1 (added)
+++ lucene/dev/branches/solr7790/solr/licenses/morfologik-fsa-1.10.0.jar.sha1 Tue Jul 14 12:31:19 2015
@@ -0,0 +1 @@
+87100c6baf60f096b42b9af06dafeb20f686cd02
Added: lucene/dev/branches/solr7790/solr/licenses/morfologik-polish-1.10.0.jar.sha1
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solr7790/solr/licenses/morfologik-polish-1.10.0.jar.sha1?rev=1690913&view=auto
==============================================================================
--- lucene/dev/branches/solr7790/solr/licenses/morfologik-polish-1.10.0.jar.sha1 (added)
+++ lucene/dev/branches/solr7790/solr/licenses/morfologik-polish-1.10.0.jar.sha1 Tue Jul 14 12:31:19 2015
@@ -0,0 +1 @@
+0f8eeb58acb5a39e162c0d49fcf29a70744cc2bc
Added: lucene/dev/branches/solr7790/solr/licenses/morfologik-stemming-1.10.0.jar.sha1
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solr7790/solr/licenses/morfologik-stemming-1.10.0.jar.sha1?rev=1690913&view=auto
==============================================================================
--- lucene/dev/branches/solr7790/solr/licenses/morfologik-stemming-1.10.0.jar.sha1 (added)
+++ lucene/dev/branches/solr7790/solr/licenses/morfologik-stemming-1.10.0.jar.sha1 Tue Jul 14 12:31:19 2015
@@ -0,0 +1 @@
+a74ad7ceb29ff1d8194eb161f5b2dfbd636626a5
Added: lucene/dev/branches/solr7790/solr/licenses/simple-xml-2.7.1.jar.sha1
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solr7790/solr/licenses/simple-xml-2.7.1.jar.sha1?rev=1690913&view=auto
==============================================================================
--- lucene/dev/branches/solr7790/solr/licenses/simple-xml-2.7.1.jar.sha1 (added)
+++ lucene/dev/branches/solr7790/solr/licenses/simple-xml-2.7.1.jar.sha1 Tue Jul 14 12:31:19 2015
@@ -0,0 +1 @@
+dd91fb744c2ff921407475cb29a1e3fee397d411