You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by tf...@apache.org on 2017/05/08 22:07:15 UTC
[01/50] [abbrv] lucene-solr:jira/solr-10233: * SOLR-10549: The new
'large' attribute had been forgotten in /schema/fields?showDefaults=true
(David Smiley)
Repository: lucene-solr
Updated Branches:
refs/heads/jira/solr-10233 873d1da0e -> b16f0e353
* SOLR-10549: The new 'large' attribute had been forgotten in /schema/fields?showDefaults=true (David Smiley)
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/037d864b
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/037d864b
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/037d864b
Branch: refs/heads/jira/solr-10233
Commit: 037d864bf993ddba7af2bbee8f1a87b5e347240a
Parents: cbd3b02
Author: David Smiley <ds...@apache.org>
Authored: Wed May 3 09:30:34 2017 -0400
Committer: David Smiley <ds...@apache.org>
Committed: Wed May 3 09:30:34 2017 -0400
----------------------------------------------------------------------
solr/CHANGES.txt | 4 +++-
solr/core/src/java/org/apache/solr/schema/FieldType.java | 1 +
.../test/org/apache/solr/rest/schema/TestFieldTypeResource.java | 3 ++-
3 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/037d864b/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 1888d66..b443862 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -275,6 +275,8 @@ Bug Fixes
* SOLR-10588: Prevent redundant core reload on config update (Mikhail Khludnev)
+* SOLR-10549: The new 'large' attribute had been forgotten in /schema/fieldstypes?showDefaults=true (David Smiley)
+
Other Changes
----------------------
@@ -360,7 +362,7 @@ Bug Fixes
* SOLR-10420: Solr 6.x leaking one SolrZkClient instance per second (Scott Blum, Cao Manh Dat, Markus Jelsma, Steve Rowe)
-* SOLR-10439: The new 'large' attribute had been forgotten in /schema/fields?showDefaults=true
+* SOLR-10439: The new 'large' attribute had been forgotten in /schema/fields?showDefaults=true (David Smiley)
* SOLR-10527: edismax with sow=false fails to create dismax-per-term queries when any field is boosted.
(Steve Rowe)
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/037d864b/solr/core/src/java/org/apache/solr/schema/FieldType.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/schema/FieldType.java b/solr/core/src/java/org/apache/solr/schema/FieldType.java
index 3519283..a4058fb 100644
--- a/solr/core/src/java/org/apache/solr/schema/FieldType.java
+++ b/solr/core/src/java/org/apache/solr/schema/FieldType.java
@@ -870,6 +870,7 @@ public abstract class FieldType extends FieldProperties {
namedPropertyValues.add(getPropertyName(OMIT_POSITIONS), hasProperty(OMIT_POSITIONS));
namedPropertyValues.add(getPropertyName(STORE_OFFSETS), hasProperty(STORE_OFFSETS));
namedPropertyValues.add(getPropertyName(MULTIVALUED), hasProperty(MULTIVALUED));
+ namedPropertyValues.add(getPropertyName(LARGE_FIELD), hasProperty(LARGE_FIELD));
if (hasProperty(SORT_MISSING_FIRST)) {
namedPropertyValues.add(getPropertyName(SORT_MISSING_FIRST), true);
} else if (hasProperty(SORT_MISSING_LAST)) {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/037d864b/solr/core/src/test/org/apache/solr/rest/schema/TestFieldTypeResource.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/rest/schema/TestFieldTypeResource.java b/solr/core/src/test/org/apache/solr/rest/schema/TestFieldTypeResource.java
index eb72aed..b66ffc1 100644
--- a/solr/core/src/test/org/apache/solr/rest/schema/TestFieldTypeResource.java
+++ b/solr/core/src/test/org/apache/solr/rest/schema/TestFieldTypeResource.java
@@ -24,7 +24,7 @@ public class TestFieldTypeResource extends SolrRestletTestBase {
public void testGetFieldType() throws Exception {
assertQ("/schema/fieldtypes/float?indent=on&wt=xml&showDefaults=true",
"count(/response/lst[@name='fieldType']) = 1",
- "count(/response/lst[@name='fieldType']/*) = 16",
+ "count(/response/lst[@name='fieldType']/*) = 17",
"/response/lst[@name='fieldType']/str[@name='name'] = 'float'",
"/response/lst[@name='fieldType']/str[@name='class'] = 'solr.TrieFloatField'",
"/response/lst[@name='fieldType']/str[@name='precisionStep'] ='0'",
@@ -39,6 +39,7 @@ public class TestFieldTypeResource extends SolrRestletTestBase {
"/response/lst[@name='fieldType']/bool[@name='omitPositions'] = 'false'",
"/response/lst[@name='fieldType']/bool[@name='storeOffsetsWithPositions'] = 'false'",
"/response/lst[@name='fieldType']/bool[@name='multiValued'] = 'false'",
+ "/response/lst[@name='fieldType']/bool[@name='large'] = 'false'",
"/response/lst[@name='fieldType']/bool[@name='tokenized'] = 'false'");
}
[47/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10522: Revert
"SOLR-9972: SpellCheckComponent collations and suggestions returned as a JSON
object rather than a list"
Posted by tf...@apache.org.
SOLR-10522: Revert "SOLR-9972: SpellCheckComponent collations and suggestions returned as a JSON object rather than a list"
This reverts commit 4cd3d15da8ef77ef50e2bda91ed6d3c6e87b5426.
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/571264bc
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/571264bc
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/571264bc
Branch: refs/heads/jira/solr-10233
Commit: 571264bcc007a3d853f678dd7ac5b529644e938d
Parents: 07cc043
Author: jdyer1 <jd...@apache.org>
Authored: Mon May 8 13:26:42 2017 -0500
Committer: jdyer1 <jd...@apache.org>
Committed: Mon May 8 13:26:42 2017 -0500
----------------------------------------------------------------------
.../handler/component/SpellCheckComponent.java | 12 +--
.../component/SpellCheckComponentTest.java | 79 +++++++++++---------
2 files changed, 50 insertions(+), 41 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/571264bc/solr/core/src/java/org/apache/solr/handler/component/SpellCheckComponent.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/component/SpellCheckComponent.java b/solr/core/src/java/org/apache/solr/handler/component/SpellCheckComponent.java
index 4e3cd12..eee36cc 100644
--- a/solr/core/src/java/org/apache/solr/handler/component/SpellCheckComponent.java
+++ b/solr/core/src/java/org/apache/solr/handler/component/SpellCheckComponent.java
@@ -199,7 +199,8 @@ public class SpellCheckComponent extends SearchComponent implements SolrCoreAwar
boolean isCorrectlySpelled = hits > (maxResultsForSuggest==null ? 0 : maxResultsForSuggest);
NamedList response = new SimpleOrderedMap();
- response.add("suggestions", toNamedList(shardRequest, spellingResult, q, extendedResults));
+ NamedList suggestions = toNamedList(shardRequest, spellingResult, q, extendedResults);
+ response.add("suggestions", suggestions);
if (extendedResults) {
response.add("correctlySpelled", isCorrectlySpelled);
@@ -299,7 +300,7 @@ public class SpellCheckComponent extends SearchComponent implements SolrCoreAwar
//even in cases when the internal rank is the same.
Collections.sort(collations);
- NamedList collationList = new SimpleOrderedMap();
+ NamedList collationList = new NamedList();
for (SpellCheckCollation collation : collations) {
if (collationExtendedResults) {
NamedList extendedResult = new SimpleOrderedMap();
@@ -423,7 +424,8 @@ public class SpellCheckComponent extends SearchComponent implements SolrCoreAwar
NamedList response = new SimpleOrderedMap();
- response.add("suggestions", toNamedList(false, result, origQuery, extendedResults));
+ NamedList suggestions = toNamedList(false, result, origQuery, extendedResults);
+ response.add("suggestions", suggestions);
if (extendedResults) {
response.add("correctlySpelled", isCorrectlySpelled);
@@ -434,7 +436,7 @@ public class SpellCheckComponent extends SearchComponent implements SolrCoreAwar
.toArray(new SpellCheckCollation[mergeData.collations.size()]);
Arrays.sort(sortedCollations);
- NamedList collations = new SimpleOrderedMap();
+ NamedList collations = new NamedList();
int i = 0;
while (i < maxCollations && i < sortedCollations.length) {
SpellCheckCollation collation = sortedCollations[i];
@@ -634,7 +636,7 @@ public class SpellCheckComponent extends SearchComponent implements SolrCoreAwar
protected NamedList toNamedList(boolean shardRequest,
SpellingResult spellingResult, String origQuery, boolean extendedResults) {
- NamedList result = new SimpleOrderedMap();
+ NamedList result = new NamedList();
Map<Token,LinkedHashMap<String,Integer>> suggestions = spellingResult
.getSuggestions();
boolean hasFreqInfo = spellingResult.hasTokenFrequencyInfo();
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/571264bc/solr/core/src/test/org/apache/solr/handler/component/SpellCheckComponentTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/component/SpellCheckComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/SpellCheckComponentTest.java
index 473153a..37d02d9 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/SpellCheckComponentTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/SpellCheckComponentTest.java
@@ -82,62 +82,77 @@ public class SpellCheckComponentTest extends SolrTestCaseJ4 {
public void testMaximumResultsForSuggest() throws Exception {
assertJQ(req("qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", SpellingParams.SPELLCHECK_BUILD, "true", "q","lowerfilt:(this OR brwn)",
SpellingParams.SPELLCHECK_COUNT,"5", SpellingParams.SPELLCHECK_EXTENDED_RESULTS,"false", SpellingParams.SPELLCHECK_MAX_RESULTS_FOR_SUGGEST, "7")
- ,"/spellcheck/suggestions/brwn/numFound==1"
+ ,"/spellcheck/suggestions/[0]=='brwn'"
+ ,"/spellcheck/suggestions/[1]/numFound==1"
);
-
- assertJQ(req("qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", SpellingParams.SPELLCHECK_BUILD, "true", "q","lowerfilt:(this OR brwn)",
- SpellingParams.SPELLCHECK_COUNT,"5", SpellingParams.SPELLCHECK_EXTENDED_RESULTS,"false", SpellingParams.SPELLCHECK_MAX_RESULTS_FOR_SUGGEST, "6")
- ,"/spellcheck/suggestions=={}");
- // there should have been no suggestions (6<7)
-
+ try {
+ assertJQ(req("qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", SpellingParams.SPELLCHECK_BUILD, "true", "q","lowerfilt:(this OR brwn)",
+ SpellingParams.SPELLCHECK_COUNT,"5", SpellingParams.SPELLCHECK_EXTENDED_RESULTS,"false", SpellingParams.SPELLCHECK_MAX_RESULTS_FOR_SUGGEST, "6")
+ ,"/spellcheck/suggestions/[1]/numFound==1"
+ );
+ fail("there should have been no suggestions (6<7)");
+ } catch(Exception e) {
+ //correctly threw exception
+ }
assertJQ(req("qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", SpellingParams.SPELLCHECK_BUILD, "true", "q","lowerfilt:(this OR brwn)",
"fq", "id:[0 TO 9]", /*returns 10, less selective */ "fq", "lowerfilt:th*", /* returns 8, most selective */
SpellingParams.SPELLCHECK_COUNT,"5", SpellingParams.SPELLCHECK_EXTENDED_RESULTS,"false", SpellingParams.SPELLCHECK_MAX_RESULTS_FOR_SUGGEST, ".90")
- ,"/spellcheck/suggestions/brwn/numFound==1"
+ ,"/spellcheck/suggestions/[0]=='brwn'"
+ ,"/spellcheck/suggestions/[1]/numFound==1"
);
-
- assertJQ(req("qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", SpellingParams.SPELLCHECK_BUILD, "true", "q","lowerfilt:(this OR brwn)",
- "fq", "id:[0 TO 9]", /*returns 10, less selective */ "fq", "lowerfilt:th*", /* returns 8, most selective */
- SpellingParams.SPELLCHECK_COUNT,"5", SpellingParams.SPELLCHECK_EXTENDED_RESULTS,"false", SpellingParams.SPELLCHECK_MAX_RESULTS_FOR_SUGGEST, ".80")
- ,"/spellcheck/suggestions=={}");
- // there should have been no suggestions ((.8 * 8)<7)
+ try {
+ assertJQ(req("qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", SpellingParams.SPELLCHECK_BUILD, "true", "q","lowerfilt:(this OR brwn)",
+ "fq", "id:[0 TO 9]", /*returns 10, less selective */ "fq", "lowerfilt:th*", /* returns 8, most selective */
+ SpellingParams.SPELLCHECK_COUNT,"5", SpellingParams.SPELLCHECK_EXTENDED_RESULTS,"false", SpellingParams.SPELLCHECK_MAX_RESULTS_FOR_SUGGEST, ".80")
+ ,"/spellcheck/suggestions/[1]/numFound==1"
+ );
+ fail("there should have been no suggestions ((.8 * 8)<7)");
+ } catch(Exception e) {
+ //correctly threw exception
+ }
assertJQ(req("qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", SpellingParams.SPELLCHECK_BUILD, "true", "q","lowerfilt:(this OR brwn)",
"fq", "id:[0 TO 9]", SpellingParams.SPELLCHECK_MAX_RESULTS_FOR_SUGGEST_FQ, "id:[0 TO 9]",
SpellingParams.SPELLCHECK_COUNT,"5", SpellingParams.SPELLCHECK_EXTENDED_RESULTS,"false", SpellingParams.SPELLCHECK_MAX_RESULTS_FOR_SUGGEST, ".70")
- ,"/spellcheck/suggestions/brwn/numFound==1"
+ ,"/spellcheck/suggestions/[0]=='brwn'"
+ ,"/spellcheck/suggestions/[1]/numFound==1"
);
-
- assertJQ(req("qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", SpellingParams.SPELLCHECK_BUILD, "true", "q","lowerfilt:(this OR brwn)",
- "fq", "id:[0 TO 9]", SpellingParams.SPELLCHECK_MAX_RESULTS_FOR_SUGGEST_FQ, "lowerfilt:th*",
- SpellingParams.SPELLCHECK_COUNT,"5", SpellingParams.SPELLCHECK_EXTENDED_RESULTS,"false", SpellingParams.SPELLCHECK_MAX_RESULTS_FOR_SUGGEST, ".64")
- ,"/spellcheck/suggestions=={}");
- // there should have been no suggestions ((.64 * 10)<7)
+ try {
+ assertJQ(req("qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", SpellingParams.SPELLCHECK_BUILD, "true", "q","lowerfilt:(this OR brwn)",
+ "fq", "id:[0 TO 9]", SpellingParams.SPELLCHECK_MAX_RESULTS_FOR_SUGGEST_FQ, "lowerfilt:th*",
+ SpellingParams.SPELLCHECK_COUNT,"5", SpellingParams.SPELLCHECK_EXTENDED_RESULTS,"false", SpellingParams.SPELLCHECK_MAX_RESULTS_FOR_SUGGEST, ".64")
+ ,"/spellcheck/suggestions/[1]/numFound==1"
+ );
+ fail("there should have been no suggestions ((.64 * 10)<7)");
+ } catch(Exception e) {
+ //correctly threw exception
+ }
}
@Test
public void testExtendedResultsCount() throws Exception {
assertJQ(req("qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", SpellingParams.SPELLCHECK_BUILD, "true", "q","bluo", SpellingParams.SPELLCHECK_COUNT,"5", SpellingParams.SPELLCHECK_EXTENDED_RESULTS,"false")
- ,"/spellcheck/suggestions/bluo/numFound==5"
+ ,"/spellcheck/suggestions/[0]=='bluo'"
+ ,"/spellcheck/suggestions/[1]/numFound==5"
);
assertJQ(req("qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", "q","bluo", SpellingParams.SPELLCHECK_COUNT,"3", SpellingParams.SPELLCHECK_EXTENDED_RESULTS,"true")
- ,"/spellcheck/suggestions/bluo/suggestion==[{'word':'blud','freq':1}, {'word':'blue','freq':1}, {'word':'blee','freq':1}]"
+ ,"/spellcheck/suggestions/[1]/suggestion==[{'word':'blud','freq':1}, {'word':'blue','freq':1}, {'word':'blee','freq':1}]"
);
}
@Test
public void test() throws Exception {
assertJQ(req("qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", "q","documemt")
- ,"/spellcheck=={'suggestions':{'documemt':{'numFound':1,'startOffset':0,'endOffset':8,'suggestion':['document']}}}"
+ ,"/spellcheck=={'suggestions':['documemt',{'numFound':1,'startOffset':0,'endOffset':8,'suggestion':['document']}]}"
);
}
@Test
public void testNumericQuery() throws Exception {
assertJQ(req("qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", "q","12346")
- ,"/spellcheck=={'suggestions':{'12346':{'numFound':1,'startOffset':0,'endOffset':5,'suggestion':['12345']}}}"
+ ,"/spellcheck=={'suggestions':['12346',{'numFound':1,'startOffset':0,'endOffset':5,'suggestion':['12345']}]}"
);
}
@@ -171,21 +186,13 @@ public class SpellCheckComponentTest extends SolrTestCaseJ4 {
@Test
public void testCollateExtendedResultsWithJsonNl() throws Exception {
final String q = "documemtsss broens";
- final String jsonNl = (random().nextBoolean() ? "map" : "arrntv");
+ final String jsonNl = "map";
final boolean collateExtendedResults = random().nextBoolean();
final List<String> testsList = new ArrayList<String>();
if (collateExtendedResults) {
testsList.add("/spellcheck/collations/collation/collationQuery=='document brown'");
testsList.add("/spellcheck/collations/collation/hits==0");
switch (jsonNl) {
- case "arrntv":
- testsList.add("/spellcheck/collations/collation/misspellingsAndCorrections/[0]/name=='documemtsss'");
- testsList.add("/spellcheck/collations/collation/misspellingsAndCorrections/[0]/type=='str'");
- testsList.add("/spellcheck/collations/collation/misspellingsAndCorrections/[0]/value=='document'");
- testsList.add("/spellcheck/collations/collation/misspellingsAndCorrections/[1]/name=='broens'");
- testsList.add("/spellcheck/collations/collation/misspellingsAndCorrections/[1]/type=='str'");
- testsList.add("/spellcheck/collations/collation/misspellingsAndCorrections/[1]/value=='brown'");
- break;
case "map":
testsList.add("/spellcheck/collations/collation/misspellingsAndCorrections/documemtsss=='document'");
testsList.add("/spellcheck/collations/collation/misspellingsAndCorrections/broens=='brown'");
@@ -304,11 +311,11 @@ public class SpellCheckComponentTest extends SolrTestCaseJ4 {
//while "document" is present.
assertJQ(req("qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", "q","documenq", SpellingParams.SPELLCHECK_DICT, "threshold", SpellingParams.SPELLCHECK_COUNT,"5", SpellingParams.SPELLCHECK_EXTENDED_RESULTS,"true")
- ,"/spellcheck/suggestions/documenq/suggestion==[{'word':'document','freq':2}]"
+ ,"/spellcheck/suggestions/[1]/suggestion==[{'word':'document','freq':2}]"
);
assertJQ(req("qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", "q","documenq", SpellingParams.SPELLCHECK_DICT, "threshold_direct", SpellingParams.SPELLCHECK_COUNT,"5", SpellingParams.SPELLCHECK_EXTENDED_RESULTS,"true")
- ,"/spellcheck/suggestions/documenq/suggestion==[{'word':'document','freq':2}]"
+ ,"/spellcheck/suggestions/[1]/suggestion==[{'word':'document','freq':2}]"
);
//TODO: how do we make this into a 1-liner using "assertQ()" ???
[08/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-9867: fixing
TestSolrCLIRunExample.testTechproductsExample
Posted by tf...@apache.org.
SOLR-9867: fixing TestSolrCLIRunExample.testTechproductsExample
- SolrDispatchFilter.doFilter rejects invocation until init() is completed.
- introducing isLoaded=false, isLoading=true core status
- blocking shutdown until core loading stops
- looping run example tool while core is loading 1 min max.
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/32b7791f
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/32b7791f
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/32b7791f
Branch: refs/heads/jira/solr-10233
Commit: 32b7791fa8019aff2fca65c06deda48a6360da41
Parents: e912b7c
Author: Mikhail Khludnev <mk...@apache.org>
Authored: Sat Apr 29 00:25:28 2017 +0300
Committer: Mikhail Khludnev <mk...@apache.org>
Committed: Thu May 4 09:15:12 2017 +0300
----------------------------------------------------------------------
solr/CHANGES.txt | 3 +
.../java/org/apache/solr/core/SolrCores.java | 1 +
.../solr/handler/admin/CoreAdminOperation.java | 92 +++++++++++---------
.../apache/solr/servlet/SolrDispatchFilter.java | 45 ++++++----
.../src/java/org/apache/solr/util/SolrCLI.java | 39 ++++++---
.../apache/solr/util/TestSolrCLIRunExample.java | 47 ++++++----
6 files changed, 136 insertions(+), 91 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/32b7791f/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 7eaafae..ab023cc 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -332,6 +332,9 @@ Other Changes
* SOLR-10519: SolrCLI.atPath cannot handle children that begin with a slash. (Erick Erickson)
+* SOLR-9867: Adding isLoading=true as core status. Fixing start after stop scenario in bin/solr
+ (Mikhail Khludnev)
+
================== 6.5.1 ==================
Bug Fixes
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/32b7791f/solr/core/src/java/org/apache/solr/core/SolrCores.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/core/SolrCores.java b/solr/core/src/java/org/apache/solr/core/SolrCores.java
index ef6fca5..87ffac3 100644
--- a/solr/core/src/java/org/apache/solr/core/SolrCores.java
+++ b/solr/core/src/java/org/apache/solr/core/SolrCores.java
@@ -95,6 +95,7 @@ class SolrCores implements Observer {
// We are shutting down. You can't hold the lock on the various lists of cores while they shut down, so we need to
// make a temporary copy of the names and shut them down outside the lock.
protected void close() {
+ waitForLoadingCoresToFinish(30*1000);
Collection<SolrCore> coreList = new ArrayList<>();
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/32b7791f/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminOperation.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminOperation.java b/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminOperation.java
index a5dad1e..fbf24a1 100644
--- a/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminOperation.java
+++ b/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminOperation.java
@@ -303,50 +303,56 @@ enum CoreAdminOperation implements CoreAdminOp {
static NamedList<Object> getCoreStatus(CoreContainer cores, String cname, boolean isIndexInfoNeeded) throws IOException {
NamedList<Object> info = new SimpleOrderedMap<>();
- if (!cores.isLoaded(cname)) { // Lazily-loaded core, fill in what we can.
- // It would be a real mistake to load the cores just to get the status
- CoreDescriptor desc = cores.getUnloadedCoreDescriptor(cname);
- if (desc != null) {
- info.add(NAME, desc.getName());
- info.add("instanceDir", desc.getInstanceDir());
- // None of the following are guaranteed to be present in a not-yet-loaded core.
- String tmp = desc.getDataDir();
- if (StringUtils.isNotBlank(tmp)) info.add("dataDir", tmp);
- tmp = desc.getConfigName();
- if (StringUtils.isNotBlank(tmp)) info.add("config", tmp);
- tmp = desc.getSchemaName();
- if (StringUtils.isNotBlank(tmp)) info.add("schema", tmp);
- info.add("isLoaded", "false");
- }
+ if (cores.isCoreLoading(cname)) {
+ info.add(NAME, cname);
+ info.add("isLoaded", "false");
+ info.add("isLoading", "true");
} else {
- try (SolrCore core = cores.getCore(cname)) {
- if (core != null) {
- info.add(NAME, core.getName());
- info.add("instanceDir", core.getResourceLoader().getInstancePath().toString());
- info.add("dataDir", normalizePath(core.getDataDir()));
- info.add("config", core.getConfigResource());
- info.add("schema", core.getSchemaResource());
- info.add("startTime", core.getStartTimeStamp());
- info.add("uptime", core.getUptimeMs());
- if (cores.isZooKeeperAware()) {
- info.add("lastPublished", core.getCoreDescriptor().getCloudDescriptor().getLastPublished().toString().toLowerCase(Locale.ROOT));
- info.add("configVersion", core.getSolrConfig().getZnodeVersion());
- SimpleOrderedMap cloudInfo = new SimpleOrderedMap<>();
- cloudInfo.add(COLLECTION, core.getCoreDescriptor().getCloudDescriptor().getCollectionName());
- cloudInfo.add(SHARD, core.getCoreDescriptor().getCloudDescriptor().getShardId());
- cloudInfo.add(REPLICA, core.getCoreDescriptor().getCloudDescriptor().getCoreNodeName());
- info.add("cloud", cloudInfo);
- }
- if (isIndexInfoNeeded) {
- RefCounted<SolrIndexSearcher> searcher = core.getSearcher();
- try {
- SimpleOrderedMap<Object> indexInfo = LukeRequestHandler.getIndexInfo(searcher.get().getIndexReader());
- long size = getIndexSize(core);
- indexInfo.add("sizeInBytes", size);
- indexInfo.add("size", NumberUtils.readableSize(size));
- info.add("index", indexInfo);
- } finally {
- searcher.decref();
+ if (!cores.isLoaded(cname)) { // Lazily-loaded core, fill in what we can.
+ // It would be a real mistake to load the cores just to get the status
+ CoreDescriptor desc = cores.getUnloadedCoreDescriptor(cname);
+ if (desc != null) {
+ info.add(NAME, desc.getName());
+ info.add("instanceDir", desc.getInstanceDir());
+ // None of the following are guaranteed to be present in a not-yet-loaded core.
+ String tmp = desc.getDataDir();
+ if (StringUtils.isNotBlank(tmp)) info.add("dataDir", tmp);
+ tmp = desc.getConfigName();
+ if (StringUtils.isNotBlank(tmp)) info.add("config", tmp);
+ tmp = desc.getSchemaName();
+ if (StringUtils.isNotBlank(tmp)) info.add("schema", tmp);
+ info.add("isLoaded", "false");
+ }
+ } else {
+ try (SolrCore core = cores.getCore(cname)) {
+ if (core != null) {
+ info.add(NAME, core.getName());
+ info.add("instanceDir", core.getResourceLoader().getInstancePath().toString());
+ info.add("dataDir", normalizePath(core.getDataDir()));
+ info.add("config", core.getConfigResource());
+ info.add("schema", core.getSchemaResource());
+ info.add("startTime", core.getStartTimeStamp());
+ info.add("uptime", core.getUptimeMs());
+ if (cores.isZooKeeperAware()) {
+ info.add("lastPublished", core.getCoreDescriptor().getCloudDescriptor().getLastPublished().toString().toLowerCase(Locale.ROOT));
+ info.add("configVersion", core.getSolrConfig().getZnodeVersion());
+ SimpleOrderedMap cloudInfo = new SimpleOrderedMap<>();
+ cloudInfo.add(COLLECTION, core.getCoreDescriptor().getCloudDescriptor().getCollectionName());
+ cloudInfo.add(SHARD, core.getCoreDescriptor().getCloudDescriptor().getShardId());
+ cloudInfo.add(REPLICA, core.getCoreDescriptor().getCloudDescriptor().getCoreNodeName());
+ info.add("cloud", cloudInfo);
+ }
+ if (isIndexInfoNeeded) {
+ RefCounted<SolrIndexSearcher> searcher = core.getSearcher();
+ try {
+ SimpleOrderedMap<Object> indexInfo = LukeRequestHandler.getIndexInfo(searcher.get().getIndexReader());
+ long size = getIndexSize(core);
+ indexInfo.add("sizeInBytes", size);
+ indexInfo.add("size", NumberUtils.readableSize(size));
+ info.add("index", indexInfo);
+ } finally {
+ searcher.decref();
+ }
}
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/32b7791f/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java b/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
index 39ccadc..02b0460 100644
--- a/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
+++ b/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
@@ -16,18 +16,6 @@
*/
package org.apache.solr.servlet;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletInputStream;
-import javax.servlet.ServletOutputStream;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletRequestWrapper;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpServletResponseWrapper;
-
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
@@ -46,10 +34,18 @@ import java.util.concurrent.atomic.AtomicReference;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import com.codahale.metrics.jvm.ClassLoadingGaugeSet;
-import com.codahale.metrics.jvm.GarbageCollectorMetricSet;
-import com.codahale.metrics.jvm.MemoryUsageGaugeSet;
-import com.codahale.metrics.jvm.ThreadStatesGaugeSet;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletInputStream;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletRequestWrapper;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpServletResponseWrapper;
+
import org.apache.commons.io.FileCleaningTracker;
import org.apache.commons.io.input.CloseShieldInputStream;
import org.apache.commons.io.output.CloseShieldOutputStream;
@@ -78,6 +74,11 @@ import org.apache.solr.util.SolrFileCleaningTracker;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import com.codahale.metrics.jvm.ClassLoadingGaugeSet;
+import com.codahale.metrics.jvm.GarbageCollectorMetricSet;
+import com.codahale.metrics.jvm.MemoryUsageGaugeSet;
+import com.codahale.metrics.jvm.ThreadStatesGaugeSet;
+
/**
* This filter looks at the incoming URL maps them to handlers defined in solrconfig.xml
*
@@ -136,6 +137,8 @@ public class SolrDispatchFilter extends BaseSolrFilter {
public void init(FilterConfig config) throws ServletException
{
log.trace("SolrDispatchFilter.init(): {}", this.getClass().getClassLoader());
+ CoreContainer coresInit = null;
+ try{
SolrRequestParsers.fileCleaningTracker = new SolrFileCleaningTracker();
@@ -166,9 +169,9 @@ public class SolrDispatchFilter extends BaseSolrFilter {
String solrHome = (String) config.getServletContext().getAttribute(SOLRHOME_ATTRIBUTE);
ExecutorUtil.addThreadLocalProvider(SolrRequestInfo.getInheritableThreadLocalProvider());
- this.cores = createCoreContainer(solrHome == null ? SolrResourceLoader.locateSolrHome() : Paths.get(solrHome),
+ coresInit = createCoreContainer(solrHome == null ? SolrResourceLoader.locateSolrHome() : Paths.get(solrHome),
extraProperties);
- this.httpClient = cores.getUpdateShardHandler().getHttpClient();
+ this.httpClient = coresInit.getUpdateShardHandler().getHttpClient();
setupJvmMetrics();
log.debug("user.dir=" + System.getProperty("user.dir"));
}
@@ -181,7 +184,10 @@ public class SolrDispatchFilter extends BaseSolrFilter {
}
}
- log.trace("SolrDispatchFilter.init() done");
+ }finally{
+ log.trace("SolrDispatchFilter.init() done");
+ this.cores = coresInit; // crucially final assignment
+ }
}
private void setupJvmMetrics() {
@@ -308,6 +314,7 @@ public class SolrDispatchFilter extends BaseSolrFilter {
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain, boolean retry) throws IOException, ServletException {
if (!(request instanceof HttpServletRequest)) return;
+
try {
if (cores == null || cores.isShutDown()) {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/32b7791f/solr/core/src/java/org/apache/solr/util/SolrCLI.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/util/SolrCLI.java b/solr/core/src/java/org/apache/solr/util/SolrCLI.java
index a6a40a0..4ab1751 100644
--- a/solr/core/src/java/org/apache/solr/util/SolrCLI.java
+++ b/solr/core/src/java/org/apache/solr/util/SolrCLI.java
@@ -16,6 +16,12 @@
*/
package org.apache.solr.util;
+import static java.nio.charset.StandardCharsets.UTF_8;
+import static org.apache.solr.common.SolrException.ErrorCode.FORBIDDEN;
+import static org.apache.solr.common.SolrException.ErrorCode.UNAUTHORIZED;
+import static org.apache.solr.common.params.CommonParams.DISTRIB;
+import static org.apache.solr.common.params.CommonParams.NAME;
+
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
@@ -111,16 +117,12 @@ import org.noggit.ObjectBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import static java.nio.charset.StandardCharsets.UTF_8;
-import static org.apache.solr.common.SolrException.ErrorCode.FORBIDDEN;
-import static org.apache.solr.common.SolrException.ErrorCode.UNAUTHORIZED;
-import static org.apache.solr.common.params.CommonParams.DISTRIB;
-import static org.apache.solr.common.params.CommonParams.NAME;
-
/**
* Command-line utility for working with Solr.
*/
public class SolrCLI {
+ private static final long MAX_WAIT_FOR_CORE_LOAD_NANOS = TimeUnit.NANOSECONDS.convert(1, TimeUnit.MINUTES);
+
/**
* Defines the interface to a Solr tool that can be run from this command-line app.
*/
@@ -1399,18 +1401,29 @@ public class SolrCLI {
public static boolean safeCheckCoreExists(String coreStatusUrl, String coreName) {
boolean exists = false;
try {
- Map<String,Object> existsCheckResult = getJson(coreStatusUrl);
- Map<String,Object> status = (Map<String, Object>)existsCheckResult.get("status");
- Map<String,Object> coreStatus = (Map<String, Object>)status.get(coreName);
- Map<String,Object> failureStatus = (Map<String, Object>)existsCheckResult.get("initFailures");
- String errorMsg = (String) failureStatus.get(coreName);
- exists = coreStatus != null && coreStatus.containsKey(NAME) || errorMsg != null;
+ boolean wait = false;
+ final long startWaitAt = System.nanoTime();
+ do{
+ if (wait) {
+ final int clamPeriodForStatusPollMs = 1000;
+ Thread.sleep(clamPeriodForStatusPollMs);
+ }
+ Map<String,Object> existsCheckResult = getJson(coreStatusUrl);
+ Map<String,Object> status = (Map<String, Object>)existsCheckResult.get("status");
+ Map<String,Object> coreStatus = (Map<String, Object>)status.get(coreName);
+ Map<String,Object> failureStatus = (Map<String, Object>)existsCheckResult.get("initFailures");
+ String errorMsg = (String) failureStatus.get(coreName);
+ final boolean hasName = coreStatus != null && coreStatus.containsKey(NAME);
+ exists = hasName || errorMsg != null;
+ wait = hasName && errorMsg==null && "true".equals(coreStatus.get("isLoading"));
+ }while (wait &&
+ System.nanoTime() - startWaitAt < MAX_WAIT_FOR_CORE_LOAD_NANOS);
} catch (Exception exc) {
// just ignore it since we're only interested in a positive result here
}
return exists;
}
-
+
/**
* Supports create_collection command in the bin/solr script.
*/
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/32b7791f/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java b/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
index 02d91b0..6bce8226 100644
--- a/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
+++ b/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
@@ -31,6 +31,7 @@ import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import java.util.Map;
@@ -47,8 +48,8 @@ import org.apache.solr.client.solrj.response.QueryResponse;
import org.apache.solr.cloud.MiniSolrCloudCluster;
import org.apache.solr.common.SolrInputDocument;
import org.junit.After;
+import org.junit.AfterClass;
import org.junit.BeforeClass;
-import org.junit.Ignore;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -66,8 +67,15 @@ public class TestSolrCLIRunExample extends SolrTestCaseJ4 {
public static void beforeClass() throws IOException {
assumeFalse("FIXME: This test does not work with whitespace in CWD (https://issues.apache.org/jira/browse/SOLR-8877)",
Paths.get(".").toAbsolutePath().toString().contains(" "));
+ // to be true
+ System.setProperty("solr.directoryFactory", "solr.NRTCachingDirectoryFactory");
}
+ @AfterClass
+ public static void cleanupDirectoryFactory() throws IOException {
+ System.clearProperty("solr.directoryFactory");
+ }
+
/**
* Overrides the call to exec bin/solr to start Solr nodes to start them using the Solr test-framework
* instead of the script, since the script depends on a full build.
@@ -289,7 +297,6 @@ public class TestSolrCLIRunExample extends SolrTestCaseJ4 {
}
}
- @Ignore
@Test
public void testTechproductsExample() throws Exception {
testExample("techproducts");
@@ -309,6 +316,7 @@ public class TestSolrCLIRunExample extends SolrTestCaseJ4 {
File solrExampleDir = tmpDir.toFile();
File solrServerDir = solrHomeDir.getParentFile();
+ for (int i =0; i<2; i++){
// need a port to start the example server on
int bindPort = -1;
try (ServerSocket socket = new ServerSocket(0)) {
@@ -333,7 +341,8 @@ public class TestSolrCLIRunExample extends SolrTestCaseJ4 {
SolrCLI.RunExampleTool tool = new SolrCLI.RunExampleTool(executor, System.in, stdoutSim);
try {
- tool.runTool(SolrCLI.processCommandLineArgs(SolrCLI.joinCommonAndToolOptions(tool.getOptions()), toolArgs));
+ final int status = tool.runTool(SolrCLI.processCommandLineArgs(SolrCLI.joinCommonAndToolOptions(tool.getOptions()), toolArgs));
+ assertEquals("it should be ok "+tool+" "+Arrays.toString(toolArgs),0, status);
} catch (Exception e) {
log.error("RunExampleTool failed due to: " + e +
"; stdout from tool prior to failure: " + baos.toString(StandardCharsets.UTF_8.name()));
@@ -352,25 +361,31 @@ public class TestSolrCLIRunExample extends SolrTestCaseJ4 {
if ("techproducts".equals(exampleName)) {
HttpSolrClient solrClient = getHttpSolrClient("http://localhost:" + bindPort + "/solr/" + exampleName);
- SolrQuery query = new SolrQuery("*:*");
- QueryResponse qr = solrClient.query(query);
- long numFound = qr.getResults().getNumFound();
- if (numFound == 0) {
- // brief wait in case of timing issue in getting the new docs committed
- log.warn("Going to wait for 1 second before re-trying query for techproduct example docs ...");
- try {
- Thread.sleep(1000);
- } catch (InterruptedException ignore) {
- Thread.interrupted();
+ try{
+ SolrQuery query = new SolrQuery("*:*");
+ QueryResponse qr = solrClient.query(query);
+ long numFound = qr.getResults().getNumFound();
+ if (numFound == 0) {
+ // brief wait in case of timing issue in getting the new docs committed
+ log.warn("Going to wait for 1 second before re-trying query for techproduct example docs ...");
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException ignore) {
+ Thread.interrupted();
+ }
+ numFound = solrClient.query(query).getResults().getNumFound();
}
- numFound = solrClient.query(query).getResults().getNumFound();
+ assertTrue("expected 32 docs in the " + exampleName + " example but found " + numFound + ", output: " + toolOutput,
+ numFound == 32);
+ }finally{
+
+ solrClient.close();
}
- assertTrue("expected 32 docs in the " + exampleName + " example but found " + numFound + ", output: " + toolOutput,
- numFound == 32);
}
// stop the test instance
executor.execute(org.apache.commons.exec.CommandLine.parse("bin/solr stop -p " + bindPort));
+ }
}
/**
[38/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10622: Update
CHANGES.txt
Posted by tf...@apache.org.
SOLR-10622: Update 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/fd24081c
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/fd24081c
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/fd24081c
Branch: refs/heads/jira/solr-10233
Commit: fd24081c63fbe0da7406280c9fa2056c2d5a8862
Parents: d724983
Author: Joel Bernstein <jb...@apache.org>
Authored: Sun May 7 16:26:53 2017 -0400
Committer: Joel Bernstein <jb...@apache.org>
Committed: Sun May 7 16:26:53 2017 -0400
----------------------------------------------------------------------
solr/CHANGES.txt | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/fd24081c/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 4dba434..828b7fb 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -234,6 +234,8 @@ New Features
* SOLR-10536: stats Streaming Expression should work in non-SolrCloud mode (Joel Bernstein)
+* SOLR-10622: Add regress and predict Stream Evaluators (Joel Bernstein)
+
Optimizations
----------------------
[18/50] [abbrv] lucene-solr:jira/solr-10233: tests: test reset for
other bucket aggregations
Posted by tf...@apache.org.
tests: test reset for other bucket aggregations
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/bcf34054
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/bcf34054
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/bcf34054
Branch: refs/heads/jira/solr-10233
Commit: bcf3405418fe9fbddb7aa611313a1219c756c321
Parents: faa74ec
Author: yonik <yo...@apache.org>
Authored: Thu May 4 23:50:50 2017 -0400
Committer: yonik <yo...@apache.org>
Committed: Thu May 4 23:51:10 2017 -0400
----------------------------------------------------------------------
.../src/test/org/apache/solr/search/facet/TestJsonFacets.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/bcf34054/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java b/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java
index 4fcee67..4ca435c 100644
--- a/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java
+++ b/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java
@@ -1360,13 +1360,16 @@ public class TestJsonFacets extends SolrTestCaseHS {
"}"
);
+
// test acc reuse (i.e. reset() method). This is normally used for stats that are not calculated in the first phase,
// currently non-sorting stats.
client.testJQ(params(p, "q", "*:*"
- , "json.facet", "{f1:{type:terms, field:'${cat_s}', facet:{h:'hll(${where_s})'} }}"
+ , "json.facet", "{f1:{type:terms, field:'${cat_s}', facet:{h:'hll(${where_s})' , u:'unique(${where_s})', mind:'min(${num_d})', maxd:'max(${num_d})', sumd:'sum(${num_d})', avgd:'avg(${num_d})', variance:'variance(${num_d})', stddev:'stddev(${num_d})' } }}"
)
, "facets=={ 'count':6, " +
- "'f1':{ buckets:[{val:B, count:3, h:2},{val:A, count:2, h:2}] } } "
+ "'f1':{ buckets:[{val:B, count:3, h:2, u:2, mind:-9.0, maxd:11.0, sumd:-3.0, avgd:-1.0, variance:74.66666666666667, stddev:8.640987597877148}," +
+ " {val:A, count:2, h:2, u:2, mind:2.0, maxd:4.0, sumd:6.0, avgd:3.0, variance:1.0, stddev:1.0}] } } "
+
);
}
[25/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10572: Removed
three "no longer supported in solrconfig.xml" asserts.
Posted by tf...@apache.org.
SOLR-10572: Removed three "no longer supported in solrconfig.xml" asserts.
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/a96f3944
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/a96f3944
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/a96f3944
Branch: refs/heads/jira/solr-10233
Commit: a96f39449b48c7c2b4f2a82c808a97fb0c60ffc5
Parents: 07acc93
Author: Christine Poerschke <cp...@apache.org>
Authored: Thu May 4 18:20:52 2017 +0100
Committer: Christine Poerschke <cp...@apache.org>
Committed: Fri May 5 18:58:16 2017 +0100
----------------------------------------------------------------------
solr/CHANGES.txt | 2 ++
.../java/org/apache/solr/update/SolrIndexConfig.java | 12 ------------
2 files changed, 2 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a96f3944/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 5aeb05b..ec4ebe2 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -129,6 +129,8 @@ Other Changes
* SOLR-10310: By default, stop splitting on whitespace prior to analysis
in edismax and standard/"lucene" query parsers. (Steve Rowe)
+* SOLR-10572: Removed three "no longer supported in solrconfig.xml" asserts. (Christine Poerschke)
+
================== 6.6.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/a96f3944/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java b/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java
index d484e85..d7635f2 100644
--- a/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java
+++ b/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java
@@ -127,18 +127,6 @@ public class SolrIndexConfig implements MapSerializable {
luceneVersion = solrConfig.luceneMatchVersion;
- // Assert that end-of-life parameters or syntax is not in our config.
- // Warn for luceneMatchVersion's before LUCENE_3_6, fail fast above
- assertWarnOrFail("The <mergeScheduler>myclass</mergeScheduler> syntax is no longer supported in solrconfig.xml. Please use syntax <mergeScheduler class=\"myclass\"/> instead.",
- !((solrConfig.getNode(prefix + "/mergeScheduler", false) != null) && (solrConfig.get(prefix + "/mergeScheduler/@class", null) == null)),
- true);
- assertWarnOrFail("The <mergePolicy>myclass</mergePolicy> syntax is no longer supported in solrconfig.xml. Please use syntax <mergePolicy class=\"myclass\"/> instead.",
- !((solrConfig.getNode(prefix + "/mergePolicy", false) != null) && (solrConfig.get(prefix + "/mergePolicy/@class", null) == null)),
- true);
- assertWarnOrFail("The <luceneAutoCommit>true|false</luceneAutoCommit> parameter is no longer valid in solrconfig.xml.",
- solrConfig.get(prefix + "/luceneAutoCommit", null) == null,
- true);
-
effectiveUseCompoundFileSetting = solrConfig.getBool(prefix+"/useCompoundFile", def.getUseCompoundFile());
maxBufferedDocs=solrConfig.getInt(prefix+"/maxBufferedDocs",def.maxBufferedDocs);
maxMergeDocs=solrConfig.getInt(prefix+"/maxMergeDocs",def.maxMergeDocs);
[23/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10504: Update
CHANGES.txt
Posted by tf...@apache.org.
SOLR-10504: Update 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/9d2f6d2c
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/9d2f6d2c
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/9d2f6d2c
Branch: refs/heads/jira/solr-10233
Commit: 9d2f6d2cf492c751b1b9f1846947aaba6f3d39ea
Parents: 41ebeea
Author: Joel Bernstein <jb...@apache.org>
Authored: Fri May 5 13:48:47 2017 -0400
Committer: Joel Bernstein <jb...@apache.org>
Committed: Fri May 5 13:48:47 2017 -0400
----------------------------------------------------------------------
solr/CHANGES.txt | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9d2f6d2c/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 213dd9f..abfd047 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -217,6 +217,8 @@ New Features
* SOLR-10274: The search Streaming Expression should work in non-SolrCloud mode (Joel Bernstein)
+* SOLR-10504: Add echo Streaming Expression (Joel Bernstein)
+
Optimizations
----------------------
[39/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10626: Add
covariance Stream Evaluator
Posted by tf...@apache.org.
SOLR-10626: Add covariance Stream Evaluator
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/c6524c3d
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/c6524c3d
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/c6524c3d
Branch: refs/heads/jira/solr-10233
Commit: c6524c3d66b94947ec458582aa64585662d1497f
Parents: fd24081
Author: Joel Bernstein <jb...@apache.org>
Authored: Sun May 7 20:42:39 2017 -0400
Committer: Joel Bernstein <jb...@apache.org>
Committed: Sun May 7 20:42:39 2017 -0400
----------------------------------------------------------------------
.../org/apache/solr/handler/StreamHandler.java | 1 +
.../solrj/io/stream/CovarianceEvaluator.java | 77 ++++++++++++++++++++
.../solrj/io/stream/StreamExpressionTest.java | 45 ++++++++++++
3 files changed, 123 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c6524c3d/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/StreamHandler.java b/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
index f0282d0..63e521c 100644
--- a/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
@@ -170,6 +170,7 @@ public class StreamHandler extends RequestHandlerBase implements SolrCoreAware,
.withFunctionName("col", ColumnEvaluator.class)
.withFunctionName("predict", PredictEvaluator.class)
.withFunctionName("regress", RegressionEvaluator.class)
+ .withFunctionName("cov", CovarianceEvaluator.class)
// metrics
.withFunctionName("min", MinMetric.class)
.withFunctionName("max", MaxMetric.class)
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c6524c3d/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CovarianceEvaluator.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CovarianceEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CovarianceEvaluator.java
new file mode 100644
index 0000000..0e3ffcc
--- /dev/null
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CovarianceEvaluator.java
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.client.solrj.io.stream;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.apache.commons.math3.stat.correlation.Covariance;
+import org.apache.solr.client.solrj.io.Tuple;
+import org.apache.solr.client.solrj.io.eval.ComplexEvaluator;
+import org.apache.solr.client.solrj.io.eval.StreamEvaluator;
+import org.apache.solr.client.solrj.io.stream.expr.Explanation;
+import org.apache.solr.client.solrj.io.stream.expr.Explanation.ExpressionType;
+import org.apache.solr.client.solrj.io.stream.expr.Expressible;
+import org.apache.solr.client.solrj.io.stream.expr.StreamExpression;
+import org.apache.solr.client.solrj.io.stream.expr.StreamExpressionParameter;
+import org.apache.solr.client.solrj.io.stream.expr.StreamFactory;
+
+public class CovarianceEvaluator extends ComplexEvaluator implements Expressible {
+
+ private static final long serialVersionUID = 1;
+
+ public CovarianceEvaluator(StreamExpression expression, StreamFactory factory) throws IOException {
+ super(expression, factory);
+ }
+
+ public Number evaluate(Tuple tuple) throws IOException {
+ StreamEvaluator colEval1 = subEvaluators.get(0);
+ StreamEvaluator colEval2 = subEvaluators.get(1);
+
+ List<Number> numbers1 = (List<Number>)colEval1.evaluate(tuple);
+ List<Number> numbers2 = (List<Number>)colEval2.evaluate(tuple);
+ double[] column1 = new double[numbers1.size()];
+ double[] column2 = new double[numbers2.size()];
+
+ for(int i=0; i<numbers1.size(); i++) {
+ column1[i] = numbers1.get(i).doubleValue();
+ }
+
+ for(int i=0; i<numbers2.size(); i++) {
+ column2[i] = numbers2.get(i).doubleValue();
+ }
+
+ Covariance covariance = new Covariance();
+
+ return covariance.covariance(column1, column2);
+ }
+
+ @Override
+ public StreamExpressionParameter toExpression(StreamFactory factory) throws IOException {
+ StreamExpression expression = new StreamExpression(factory.getFunctionName(getClass()));
+ return expression;
+ }
+
+ @Override
+ public Explanation toExplanation(StreamFactory factory) throws IOException {
+ return new Explanation(nodeId.toString())
+ .withExpressionType(ExpressionType.EVALUATOR)
+ .withFunctionName(factory.getFunctionName(getClass()))
+ .withImplementingClass(getClass().getName())
+ .withExpression(toExpression(factory).toString());
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c6524c3d/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
index 41ffe09..31d3171 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
@@ -5254,6 +5254,51 @@ public class StreamExpressionTest extends SolrCloudTestCase {
}
+ @Test
+ public void testCovariance() throws Exception {
+ UpdateRequest updateRequest = new UpdateRequest();
+
+ int i=0;
+ while(i<50) {
+ updateRequest.add(id, "id_"+(++i),"test_dt", getDateString("2016", "5", "1"), "price_f", "400.00");
+ }
+
+ while(i<100) {
+ updateRequest.add(id, "id_"+(++i),"test_dt", getDateString("2015", "5", "1"), "price_f", "300.0");
+ }
+
+ while(i<150) {
+ updateRequest.add(id, "id_"+(++i),"test_dt", getDateString("2014", "5", "1"), "price_f", "500.0");
+ }
+
+ while(i<250) {
+ updateRequest.add(id, "id_"+(++i),"test_dt", getDateString("2013", "5", "1"), "price_f", "100.00");
+ }
+
+ updateRequest.commit(cluster.getSolrClient(), COLLECTIONORALIAS);
+
+ String expr = "timeseries("+COLLECTIONORALIAS+", q=\"*:*\", start=\"2013-01-01T01:00:00.000Z\", " +
+ "end=\"2016-12-01T01:00:00.000Z\", " +
+ "gap=\"+1YEAR\", " +
+ "field=\"test_dt\", " +
+ "count(*), sum(price_f), max(price_f), min(price_f))";
+
+ String cexpr = "let(a="+expr+", b=select("+expr+",mult(-1, count(*)) as nvalue), c=col(a, count(*)), d=col(b, nvalue), tuple(colc=c, cold=d, cov=cov(c,d)))";
+
+ ModifiableSolrParams paramsLoc = new ModifiableSolrParams();
+ paramsLoc.set("expr", cexpr);
+ paramsLoc.set("qt", "/stream");
+
+ String url = cluster.getJettySolrRunners().get(0).getBaseUrl().toString()+"/"+COLLECTIONORALIAS;
+ TupleStream solrStream = new SolrStream(url, paramsLoc);
+
+ StreamContext context = new StreamContext();
+ solrStream.setStreamContext(context);
+ List<Tuple> tuples = getTuples(solrStream);
+ assertTrue(tuples.size() == 1);
+ assertTrue(tuples.get(0).getDouble("cov").equals(-625.0D));
+ }
+
@Test
[36/50] [abbrv] lucene-solr:jira/solr-10233: LUCENE-5365,
LUCENE-7818: Fix incorrect condition in queryparser's
QueryNodeOperation#logicalAnd()
Posted by tf...@apache.org.
LUCENE-5365, LUCENE-7818: Fix incorrect condition in queryparser's QueryNodeOperation#logicalAnd()
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/0ed39b27
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/0ed39b27
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/0ed39b27
Branch: refs/heads/jira/solr-10233
Commit: 0ed39b2774c1c39faf5a6c4cfc9cb68540b16f11
Parents: dbe6fc5
Author: Uwe Schindler <us...@apache.org>
Authored: Sun May 7 13:24:21 2017 +0200
Committer: Uwe Schindler <us...@apache.org>
Committed: Sun May 7 13:24:21 2017 +0200
----------------------------------------------------------------------
lucene/CHANGES.txt | 6 +++++-
.../queryparser/flexible/core/util/QueryNodeOperation.java | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0ed39b27/lucene/CHANGES.txt
----------------------------------------------------------------------
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index e9aefe5..54cc54a 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -114,9 +114,13 @@ Bug Fixes
* LUCENE-7798: Add .equals and .hashCode to ToParentBlockJoinSortField
(Mikhail Khludnev)
-* LUCENE-7814: DateRangePrefixTree (in spatial-extras ) had edge-case bugs for
+* LUCENE-7814: DateRangePrefixTree (in spatial-extras) had edge-case bugs for
years >= 292,000,000. (David Smiley)
+* LUCENE-5365, LUCENE-7818: Fix incorrect condition in queryparser's
+ QueryNodeOperation#logicalAnd(). (Olivier Binda, Amrit Sarkar,
+ AppChecker via Uwe Schindler)
+
Improvements
* LUCENE-7782: OfflineSorter now passes the total number of items it
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0ed39b27/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/util/QueryNodeOperation.java
----------------------------------------------------------------------
diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/util/QueryNodeOperation.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/util/QueryNodeOperation.java
index 4280d1c..7d82510 100644
--- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/util/QueryNodeOperation.java
+++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/util/QueryNodeOperation.java
@@ -56,7 +56,7 @@ public final class QueryNodeOperation {
op = ANDOperation.BOTH;
else if (q1 instanceof AndQueryNode)
op = ANDOperation.Q1;
- else if (q1 instanceof AndQueryNode)
+ else if (q2 instanceof AndQueryNode)
op = ANDOperation.Q2;
else
op = ANDOperation.NONE;
[27/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10559: Update
CHANGES.txt
Posted by tf...@apache.org.
SOLR-10559: Update 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/b18c182d
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/b18c182d
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/b18c182d
Branch: refs/heads/jira/solr-10233
Commit: b18c182d42a659a56f33e197d588596eda1f4af7
Parents: 554f660
Author: Joel Bernstein <jb...@apache.org>
Authored: Fri May 5 14:36:32 2017 -0400
Committer: Joel Bernstein <jb...@apache.org>
Committed: Fri May 5 14:36:32 2017 -0400
----------------------------------------------------------------------
solr/CHANGES.txt | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b18c182d/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index ced0d3a..ab8a606 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -225,6 +225,8 @@ New Features
* SOLR-10566: Add timeseries Streaming Expression (Joel Bernstein)
+* SOLR-10559: Add let, get and tuple Streaming Expressions (Dennis Gove, Joel Bernstein)
+
Optimizations
----------------------
[24/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10516: Update
CHANGES.txt
Posted by tf...@apache.org.
SOLR-10516: Update 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/07acc93b
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/07acc93b
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/07acc93b
Branch: refs/heads/jira/solr-10233
Commit: 07acc93b7487b83be340908fa4524961a2dda3d6
Parents: 9d2f6d2
Author: Joel Bernstein <jb...@apache.org>
Authored: Fri May 5 13:57:03 2017 -0400
Committer: Joel Bernstein <jb...@apache.org>
Committed: Fri May 5 13:57:03 2017 -0400
----------------------------------------------------------------------
solr/CHANGES.txt | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/07acc93b/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index abfd047..5aeb05b 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -219,6 +219,8 @@ New Features
* SOLR-10504: Add echo Streaming Expression (Joel Bernstein)
+* SOLR-10516: Add eval Streaming Expression (Joel Bernstein)
+
Optimizations
----------------------
[41/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-8149: Admin UI -
Plugins / Stats - active item is now highlighted
Posted by tf...@apache.org.
SOLR-8149: Admin UI - Plugins / Stats - active item is now highlighted
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/37df6445
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/37df6445
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/37df6445
Branch: refs/heads/jira/solr-10233
Commit: 37df64450ee25d48c83a0866ce20ae58d0459770
Parents: 34c6c99
Author: Jan Høydahl <ja...@apache.org>
Authored: Mon May 8 10:48:20 2017 +0200
Committer: Jan Høydahl <ja...@apache.org>
Committed: Mon May 8 10:49:53 2017 +0200
----------------------------------------------------------------------
solr/CHANGES.txt | 2 ++
solr/webapp/web/css/angular/plugins.css | 6 ++++++
solr/webapp/web/partials/plugins.html | 6 +++---
3 files changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/37df6445/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 01d7b2c..7f81344 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -315,6 +315,8 @@ Bug Fixes
After core container shutdown or severe initialization problem Solr responds with
http stauts 404 Not Found instead of 500 as it was before (Mikhail Khludnev)
+* SOLR-8149: Admin UI - Plugins / Stats - active item is now highlighted (Labuzov Dmitriy via janhoy)
+
Other Changes
----------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/37df6445/solr/webapp/web/css/angular/plugins.css
----------------------------------------------------------------------
diff --git a/solr/webapp/web/css/angular/plugins.css b/solr/webapp/web/css/angular/plugins.css
index 03dc2ea..3b7830d 100644
--- a/solr/webapp/web/css/angular/plugins.css
+++ b/solr/webapp/web/css/angular/plugins.css
@@ -166,6 +166,12 @@ limitations under the License.
background-color:#F0F3FF;
}
+#content #plugins .active a
+{
+ background-color: #d0d0d0;
+ border-color: #d0d0d0;
+}
+
#recording #blockUI
{
position: absolute;
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/37df6445/solr/webapp/web/partials/plugins.html
----------------------------------------------------------------------
diff --git a/solr/webapp/web/partials/plugins.html b/solr/webapp/web/partials/plugins.html
index bd122a7..aaa424d 100644
--- a/solr/webapp/web/partials/plugins.html
+++ b/solr/webapp/web/partials/plugins.html
@@ -48,9 +48,9 @@ limitations under the License.
<div id="navigation" class="clearfix">
<ul>
- <li ng-repeat="type in types" class="{{type.lower}}">
- <a ng-click="selectPluginType(type)" rel="{{type.name}}">{{type.name}}
- <span ng-show="type.changes">{{type.changes}}</span>
+ <li ng-repeat="typeObj in types" class="{{typeObj.lower}}" ng-class="{active:typeObj==type}">
+ <a ng-click="selectPluginType(typeObj)" rel="{{typeObj.name}}">{{typeObj.name}}
+ <span ng-show="typeObj.changes">{{typeObj.changes}}</span>
</a>
</li>
<li class="PLUGINCHANGES"><a ng-click="startRecording()">Watch Changes</a></li>
[43/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10630:
HttpSolrCall.getAuthCtx().new AuthorizationContext() {...}.getParams()
sometimes throws java.lang.NullPointerException
Posted by tf...@apache.org.
SOLR-10630: HttpSolrCall.getAuthCtx().new AuthorizationContext() {...}.getParams() sometimes throws java.lang.NullPointerException
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/54061ed4
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/54061ed4
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/54061ed4
Branch: refs/heads/jira/solr-10233
Commit: 54061ed4a6c1ed9b60e08056577fac702c6816bd
Parents: 20c4886
Author: Shalin Shekhar Mangar <sh...@apache.org>
Authored: Mon May 8 15:50:10 2017 +0530
Committer: Shalin Shekhar Mangar <sh...@apache.org>
Committed: Mon May 8 15:50:10 2017 +0530
----------------------------------------------------------------------
solr/CHANGES.txt | 3 +++
solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java | 4 ++--
2 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/54061ed4/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 118d629..f39c0b9 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -319,6 +319,9 @@ Bug Fixes
* SOLR-8149: Admin UI - Plugins / Stats - active item is now highlighted (Labuzov Dmitriy via janhoy)
+* SOLR-10630: HttpSolrCall.getAuthCtx().new AuthorizationContext() {...}.getParams()
+ sometimes throws java.lang.NullPointerException (hu xiaodong via shalin)
+
Other Changes
----------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/54061ed4/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java b/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
index 4f6bae0..4318621 100644
--- a/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
+++ b/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
@@ -1028,7 +1028,7 @@ public class HttpSolrCall {
return new AuthorizationContext() {
@Override
public SolrParams getParams() {
- return solrReq.getParams();
+ return null == solrReq ? null : solrReq.getParams();
}
@Override
@@ -1081,7 +1081,7 @@ public class HttpSolrCall {
response.delete(response.length() - 1, response.length());
response.append("], Path: [").append(resource).append("]");
- response.append(" path : ").append(path).append(" params :").append(solrReq.getParams());
+ response.append(" path : ").append(path).append(" params :").append(getParams());
return response.toString();
}
[28/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10582: Update
CHANGES.txt
Posted by tf...@apache.org.
SOLR-10582: Update 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/52b252cc
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/52b252cc
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/52b252cc
Branch: refs/heads/jira/solr-10233
Commit: 52b252cc6eddd7bcb71bdf2f9c533332fe228b0e
Parents: b18c182
Author: Joel Bernstein <jb...@apache.org>
Authored: Fri May 5 14:45:11 2017 -0400
Committer: Joel Bernstein <jb...@apache.org>
Committed: Fri May 5 14:45:11 2017 -0400
----------------------------------------------------------------------
solr/CHANGES.txt | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/52b252cc/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index ab8a606..3fbfc96 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -227,6 +227,8 @@ New Features
* SOLR-10559: Add let, get and tuple Streaming Expressions (Dennis Gove, Joel Bernstein)
+* SOLR-10582: Add Correlation Stream Evaluator (Joel Bernstein)
+
Optimizations
----------------------
[04/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10583: JSON
Faceting now supports a query time 'join' domain change option
Posted by tf...@apache.org.
SOLR-10583: JSON Faceting now supports a query time 'join' domain change option
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/15e1c5d3
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/15e1c5d3
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/15e1c5d3
Branch: refs/heads/jira/solr-10233
Commit: 15e1c5d34f69fa2662b5299dce6fc808854f8ba3
Parents: 17563ce
Author: Chris Hostetter <ho...@apache.org>
Authored: Wed May 3 10:30:02 2017 -0700
Committer: Chris Hostetter <ho...@apache.org>
Committed: Wed May 3 10:30:02 2017 -0700
----------------------------------------------------------------------
solr/CHANGES.txt | 2 +
.../apache/solr/search/JoinQParserPlugin.java | 22 +-
.../solr/search/facet/FacetProcessor.java | 10 +
.../apache/solr/search/facet/FacetRequest.java | 74 ++-
.../cloud/TestCloudJSONFacetJoinDomain.java | 596 +++++++++++++++++++
.../search/facet/TestJsonFacetRefinement.java | 50 +-
.../solr/search/facet/TestJsonFacets.java | 239 ++++++++
7 files changed, 987 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/15e1c5d3/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 75f54c1..7eaafae 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -204,6 +204,8 @@ New Features
* SOLR-10430: Add ls command to ZkCLI for listing only sub-directories. (Peter Szantai-Kis via Mark Miller)
+* SOLR-10583: JSON Faceting now supports a query time 'join' domain change option (hossman)
+
Optimizations
----------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/15e1c5d3/solr/core/src/java/org/apache/solr/search/JoinQParserPlugin.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/search/JoinQParserPlugin.java b/solr/core/src/java/org/apache/solr/search/JoinQParserPlugin.java
index fca9a34..abdea53 100644
--- a/solr/core/src/java/org/apache/solr/search/JoinQParserPlugin.java
+++ b/solr/core/src/java/org/apache/solr/search/JoinQParserPlugin.java
@@ -121,21 +121,37 @@ public class JoinQParserPlugin extends QParserPlugin {
};
}
+ /**
+ * A helper method for other plugins to create (non-scoring) JoinQueries wrapped around arbitrary queries against the same core.
+ *
+ * @param subQuery the query to define the starting set of documents on the "left side" of the join
+ * @param fromField "left side" field name to use in the join
+ * @param toField "right side" field name to use in the join
+ */
+ public static Query createJoinQuery(Query subQuery, String fromField, String toField) {
+ return new JoinQuery(fromField, toField, null, subQuery);
+ }
+
}
class JoinQuery extends Query {
String fromField;
String toField;
- String fromIndex;
+ String fromIndex; // TODO: name is missleading here compared to JoinQParserPlugin usage - here it must be a core name
Query q;
long fromCoreOpenTime;
- public JoinQuery(String fromField, String toField, String fromIndex, Query subQuery) {
+ public JoinQuery(String fromField, String toField, String coreName, Query subQuery) {
+ assert null != fromField;
+ assert null != toField;
+ assert null != subQuery;
+
this.fromField = fromField;
this.toField = toField;
- this.fromIndex = fromIndex;
this.q = subQuery;
+
+ this.fromIndex = coreName; // may be null
}
public Query getQuery() { return q; }
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/15e1c5d3/solr/core/src/java/org/apache/solr/search/facet/FacetProcessor.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/search/facet/FacetProcessor.java b/solr/core/src/java/org/apache/solr/search/facet/FacetProcessor.java
index 9f05d8e..d5a4e23 100644
--- a/solr/core/src/java/org/apache/solr/search/facet/FacetProcessor.java
+++ b/solr/core/src/java/org/apache/solr/search/facet/FacetProcessor.java
@@ -161,6 +161,8 @@ public abstract class FacetProcessor<FacetRequestT extends FacetRequest> {
// We still calculate them first because we can use it in a parent->child domain change.
evalFilters();
+ handleJoinField();
+
boolean appliedFilters = handleBlockJoin();
if (this.filter != null && !appliedFilters) {
@@ -229,6 +231,14 @@ public abstract class FacetProcessor<FacetRequestT extends FacetRequest> {
fcontext.base = fcontext.searcher.getDocSet(qlist);
}
+ /** modifies the context base if there is a join field domain change */
+ private void handleJoinField() throws IOException {
+ if (null == freq.domain.joinField) return;
+
+ final Query domainQuery = freq.domain.joinField.createDomainQuery(fcontext);
+ fcontext.base = fcontext.searcher.getDocSet(domainQuery);
+ }
+
// returns "true" if filters were applied to fcontext.base already
private boolean handleBlockJoin() throws IOException {
boolean appliedFilters = false;
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/15e1c5d3/solr/core/src/java/org/apache/solr/search/facet/FacetRequest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/search/facet/FacetRequest.java b/solr/core/src/java/org/apache/solr/search/facet/FacetRequest.java
index b446ece..4cf8a68 100644
--- a/solr/core/src/java/org/apache/solr/search/facet/FacetRequest.java
+++ b/solr/core/src/java/org/apache/solr/search/facet/FacetRequest.java
@@ -16,6 +16,7 @@
*/
package org.apache.solr.search.facet;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.LinkedHashMap;
@@ -29,10 +30,12 @@ import org.apache.solr.common.util.StrUtils;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.schema.IndexSchema;
import org.apache.solr.search.DocSet;
+import org.apache.solr.search.JoinQParserPlugin;
import org.apache.solr.search.FunctionQParser;
import org.apache.solr.search.FunctionQParserPlugin;
import org.apache.solr.search.QParser;
import org.apache.solr.search.QueryContext;
+import org.apache.solr.search.SolrConstantScoreQuery;
import org.apache.solr.search.SolrIndexSearcher;
import org.apache.solr.search.SyntaxError;
@@ -85,6 +88,7 @@ public abstract class FacetRequest {
// domain changes
public static class Domain {
public List<String> excludeTags;
+ public JoinField joinField;
public boolean toParent;
public boolean toChildren;
public String parents; // identifies the parent filter... the full set of parent documents for any block join operation
@@ -92,13 +96,79 @@ public abstract class FacetRequest {
// True if a starting set of documents can be mapped onto a different set of documents not originally in the starting set.
public boolean canTransformDomain() {
- return toParent || toChildren || excludeTags != null;
+ return toParent || toChildren || (excludeTags != null) || (joinField != null);
}
// Can this domain become non-empty if the input domain is empty? This does not check any sub-facets (see canProduceFromEmpty for that)
public boolean canBecomeNonEmpty() {
return excludeTags != null;
}
+
+ /** Are we doing a query time join across other documents */
+ public static class JoinField {
+ public final String from;
+ public final String to;
+
+ private JoinField(String from, String to) {
+ assert null != from;
+ assert null != to;
+
+ this.from = from;
+ this.to = to;
+ }
+
+ /**
+ * Given a <code>Domain</code>, and a (JSON) map specifying the configuration for that Domain,
+ * validates if a '<code>join</code>' is specified, and if so creates a <code>JoinField</code>
+ * and sets it on the <code>Domain</code>.
+ *
+ * (params must not be null)
+ */
+ public static void createJoinField(FacetRequest.Domain domain, Map<String,Object> domainMap) {
+ assert null != domain;
+ assert null != domainMap;
+
+ final Object queryJoin = domainMap.get("join");
+ if (null != queryJoin) {
+ // TODO: maybe allow simple string (instead of map) to mean "self join on this field name" ?
+ if (! (queryJoin instanceof Map)) {
+ throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
+ "'join' domain change requires a map containing the 'from' and 'to' fields");
+ }
+ final Map<String,String> join = (Map<String,String>) queryJoin;
+ if (! (join.containsKey("from") && join.containsKey("to") &&
+ null != join.get("from") && null != join.get("to")) ) {
+ throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
+ "'join' domain change requires non-null 'from' and 'to' field names");
+ }
+ if (2 != join.size()) {
+ throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
+ "'join' domain change contains unexpected keys, only 'from' and 'to' supported: "
+ + join.toString());
+ }
+ domain.joinField = new JoinField(join.get("from"), join.get("to"));
+ }
+ }
+
+ /**
+ * Creates a Query that can be used to recompute the new "base" for this domain, realtive to the
+ * current base of the FacetContext.
+ */
+ public Query createDomainQuery(FacetContext fcontext) throws IOException {
+ // NOTE: this code lives here, instead of in FacetProcessor.handleJoin, in order to minimize
+ // the number of classes that have to know about the number of possible settings on the join
+ // (ie: if we add a score mode, or some other modifier to how the joins are done)
+
+ final SolrConstantScoreQuery fromQuery = new SolrConstantScoreQuery(fcontext.base.getTopFilter());
+ // this shouldn't matter once we're wrapped in a join query, but just in case it ever does...
+ fromQuery.setCache(false);
+
+ return JoinQParserPlugin.createJoinQuery(fromQuery, this.from, this.to);
+ }
+
+
+ }
+
}
public FacetRequest() {
@@ -399,6 +469,8 @@ abstract class FacetParser<FacetRequestT extends FacetRequest> {
domain.toChildren = true;
domain.parents = blockChildren;
}
+
+ FacetRequest.Domain.JoinField.createJoinField(domain, domainMap);
Object filterOrList = domainMap.get("filter");
if (filterOrList != null) {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/15e1c5d3/solr/core/src/test/org/apache/solr/cloud/TestCloudJSONFacetJoinDomain.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestCloudJSONFacetJoinDomain.java b/solr/core/src/test/org/apache/solr/cloud/TestCloudJSONFacetJoinDomain.java
new file mode 100644
index 0000000..afdbb7e
--- /dev/null
+++ b/solr/core/src/test/org/apache/solr/cloud/TestCloudJSONFacetJoinDomain.java
@@ -0,0 +1,596 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.cloud;
+
+import java.io.IOException;
+
+import java.lang.invoke.MethodHandles;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.lucene.util.TestUtil;
+import org.apache.solr.SolrTestCaseJ4.SuppressPointFields;
+import org.apache.solr.client.solrj.SolrClient;
+import org.apache.solr.client.solrj.SolrServerException;
+import org.apache.solr.client.solrj.embedded.JettySolrRunner;
+import org.apache.solr.client.solrj.impl.CloudSolrClient;
+import org.apache.solr.client.solrj.impl.HttpSolrClient;
+import org.apache.solr.client.solrj.request.CollectionAdminRequest;
+import org.apache.solr.client.solrj.request.QueryRequest;
+import org.apache.solr.common.SolrException;
+import org.apache.solr.common.SolrInputDocument;
+import org.apache.solr.common.params.ModifiableSolrParams;
+import org.apache.solr.common.params.SolrParams;
+import org.apache.solr.common.util.NamedList;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * <p>
+ * Tests randomized JSON Facets, sometimes using query 'join' domain transfers and/or domain 'filter' options
+ * </p>
+ * <p>
+ * The results of each facet constraint count will be compared with a verification query using an equivilent filter
+ * </p>
+ *
+ * @see TestCloudPivotFacet
+ */
+@SuppressPointFields(bugUrl="https://issues.apache.org/jira/browse/SOLR-9989")
+public class TestCloudJSONFacetJoinDomain extends SolrCloudTestCase {
+
+ private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+ private static final String DEBUG_LABEL = MethodHandles.lookup().lookupClass().getName();
+ private static final String COLLECTION_NAME = DEBUG_LABEL + "_collection";
+
+ private static final int MAX_FIELD_NUM = 15;
+ private static final int UNIQUE_FIELD_VALS = 20;
+ private static final int FACET_LIMIT = UNIQUE_FIELD_VALS + 1;
+
+ /** Multivalued string field suffixes that can be randomized for testing diff facet/join code paths */
+ private static final String[] STR_FIELD_SUFFIXES = new String[] { "_ss", "_sds", "_sdsS" };
+ /** Multivalued int field suffixes that can be randomized for testing diff facet/join code paths */
+ private static final String[] INT_FIELD_SUFFIXES = new String[] { "_is", "_ids", "_idsS" };
+
+ /** A basic client for operations at the cloud level, default collection will be set */
+ private static CloudSolrClient CLOUD_CLIENT;
+ /** One client per node */
+ private static ArrayList<HttpSolrClient> CLIENTS = new ArrayList<>(5);
+
+
+ @BeforeClass
+ private static void createMiniSolrCloudCluster() throws Exception {
+ // sanity check constants
+ assertTrue("bad test constants: must have UNIQUE_FIELD_VALS < FACET_LIMIT since refinement not currently supported",
+ UNIQUE_FIELD_VALS < FACET_LIMIT);
+ assertTrue("bad test constants: some suffixes will never be tested",
+ (STR_FIELD_SUFFIXES.length < MAX_FIELD_NUM) && (INT_FIELD_SUFFIXES.length < MAX_FIELD_NUM));
+
+ // multi replicas should not matter...
+ final int repFactor = usually() ? 1 : 2;
+ // ... but we definitely want to test multiple shards
+ final int numShards = TestUtil.nextInt(random(), 1, (usually() ? 2 :3));
+ final int numNodes = (numShards * repFactor);
+
+ final String configName = DEBUG_LABEL + "_config-set";
+ final Path configDir = Paths.get(TEST_HOME(), "collection1", "conf");
+
+ configureCluster(numNodes).addConfig(configName, configDir).configure();
+
+ Map<String, String> collectionProperties = new LinkedHashMap<>();
+ collectionProperties.put("config", "solrconfig-tlog.xml");
+ collectionProperties.put("schema", "schema_latest.xml");
+ CollectionAdminRequest.createCollection(COLLECTION_NAME, configName, numShards, repFactor)
+ .setProperties(collectionProperties)
+ .process(cluster.getSolrClient());
+
+ CLOUD_CLIENT = cluster.getSolrClient();
+ CLOUD_CLIENT.setDefaultCollection(COLLECTION_NAME);
+
+ waitForRecoveriesToFinish(CLOUD_CLIENT);
+
+ for (JettySolrRunner jetty : cluster.getJettySolrRunners()) {
+ CLIENTS.add(getHttpSolrClient(jetty.getBaseUrl() + "/" + COLLECTION_NAME + "/"));
+ }
+
+ final int numDocs = atLeast(100);
+ for (int id = 0; id < numDocs; id++) {
+ SolrInputDocument doc = sdoc("id", ""+id);
+ for (int fieldNum = 0; fieldNum < MAX_FIELD_NUM; fieldNum++) {
+ // NOTE: some docs may have no value in a field
+ final int numValsThisDoc = TestUtil.nextInt(random(), 0, (usually() ? 3 : 6));
+ for (int v = 0; v < numValsThisDoc; v++) {
+ final String fieldValue = randFieldValue(fieldNum);
+
+ // for each fieldNum, there are actaully two fields: one string, and one integer
+ doc.addField(field(STR_FIELD_SUFFIXES, fieldNum), fieldValue);
+ doc.addField(field(INT_FIELD_SUFFIXES, fieldNum), fieldValue);
+ }
+ }
+ CLOUD_CLIENT.add(doc);
+ }
+ CLOUD_CLIENT.commit();
+ }
+
+ /**
+ * Given a (random) number, and a (static) array of possible suffixes returns a consistent field name that
+ * uses that number and one of hte specified suffixes in it's name.
+ *
+ * @see #STR_FIELD_SUFFIXES
+ * @see #INT_FIELD_SUFFIXES
+ * @see #MAX_FIELD_NUM
+ * @see #randFieldValue
+ */
+ private static String field(final String[] suffixes, final int fieldNum) {
+ assert fieldNum < MAX_FIELD_NUM;
+
+ final String suffix = suffixes[fieldNum % suffixes.length];
+ return "field_" + fieldNum + suffix;
+ }
+ private static String strfield(final int fieldNum) {
+ return field(STR_FIELD_SUFFIXES, fieldNum);
+ }
+ private static String intfield(final int fieldNum) {
+ return field(INT_FIELD_SUFFIXES, fieldNum);
+ }
+
+ /**
+ * Given a (random) field number, returns a random (integer based) value for that field.
+ * NOTE: The number of unique values in each field is constant acording to {@link #UNIQUE_FIELD_VALS}
+ * but the cise pr<em>range</em> of values will vary for each unique field number, such that cross field joins
+ * will match fewer documents based on how far apart the field numbers are.
+ *
+ * @see #UNIQUE_FIELD_VALS
+ * @see #field
+ */
+ private static String randFieldValue(final int fieldNum) {
+ return "" + (fieldNum + TestUtil.nextInt(random(), 0, UNIQUE_FIELD_VALS));
+ }
+
+
+ @AfterClass
+ private static void afterClass() throws Exception {
+ CLOUD_CLIENT.close(); CLOUD_CLIENT = null;
+ for (HttpSolrClient client : CLIENTS) {
+ client.close();
+ }
+ CLIENTS = null;
+ }
+
+ /** Sanity check that malformed requests produce errors */
+ public void testMalformedGivesError() throws Exception {
+
+ ignoreException(".*'join' domain change.*");
+
+ for (String join : Arrays.asList("bogus",
+ "{ }",
+ "{ from:null, to:foo_s }",
+ "{ from:foo_s }",
+ "{ from:foo_s, to:foo_s, bogus:'what what?' }",
+ "{ to:foo_s, bogus:'what what?' }")) {
+ SolrException e = expectThrows(SolrException.class, () -> {
+ final SolrParams req = params("q", "*:*", "json.facet",
+ "{ x : { type:terms, field:x_s, domain: { join:"+join+" } } }");
+ final NamedList trash = getRandClient(random()).request(new QueryRequest(req));
+ });
+ assertEquals(join + " -> " + e, SolrException.ErrorCode.BAD_REQUEST.code, e.code());
+ assertTrue(join + " -> " + e, e.getMessage().contains("'join' domain change"));
+ }
+ }
+
+ public void testSanityCheckDomainMethods() throws Exception {
+ {
+ final JoinDomain empty = new JoinDomain(null, null, null);
+ assertEquals(null, empty.toJSONFacetParamValue());
+ final SolrParams out = empty.applyDomainToQuery("safe_key", params("q","qqq"));
+ assertNotNull(out);
+ assertEquals(null, out.get("safe_key"));
+ assertEquals("qqq", out.get("q"));
+ }
+ {
+ final JoinDomain join = new JoinDomain("xxx", "yyy", null);
+ assertEquals("domain:{join:{from:xxx,to:yyy}}", join.toJSONFacetParamValue().toString());
+ final SolrParams out = join.applyDomainToQuery("safe_key", params("q","qqq"));
+ assertNotNull(out);
+ assertEquals("qqq", out.get("safe_key"));
+ assertEquals("{!join from=xxx to=yyy v=$safe_key}", out.get("q"));
+
+ }
+ {
+ final JoinDomain filter = new JoinDomain(null, null, "zzz");
+ assertEquals("domain:{filter:'zzz'}", filter.toJSONFacetParamValue().toString());
+ final SolrParams out = filter.applyDomainToQuery("safe_key", params("q","qqq"));
+ assertNotNull(out);
+ assertEquals(null, out.get("safe_key"));
+ assertEquals("zzz AND qqq", out.get("q"));
+ }
+ {
+ final JoinDomain both = new JoinDomain("xxx", "yyy", "zzz");
+ assertEquals("domain:{join:{from:xxx,to:yyy},filter:'zzz'}", both.toJSONFacetParamValue().toString());
+ final SolrParams out = both.applyDomainToQuery("safe_key", params("q","qqq"));
+ assertNotNull(out);
+ assertEquals("qqq", out.get("safe_key"));
+ assertEquals("zzz AND {!join from=xxx to=yyy v=$safe_key}", out.get("q"));
+ }
+ }
+
+
+ /**
+ * Test some small, hand crafted, but non-trivial queries that are
+ * easier to trace/debug then a pure random monstrosity.
+ * (ie: if something obvious gets broken, this test may fail faster and in a more obvious way then testRandom)
+ */
+ public void testBespoke() throws Exception {
+
+ { // strings
+ Map<String,TermFacet> facets = new LinkedHashMap<>();
+ TermFacet top = new TermFacet(strfield(9), new JoinDomain(strfield(5), strfield(9), strfield(9)+":[* TO *]"));
+ top.subFacets.put("facet_5", new TermFacet(strfield(11), new JoinDomain(strfield(8), strfield(8), null)));
+ facets.put("facet_4", top);
+ assertFacetCountsAreCorrect(facets, "("+strfield(7)+":6 OR "+strfield(9)+":6 OR "+strfield(6)+":19 OR "+strfield(0)+":11)");
+ }
+
+ { // ints
+ Map<String,TermFacet> facets = new LinkedHashMap<>();
+ TermFacet top = new TermFacet(intfield(9), new JoinDomain(intfield(5), intfield(9), null));
+ facets.put("top", top);
+ assertFacetCountsAreCorrect(facets, "("+intfield(7)+":6 OR "+intfield(3)+":3)");
+ }
+
+ { // some domains with filter only, no actual join
+ Map<String,TermFacet> facets = new LinkedHashMap<>();
+ TermFacet top = new TermFacet(strfield(9), new JoinDomain(null, null, strfield(9)+":[* TO *]"));
+ top.subFacets.put("facet_5", new TermFacet(strfield(11), new JoinDomain(null, null, strfield(3)+":[* TO 5]")));
+ facets.put("top", top);
+ assertFacetCountsAreCorrect(facets, "("+strfield(7)+":6 OR "+strfield(9)+":6 OR "+strfield(6)+":19 OR "+strfield(0)+":11)");
+
+ }
+
+
+ }
+
+
+ public void testRandom() throws Exception {
+
+ final int numIters = atLeast(3);
+ for (int iter = 0; iter < numIters; iter++) {
+ assertFacetCountsAreCorrect(TermFacet.buildRandomFacets(), buildRandomQuery());
+ }
+ }
+
+ /**
+ * Generates a random query string across the randomized fields/values in the index
+ *
+ * @see #randFieldValue
+ * @see #field
+ */
+ private static String buildRandomQuery() {
+ if (0 == TestUtil.nextInt(random(), 0,10)) {
+ return "*:*";
+ }
+ final int numClauses = TestUtil.nextInt(random(), 3, 10);
+ List<String> clauses = new ArrayList<String>(numClauses);
+ for (int c = 0; c < numClauses; c++) {
+ final int fieldNum = random().nextInt(MAX_FIELD_NUM);
+ // keep queries simple, just use str fields - not point of test
+ clauses.add(strfield(fieldNum) + ":" + randFieldValue(fieldNum));
+ }
+ return "(" + StringUtils.join(clauses, " OR ") + ")";
+ }
+
+ /**
+ * Given a set of (potentially nested) term facets, and a base query string, asserts that
+ * the actual counts returned when executing that query with those facets match the expected results
+ * of filtering on the equivilent facet terms+domain
+ */
+ private void assertFacetCountsAreCorrect(Map<String,TermFacet> expected,
+ final String query) throws SolrServerException, IOException {
+
+ final SolrParams baseParams = params("q", query, "rows","0");
+ final SolrParams facetParams = params("json.facet", ""+TermFacet.toJSONFacetParamValue(expected));
+ final SolrParams initParams = SolrParams.wrapAppended(facetParams, baseParams);
+
+ log.info("Doing full run: {}", initParams);
+
+ NamedList topResponse = null;
+ try {
+ topResponse = getRandClient(random()).request(new QueryRequest(initParams));
+ assertNotNull(initParams + " is null response?", topResponse);
+ } catch (Exception e) {
+ throw new RuntimeException("init query failed: " + initParams + ": " +
+ e.getMessage(), e);
+ }
+ try {
+ final NamedList facetResponse = (NamedList) topResponse.get("facets");
+ assertNotNull("null facet results?", facetResponse);
+ assertFacetCountsAreCorrect(expected, baseParams, facetResponse);
+ } catch (AssertionError e) {
+ throw new AssertionError(initParams + " ===> " + topResponse + " --> " + e.getMessage(), e);
+ } finally {
+ log.info("Ending full run");
+ }
+ }
+
+ /**
+ * Recursive Helper method that walks the actual facet response, comparing the counts to the expected output
+ * based on the equivilent filters generated from the original TermFacet.
+ */
+ private void assertFacetCountsAreCorrect(Map<String,TermFacet> expected,
+ SolrParams baseParams,
+ NamedList actualFacetResponse) throws SolrServerException, IOException {
+
+ for (Map.Entry<String,TermFacet> entry : expected.entrySet()) {
+ final String facetKey = entry.getKey();
+ final TermFacet facet = entry.getValue();
+ final NamedList results = (NamedList) actualFacetResponse.get(facetKey);
+ assertNotNull(facetKey + " key missing from: " + actualFacetResponse, results);
+ final List<NamedList> buckets = (List<NamedList>) results.get("buckets");
+ assertNotNull(facetKey + " has null buckets: " + actualFacetResponse, buckets);
+ for (NamedList bucket : buckets) {
+ final long count = ((Number) bucket.get("count")).longValue();
+ final String fieldVal = bucket.get("val").toString(); // int or stringified int
+
+ // change our query to filter on the fieldVal, and wrap in the facet domain (if any)
+ final SolrParams verifyParams = facet.applyValueConstraintAndDomain(baseParams, facetKey, fieldVal);
+
+ // check the count for this bucket
+ assertEquals(facetKey + ": " + verifyParams,
+ count, getRandClient(random()).query(verifyParams).getResults().getNumFound());
+
+ // recursively check subFacets
+ if (! facet.subFacets.isEmpty()) {
+ assertFacetCountsAreCorrect(facet.subFacets,
+ verifyParams, bucket);
+ }
+ }
+ }
+ assertTrue("facets have unexpeted keys left over: " + actualFacetResponse,
+ // should alwasy be a count, maybe a 'val' if we're a subfacet
+ (actualFacetResponse.size() == expected.size() + 1) ||
+ (actualFacetResponse.size() == expected.size() + 2));
+ }
+
+
+ /**
+ * Trivial data structure for modeling a simple terms facet that can be written out as a json.facet param.
+ *
+ * Doesn't do any string escaping or quoting, so don't use whitespace or reserved json characters
+ */
+ private static final class TermFacet {
+ public final String field;
+ public final Map<String,TermFacet> subFacets = new LinkedHashMap<>();
+ public final JoinDomain domain; // may be null
+ public TermFacet(String field, JoinDomain domain) {
+ assert null != field;
+ this.field = field;
+ this.domain = domain;
+ }
+
+ /**
+ * Returns new SolrParams that:
+ * <ul>
+ * <li>copy the original SolrParams</li>
+ * <li>modify/wrap the original "q" param to capture the domain change for this facet (if any)</li>
+ * <li>add a filter query against this field with the specified value</li>
+ * </ul>
+ *
+ * @see JoinDomain#applyDomainToQuery
+ */
+ public SolrParams applyValueConstraintAndDomain(SolrParams orig, String facetKey, String facetVal) {
+ // first wrap our original query in the domain if there is one...
+ if (null != domain) {
+ orig = domain.applyDomainToQuery(facetKey + "_q", orig);
+ }
+ // then filter by the facet value we need to test...
+ final ModifiableSolrParams out = new ModifiableSolrParams(orig);
+ out.set("q", field + ":" + facetVal + " AND " + orig.get("q"));
+
+ return out;
+ }
+
+ /**
+ * recursively generates the <code>json.facet</code> param value to use for testing this facet
+ */
+ private CharSequence toJSONFacetParamValue() {
+ // NOTE: since refinement isn't supported, we have to use the max cardinality of the field as limit
+ StringBuilder sb = new StringBuilder("{ type:terms, field:" + field + ", limit: " + FACET_LIMIT);
+ if (! subFacets.isEmpty()) {
+ sb.append(", facet:");
+ sb.append(toJSONFacetParamValue(subFacets));
+ }
+ if (null != domain) {
+ CharSequence ds = domain.toJSONFacetParamValue();
+ if (null != ds) {
+ sb.append(", ").append(ds);
+ }
+ }
+ sb.append("}");
+ return sb;
+ }
+
+ /**
+ * Given a set of (possibly nested) facets, generates a suitable <code>json.facet</code> param value to
+ * use for testing them against in a solr request.
+ */
+ public static CharSequence toJSONFacetParamValue(Map<String,TermFacet> facets) {
+ assert null != facets;
+ assert 0 < facets.size();
+ StringBuilder sb = new StringBuilder("{");
+ for (String key : facets.keySet()) {
+ sb.append(key).append(" : ").append(facets.get(key).toJSONFacetParamValue());
+ sb.append(" ,");
+ }
+ sb.setLength(sb.length() - 1);
+ sb.append("}");
+ return sb;
+ }
+
+ /**
+ * Factory method for generating some random (nested) facets.
+ *
+ * For simplicity, each facet will have a unique key name, regardless of it's depth under other facets
+ *
+ * @see JoinDomain
+ */
+ public static Map<String,TermFacet> buildRandomFacets() {
+ // for simplicity, use a unique facet key regardless of depth - simplifies verification
+ AtomicInteger keyCounter = new AtomicInteger(0);
+ final int maxDepth = TestUtil.nextInt(random(), 0, (usually() ? 2 : 3));
+ return buildRandomFacets(keyCounter, maxDepth);
+ }
+
+ /**
+ * recursive helper method for building random facets
+ *
+ * @param keyCounter used to ensure every generated facet has a unique key name
+ * @param maxDepth max possible depth allowed for the recusion, a lower value may be used depending on how many facets are returned at the current level.
+ */
+ private static Map<String,TermFacet> buildRandomFacets(AtomicInteger keyCounter, int maxDepth) {
+ final int numFacets = Math.max(1, TestUtil.nextInt(random(), -1, 3)); // 3/5th chance of being '1'
+ Map<String,TermFacet> results = new LinkedHashMap<>();
+ for (int i = 0; i < numFacets; i++) {
+ final JoinDomain domain = JoinDomain.buildRandomDomain();
+ assert null != domain;
+ final TermFacet facet = new TermFacet(field(random().nextBoolean() ? STR_FIELD_SUFFIXES : INT_FIELD_SUFFIXES,
+ random().nextInt(MAX_FIELD_NUM)),
+ domain);
+ results.put("facet_" + keyCounter.incrementAndGet(), facet);
+ if (0 < maxDepth) {
+ // if we're going wide, don't go deep
+ final int nextMaxDepth = Math.max(0, maxDepth - numFacets);
+ facet.subFacets.putAll(buildRandomFacets(keyCounter, TestUtil.nextInt(random(), 0, nextMaxDepth)));
+ }
+ }
+ return results;
+ }
+ }
+
+
+ /**
+ * Models a Domain Change which includes either a 'join' or a 'filter' or both
+ */
+ private static final class JoinDomain {
+ public final String from;
+ public final String to;
+ public final String filter; // not bothering with more then 1 filter, not the point of the test
+
+ /**
+ * @param from left side of join field name, null if domain involves no joining
+ * @param to right side of join field name, null if domain involves no joining
+ * @param filter filter to apply to domain, null if domain involves no filtering
+ */
+ public JoinDomain(String from, String to, String filter) {
+ assert ! ((null == from) ^ (null == to)) : "if from is null, to must be null";
+ this.from = from;
+ this.to = to;
+ this.filter = filter;
+ }
+
+ /**
+ * @return the JSON string representing this domain for use in a facet param, or null if no domain should be used
+ * */
+ public CharSequence toJSONFacetParamValue() {
+ if (null == from && null == filter) {
+ return null;
+ }
+ StringBuilder sb = new StringBuilder("domain:{");
+ if (null != from) {
+ assert null != to;
+ sb. append("join:{from:").append(from).append(",to:").append(to).append("}");
+ if (null != filter){
+ sb.append(",");
+ }
+
+ }
+ if (null != filter) {
+ sb.append("filter:'").append(filter).append("'");
+ }
+ sb.append("}");
+ return sb;
+ }
+
+ /**
+ * Given some original SolrParams, returns new SolrParams where the original "q" param is wrapped
+ * as needed to apply the equivilent transformation to a query as this domain would to a facet
+ */
+ public SolrParams applyDomainToQuery(String safeKey, SolrParams in) {
+ assert null == in.get(safeKey); // shouldn't be possible if every facet uses a unique key string
+
+ String q = in.get("q");
+ final ModifiableSolrParams out = new ModifiableSolrParams(in);
+ if (null != from) {
+ out.set(safeKey, in.get("q"));
+ q = "{!join from="+from+" to="+to+" v=$"+safeKey+"}";
+ }
+ if (null != filter) {
+ q = filter + " AND " + q;
+ }
+ out.set("q", q);
+ return out;
+ }
+
+ /**
+ * Factory method for creating a random domain change to use with a facet - may return an 'noop' JoinDomain,
+ * but will never return null.
+ */
+ public static JoinDomain buildRandomDomain() {
+
+ // use consistent type on both sides of join
+ final String[] suffixes = random().nextBoolean() ? STR_FIELD_SUFFIXES : INT_FIELD_SUFFIXES;
+
+ final boolean noJoin = random().nextBoolean();
+ final String from = noJoin ? null : field(suffixes, random().nextInt(MAX_FIELD_NUM));
+ final String to = noJoin ? null : field(suffixes, random().nextInt(MAX_FIELD_NUM));
+
+ // keep it simple, only filter on string fields - not point of test
+ final String filterField = strfield(random().nextInt(MAX_FIELD_NUM));
+
+ final String filter = random().nextBoolean() ? null : filterField+":[* TO *]";
+ return new JoinDomain(from, to, filter);
+ }
+ }
+
+ /**
+ * returns a random SolrClient -- either a CloudSolrClient, or an HttpSolrClient pointed
+ * at a node in our cluster
+ */
+ public static SolrClient getRandClient(Random rand) {
+ int numClients = CLIENTS.size();
+ int idx = TestUtil.nextInt(rand, 0, numClients);
+
+ return (idx == numClients) ? CLOUD_CLIENT : CLIENTS.get(idx);
+ }
+
+ public static void waitForRecoveriesToFinish(CloudSolrClient client) throws Exception {
+ assert null != client.getDefaultCollection();
+ AbstractDistribZkTestBase.waitForRecoveriesToFinish(client.getDefaultCollection(),
+ client.getZkStateReader(),
+ true, true, 330);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/15e1c5d3/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacetRefinement.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacetRefinement.java b/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacetRefinement.java
index 6353576..6b542a1 100644
--- a/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacetRefinement.java
+++ b/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacetRefinement.java
@@ -416,8 +416,54 @@ public class TestJsonFacetRefinement extends SolrTestCaseHS {
"}"
);
+ final String sort_limit_over = "sort:'count desc', limit:1, overrequest:0, ";
+ // simplistic join domain testing: no refinement == low count
+ client.testJQ(params(p, "q", "${xy_s}:Y", // query only matches one doc per shard
+ "json.facet", "{"+
+ " cat0:{type:terms, field:${cat_s}, "+sort_limit_over+" refine:false,"+
+ // self join on all_s ensures every doc on every shard included in facets
+ " domain: { join: { from:all_s, to:all_s } } }" +
+ "}"
+ )
+ ,
+ "/response/numFound==3",
+ "facets=={ count:3, " +
+ // w/o overrequest and refinement, count for 'A' is lower than it should be
+ // (we don't see the A from the middle shard)
+ " cat0:{ buckets:[ {val:A,count:3} ] } }");
+ // simplistic join domain testing: refinement == correct count
+ client.testJQ(params(p, "q", "${xy_s}:Y", // query only matches one doc per shard
+ "json.facet", "{" +
+ " cat0:{type:terms, field:${cat_s}, "+sort_limit_over+" refine:true,"+
+ // self join on all_s ensures every doc on every shard included in facets
+ " domain: { join: { from:all_s, to:all_s } } }" +
+ "}"
+ )
+ ,
+ "/response/numFound==3",
+ "facets=={ count:3," +
+ // w/o overrequest, we need refining to get the correct count for 'A'.
+ " cat0:{ buckets:[ {val:A,count:4} ] } }");
+
+ // contrived join domain + refinement (at second level) + testing
+ client.testJQ(params(p, "q", "${xy_s}:Y", // query only matches one doc per shard
+ "json.facet", "{" +
+ // top level facet has a single term
+ " all:{type:terms, field:all_s, "+sort_limit_over+" refine:true, " +
+ " facet:{ "+
+ // subfacet will facet on cat after joining on all (so all docs should be included in subfacet)
+ " cat0:{type:terms, field:${cat_s}, "+sort_limit_over+" refine:true,"+
+ " domain: { join: { from:all_s, to:all_s } } } } }" +
+ "}"
+ )
+ ,
+ "/response/numFound==3",
+ "facets=={ count:3," +
+ // all 3 docs matching base query have same 'all' value in top facet
+ " all:{ buckets:[ { val:all, count:3, " +
+ // sub facet has refinement, so count for 'A' should be correct
+ " cat0:{ buckets: [{val:A,count:4}] } } ] } }");
}
-
-
+
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/15e1c5d3/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java b/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java
index a2b6f06..3f31cca 100644
--- a/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java
+++ b/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java
@@ -37,6 +37,7 @@ import org.apache.solr.SolrTestCaseHS;
import org.apache.solr.common.SolrInputDocument;
import org.apache.solr.SolrTestCaseJ4.SuppressPointFields;
import org.apache.solr.common.params.ModifiableSolrParams;
+import org.apache.solr.common.params.SolrParams;
import org.apache.solr.request.macro.MacroExpander;
import org.junit.AfterClass;
import org.junit.BeforeClass;
@@ -205,6 +206,108 @@ public class TestJsonFacets extends SolrTestCaseHS {
client.commit();
}
+ public void testDomainJoinSelf() throws Exception {
+ Client client = Client.localClient();
+ indexSimple(client);
+
+ // self join domain switch at the second level of faceting
+ assertJQ(req("q", "*:*", "rows", "0",
+ "json.facet", ""
+ + "{x: { type: terms, field: 'num_i', "
+ + " facet: { y: { domain: { join: { from: 'cat_s', to: 'cat_s' } }, "
+ + " type: terms, field: 'where_s' "
+ + " } } } }")
+ , "facets=={count:6, x:{ buckets:["
+ + " { val:-5, count:2, "
+ + " y : { buckets:[{ val:'NJ', count:2 }, { val:'NY', count:1 } ] } }, "
+ + " { val:2, count:1, "
+ + " y : { buckets:[{ val:'NJ', count:1 }, { val:'NY', count:1 } ] } }, "
+ + " { val:3, count:1, "
+ + " y : { buckets:[{ val:'NJ', count:1 }, { val:'NY', count:1 } ] } }, "
+ + " { val:7, count:1, "
+ + " y : { buckets:[{ val:'NJ', count:2 }, { val:'NY', count:1 } ] } } ] } }"
+ );
+ }
+
+ public void testNestedJoinDomain() throws Exception {
+ Client client = Client.localClient();
+
+ client.deleteByQuery("*:*", null);
+ client.add(sdoc("id", "1", "1_s", "A", "2_s", "A", "3_s", "C", "y_s", "B", "x_t", "x z", "z_t", " 2 3"), null);
+ client.add(sdoc("id", "2", "1_s", "B", "2_s", "A", "3_s", "B", "y_s", "B", "x_t", "x y ", "z_t", "1 3"), null);
+ client.add(sdoc("id", "3", "1_s", "C", "2_s", "A", "3_s", "#", "y_s", "A", "x_t", " y z", "z_t", "1 2 "), null);
+ client.add(sdoc("id", "4", "1_s", "A", "2_s", "B", "3_s", "C", "y_s", "A", "x_t", " z", "z_t", " 3"), null);
+ client.add(sdoc("id", "5", "1_s", "B", "2_s", "_", "3_s", "B", "y_s", "C", "x_t", "x ", "z_t", "1 3"), null);
+ client.add(sdoc("id", "6", "1_s", "C", "2_s", "B", "3_s", "A", "y_s", "C", "x_t", "x y z", "z_t", "1 "), null);
+ client.commit();
+
+ assertJQ(req("q", "x_t:x", "rows", "0", // NOTE q - only x=x in base set (1,2,5,6)
+ "json.facet", ""
+ + "{x: { type: terms, field: 'x_t', "
+ + " domain: { join: { from:'1_s', to:'2_s' } },"
+ // y1 & y2 are the same facet, with *similar* child facet z1/z2 ...
+ + " facet: { y1: { type: terms, field: 'y_s', "
+ // z1 & z2 are same field, diff join...
+ + " facet: { z1: { type: terms, field: 'z_t', "
+ + " domain: { join: { from:'2_s', to:'3_s' } } } } },"
+ + " y2: { type: terms, field: 'y_s', "
+ // z1 & z2 are same field, diff join...
+ + " facet: { z2: { type: terms, field: 'z_t', "
+ + " domain: { join: { from:'3_s', to:'1_s' } } } } } } } }")
+ , "facets=={count:4, "
+ + "x:{ buckets:[" // joined 1->2: doc5 drops out, counts: z=4, x=3, y=3
+ + " { val:z, count:4, " // x=z (docs 1,3,4,6) y terms: A=2, B=1, C=1
+ + " y1 : { buckets:[ " // z1 joins 2->3...
+ + " { val:A, count:2, " // A in docs(3,4), joins (A,B) -> docs(2,5,6)
+ + " z1: { buckets:[{ val:'1', count:3 }, { val:'3', count:2 }] } }, "
+ + " { val:B, count:1, " // B in doc1, joins A -> doc6
+ + " z1: { buckets:[{ val:'1', count:1 }] } }, "
+ + " { val:C, count:1, " // C in doc6, joins B -> docs(2,5)
+ + " z1: { buckets:[{ val:'1', count:2 }, { val:'3', count:2 }] } } "
+ + " ] }, "
+ + " y2 : { buckets:[ " // z2 joins 3->1...
+ + " { val:A, count:2, " // A in docs(3,4), joins C -> docs(3,6)
+ + " z2: { buckets:[{ val:'1', count:2 }, { val:'2', count:1 }] } }, "
+ + " { val:B, count:1, " // B in doc1, joins C -> docs(3,6)
+ + " z2: { buckets:[{ val:'1', count:2 }, { val:'2', count:1 }] } }, "
+ + " { val:C, count:1, " // C in doc6, joins A -> docs(1,4)
+ + " z2: { buckets:[{ val:'3', count:2 }, { val:'2', count:1 }] } } "
+ + " ] } }, "
+ + " { val:x, count:3, " // x=x (docs 1,2,!5,6) y terms: B=2, C=1
+ + " y1 : { buckets:[ " // z1 joins 2->3...
+ + " { val:B, count:2, " // B in docs(1,2), joins A -> doc6
+ + " z1: { buckets:[{ val:'1', count:1 }] } }, "
+ + " { val:C, count:1, " // C in doc6, joins B -> docs(2,5)
+ + " z1: { buckets:[{ val:'1', count:2 }, { val:'3', count:2 }] } } "
+ + " ] }, "
+ + " y2 : { buckets:[ " // z2 joins 3->1...
+ + " { val:B, count:2, " // B in docs(1,2), joins C,B -> docs(2,3,5,6)
+ + " z2: { buckets:[{ val:'1', count:4 }, { val:'3', count:2 }, { val:'2', count:1 }] } }, "
+ + " { val:C, count:1, " // C in doc6, joins A -> docs(1,4)
+ + " z2: { buckets:[{ val:'3', count:2 }, { val:'2', count:1 }] } } "
+ + " ] } }, "
+ + " { val:y, count:3, " // x=y (docs 2,3,6) y terms: A=1, B=1, C=1
+ + " y1 : { buckets:[ " // z1 joins 2->3...
+ + " { val:A, count:1, " // A in doc3, joins A -> doc6
+ + " z1: { buckets:[{ val:'1', count:1 }] } }, "
+ + " { val:B, count:1, " // B in doc2, joins A -> doc6
+ + " z1: { buckets:[{ val:'1', count:1 }] } }, "
+ + " { val:C, count:1, " // C in doc6, joins B -> docs(2,5)
+ + " z1: { buckets:[{ val:'1', count:2 }, { val:'3', count:2 }] } } "
+ + " ] }, "
+ + " y2 : { buckets:[ " // z2 joins 3->1...
+ + " { val:A, count:1, " // A in doc3, joins # -> empty set
+ + " z2: { buckets:[ ] } }, "
+ + " { val:B, count:1, " // B in doc2, joins B -> docs(2,5)
+ + " z2: { buckets:[{ val:'1', count:2 }, { val:'3', count:2 }] } }, "
+ + " { val:C, count:1, " // C in doc6, joins A -> docs(1,4)
+ + " z2: { buckets:[{ val:'3', count:2 }, { val:'2', count:1 }] } } "
+ + " ]} }"
+ + " ]}}"
+ );
+ }
+
+
@Test
public void testMethodStream() throws Exception {
Client client = Client.localClient();
@@ -1547,6 +1650,142 @@ public class TestJsonFacets extends SolrTestCaseHS {
}
+ /**
+ * Similar to {@link #testBlockJoin} but uses query time joining.
+ * <p>
+ * (asserts are slightly diff because if a query matches multiple types of documents, blockJoin domain switches
+ * to parent/child domains preserve any existing parent/children from the original domain - eg: when q=*:*)
+ * </p>
+ */
+ public void testQureyJoinBooksAndPages() throws Exception {
+
+ final Client client = Client.localClient();
+
+ final SolrParams p = params("rows","0");
+
+ client.deleteByQuery("*:*", null);
+
+
+ // build up a list of the docs we want to test with
+ List<SolrInputDocument> docsToAdd = new ArrayList<>(10);
+ docsToAdd.add(sdoc("id", "1", "type_s","book", "book_s","A", "v_t","q"));
+
+ docsToAdd.add( sdoc("id", "2", "type_s","book", "book_s","B", "v_t","q w") );
+ docsToAdd.add( sdoc("book_id_s", "2", "id", "2.1", "type_s","page", "page_s","a", "v_t","x y z") );
+ docsToAdd.add( sdoc("book_id_s", "2", "id", "2.2", "type_s","page", "page_s","b", "v_t","x y ") );
+ docsToAdd.add( sdoc("book_id_s", "2", "id","2.3", "type_s","page", "page_s","c", "v_t"," y z" ) );
+
+ docsToAdd.add( sdoc("id", "3", "type_s","book", "book_s","C", "v_t","q w e") );
+ docsToAdd.add( sdoc("book_id_s", "3", "id","3.1", "type_s","page", "page_s","d", "v_t","x ") );
+ docsToAdd.add( sdoc("book_id_s", "3", "id","3.2", "type_s","page", "page_s","e", "v_t"," y ") );
+ docsToAdd.add( sdoc("book_id_s", "3", "id","3.3", "type_s","page", "page_s","f", "v_t"," z") );
+
+ docsToAdd.add( sdoc("id", "4", "type_s","book", "book_s","D", "v_t","e") );
+
+ // shuffle the docs since order shouldn't matter
+ Collections.shuffle(docsToAdd, random());
+ for (SolrInputDocument doc : docsToAdd) {
+ client.add(doc, null);
+ }
+ client.commit();
+
+ // the domains we'll be testing, initially setup for block join
+ final String toChildren = "join: { from:'id', to:'book_id_s' }";
+ final String toParents = "join: { from:'book_id_s', to:'id' }";
+ final String toBogusChildren = "join: { from:'id', to:'does_not_exist' }";
+ final String toBogusParents = "join: { from:'book_id_s', to:'does_not_exist' }";
+
+ client.testJQ(params(p, "q", "*:*"
+ , "json.facet", "{ " +
+ "pages:{ type:query, domain:{"+toChildren+"} , facet:{ x:{field:v_t} } }" +
+ ",pages2:{type:terms, field:v_t, domain:{"+toChildren+"} }" +
+ ",books:{ type:query, domain:{"+toParents+"} , facet:{ x:{field:v_t} } }" +
+ ",books2:{type:terms, field:v_t, domain:{"+toParents+"} }" +
+ ",pageof3:{ type:query, q:'id:3', facet : { x : { type:terms, field:page_s, domain:{"+toChildren+"}}} }" +
+ ",bookof22:{ type:query, q:'id:2.2', facet : { x : { type:terms, field:book_s, domain:{"+toParents+"}}} }" +
+ ",missing_Parents:{ type:query, domain:{"+toBogusParents+"} }" +
+ ",missing_Children:{ type:query, domain:{"+toBogusChildren+"} }" +
+ "}"
+ )
+ , "facets=={ count:10" +
+ ", pages:{count:6 , x:{buckets:[ {val:y,count:4},{val:x,count:3},{val:z,count:3} ]} }" +
+ ", pages2:{ buckets:[ {val:y,count:4},{val:x,count:3},{val:z,count:3} ] }" +
+ ", books:{count:2 , x:{buckets:[ {val:q,count:2},{val:w,count:2},{val:e,count:1} ]} }" +
+ ", books2:{ buckets:[ {val:q,count:2},{val:w,count:2},{val:e,count:1} ] }" +
+ ", pageof3:{count:1 , x:{buckets:[ {val:d,count:1},{val:e,count:1},{val:f,count:1} ]} }" +
+ ", bookof22:{count:1 , x:{buckets:[ {val:B,count:1} ]} }" +
+ ", missing_Parents:{count:0}" +
+ ", missing_Children:{count:0}" +
+ "}"
+ );
+
+ // no matches in base query
+ client.testJQ(params("q", "no_match_s:NO_MATCHES"
+ , "json.facet", "{ processEmpty:true," +
+ "pages:{ type:query, domain:{"+toChildren+"} }" +
+ ",books:{ type:query, domain:{"+toParents+"} }" +
+ "}"
+ )
+ , "facets=={ count:0" +
+ ", pages:{count:0}" +
+ ", books:{count:0}" +
+ "}"
+ );
+
+
+ // test facet on children nested under terms facet on parents
+ client.testJQ(params("q", "*:*"
+ , "json.facet", "{" +
+ "books:{ type:terms, field:book_s, facet:{ pages:{type:terms, field:v_t, domain:{"+toChildren+"}} } }" +
+ "}"
+ )
+ , "facets=={ count:10" +
+ ", books:{buckets:[{val:A,count:1,pages:{buckets:[]}}" +
+ " ,{val:B,count:1,pages:{buckets:[{val:y,count:3},{val:x,count:2},{val:z,count:2}]}}" +
+ " ,{val:C,count:1,pages:{buckets:[{val:x,count:1},{val:y,count:1},{val:z,count:1}]}}" +
+ " ,{val:D,count:1,pages:{buckets:[]}}"+
+ "] }" +
+ "}"
+ );
+
+ // test filter after join
+ client.testJQ(params(p, "q", "*:*"
+ , "json.facet", "{ " +
+ "pages1:{type:terms, field:v_t, domain:{"+toChildren+", filter:'*:*'} }" +
+ ",pages2:{type:terms, field:v_t, domain:{"+toChildren+", filter:'-id:3.1'} }" +
+ ",books:{type:terms, field:v_t, domain:{"+toParents+", filter:'*:*'} }" +
+ ",books2:{type:terms, field:v_t, domain:{"+toParents+", filter:'id:2'} }" +
+ "}"
+ )
+ , "facets=={ count:10" +
+ ", pages1:{ buckets:[ {val:y,count:4},{val:x,count:3},{val:z,count:3} ] }" +
+ ", pages2:{ buckets:[ {val:y,count:4},{val:z,count:3},{val:x,count:2} ] }" +
+ ", books:{ buckets:[ {val:q,count:2},{val:w,count:2},{val:e,count:1} ] }" +
+ ", books2:{ buckets:[ {val:q,count:1}, {val:w,count:1} ] }" +
+ "}"
+ );
+
+
+ // test other various ways to get filters
+ client.testJQ(params(p, "q", "*:*", "f1","-id:3.1", "f2","id:2"
+ , "json.facet", "{ " +
+ "pages1:{type:terms, field:v_t, domain:{"+toChildren+", filter:[]} }" +
+ ",pages2:{type:terms, field:v_t, domain:{"+toChildren+", filter:{param:f1} } }" +
+ ",books:{type:terms, field:v_t, domain:{"+toParents+", filter:[{param:q},{param:missing_param}]} }" +
+ ",books2:{type:terms, field:v_t, domain:{"+toParents+", filter:[{param:f2}] } }" +
+ "}"
+ )
+ , "facets=={ count:10" +
+ ", pages1:{ buckets:[ {val:y,count:4},{val:x,count:3},{val:z,count:3} ] }" +
+ ", pages2:{ buckets:[ {val:y,count:4},{val:z,count:3},{val:x,count:2} ] }" +
+ ", books:{ buckets:[ {val:q,count:2},{val:w,count:2},{val:e,count:1} ] }" +
+ ", books2:{ buckets:[ {val:q,count:1}, {val:w,count:1} ] }" +
+ "}"
+ );
+
+ }
+
+
@Test
public void testErrors() throws Exception {
doTestErrors(Client.localClient());
[48/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10522: Revert
"SOLR-9972: SpellCheckComponent collations and suggestions returned as a JSON
object rather than a list"
Posted by tf...@apache.org.
SOLR-10522: Revert "SOLR-9972: SpellCheckComponent collations and suggestions returned as a JSON object rather than a list"
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/82b78bd9
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/82b78bd9
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/82b78bd9
Branch: refs/heads/jira/solr-10233
Commit: 82b78bd95e95b95b9e7527d9396be24a0dc221df
Parents: 571264b
Author: jdyer1 <jd...@apache.org>
Authored: Mon May 8 13:28:55 2017 -0500
Committer: jdyer1 <jd...@apache.org>
Committed: Mon May 8 13:28:55 2017 -0500
----------------------------------------------------------------------
solr/CHANGES.txt | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/82b78bd9/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index dc5c279..de3ce0b 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -386,6 +386,10 @@ Other Changes
* SOLR-10614: Static fields have turned to instance's field in SimplePostTool.
Enabled TestSolrCLIRunExample.testTechproductsExample(). (Andrey Kudryavtsev, Mikhail Khludnev)
+
+* SOLR-10522: Revert SpellCheckComponent response format change from SOLR-9972 (rel. 6.5.0). While this
+ was an improvement for the json "arrntv" format, it caused problems for the default json format.
+ (James Dyer, reported by Nikita Pchelintsev)
================== 6.5.1 ==================
[33/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10536: Update
CHANGES.txt
Posted by tf...@apache.org.
SOLR-10536: Update 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/4b541096
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/4b541096
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/4b541096
Branch: refs/heads/jira/solr-10233
Commit: 4b54109690a5ba290947e374bf7312c2742fcd93
Parents: b636d6e
Author: Joel Bernstein <jb...@apache.org>
Authored: Sat May 6 12:45:53 2017 -0400
Committer: Joel Bernstein <jb...@apache.org>
Committed: Sat May 6 12:45:53 2017 -0400
----------------------------------------------------------------------
solr/CHANGES.txt | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/4b541096/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index ff7bdcf..2a9438b 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -232,6 +232,8 @@ New Features
* SOLR-10582: Add Correlation Stream Evaluator (Joel Bernstein)
+* SOLR-10536: stats Streaming Expression should work in non-SolrCloud mode (Joel Bernstein)
+
Optimizations
----------------------
[49/50] [abbrv] lucene-solr:jira/solr-10233: Merge branch 'master'
into jira/solr-10233
Posted by tf...@apache.org.
Merge branch 'master' into jira/solr-10233
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/0bb8e47e
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/0bb8e47e
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/0bb8e47e
Branch: refs/heads/jira/solr-10233
Commit: 0bb8e47e4677281802da9304602150126b432933
Parents: 873d1da 82b78bd
Author: Tomas Fernandez Lobbe <tf...@apache.org>
Authored: Mon May 8 13:05:51 2017 -0700
Committer: Tomas Fernandez Lobbe <tf...@apache.org>
Committed: Mon May 8 13:05:51 2017 -0700
----------------------------------------------------------------------
dev-tools/doap/lucene.rdf | 7 +
dev-tools/doap/solr.rdf | 7 +
dev-tools/idea/solr/core/src/java/solr-core.iml | 1 +
dev-tools/scripts/buildAndPushRelease.py | 4 +-
dev-tools/scripts/smokeTestRelease.py | 6 +-
lucene/CHANGES.txt | 37 ++
.../index/TestBackwardsCompatibility.java | 4 +-
.../org/apache/lucene/index/index.6.5.1-cfs.zip | Bin 0 -> 15842 bytes
.../apache/lucene/index/index.6.5.1-nocfs.zip | Bin 0 -> 15827 bytes
.../codecs/simpletext/SimpleTextBKDWriter.java | 20 +-
.../org/apache/lucene/codecs/CodecUtil.java | 2 +-
.../lucene/index/BufferedUpdatesStream.java | 5 +-
.../org/apache/lucene/index/CheckIndex.java | 32 +-
.../apache/lucene/index/IndexFileDeleter.java | 12 +-
.../org/apache/lucene/index/IndexReader.java | 4 +-
.../org/apache/lucene/index/IndexWriter.java | 21 +-
.../apache/lucene/index/SegmentCoreReaders.java | 5 +-
.../apache/lucene/index/SegmentDocValues.java | 3 +-
.../org/apache/lucene/index/SegmentReader.java | 5 +-
.../lucene/index/StandardDirectoryReader.java | 9 +-
.../java/org/apache/lucene/util/IOUtils.java | 92 ++-
.../org/apache/lucene/util/OfflineSorter.java | 453 ++++++++------
.../lucene/util/SameThreadExecutorService.java | 71 +++
.../org/apache/lucene/util/bkd/BKDWriter.java | 21 +-
.../index/TestDemoParallelLeafReader.java | 12 +-
.../apache/lucene/util/TestOfflineSorter.java | 50 +-
.../apache/lucene/facet/FacetsCollector.java | 56 +-
.../lucene/facet/FacetsCollectorManager.java | 16 +-
.../org/apache/lucene/facet/FacetsConfig.java | 2 +-
...ConcurrentSortedSetDocValuesFacetCounts.java | 353 +++++++++++
.../DefaultSortedSetDocValuesReaderState.java | 56 +-
.../SortedSetDocValuesFacetCounts.java | 231 +++----
.../sortedset/SortedSetDocValuesFacetField.java | 1 +
.../SortedSetDocValuesReaderState.java | 7 +-
.../sortedset/TestSortedSetDocValuesFacets.java | 70 ++-
lucene/ivy-versions.properties | 2 +-
.../search/join/ToParentBlockJoinSortField.java | 26 +
.../search/join/TestBlockJoinSorting.java | 41 +-
.../queries/payloads/PayloadScoreQuery.java | 32 +-
.../queries/payloads/SpanPayloadCheckQuery.java | 22 +-
.../queries/payloads/TestPayloadCheckQuery.java | 43 +-
.../queries/payloads/TestPayloadScoreQuery.java | 36 +-
.../flexible/core/util/QueryNodeOperation.java | 2 +-
.../lucene/replicator/http/HttpClientBase.java | 7 +-
.../apache/lucene/replicator/nrt/CopyJob.java | 2 +-
.../lucene/replicator/nrt/CopyOneFile.java | 5 +-
.../lucene/replicator/nrt/ReplicaNode.java | 4 +-
.../prefix/tree/DateRangePrefixTree.java | 8 +-
.../spatial/prefix/DateNRStrategyTest.java | 9 +
.../lucene/index/OwnCacheKeyMultiReader.java | 5 +-
.../org/apache/lucene/mockfile/VerboseFS.java | 14 +-
.../lucene/store/MockDirectoryWrapper.java | 2 +-
solr/CHANGES.txt | 101 +++-
.../collection1/conf/schema-folding-extra.xml | 1 -
.../collection1/conf/schema-icucollate-dv.xml | 1 -
.../solr/collection1/conf/schema-icucollate.xml | 1 -
.../conf/schema-icucollateoptions.xml | 1 -
.../clustering/solr/collection1/conf/schema.xml | 6 -
.../conf/dataimport-schema-no-unique-key.xml | 7 -
.../solr/collection1/conf/dataimport-schema.xml | 2 -
.../conf/dataimport-solr_id-schema.xml | 7 -
.../collection1/conf/dataimport-solrconfig.xml | 1 +
.../dataimport/TestContentStreamDataSource.java | 2 +-
.../extraction/solr/collection1/conf/schema.xml | 1 -
.../extraction/TestXLSXResponseWriter.java | 2 +-
.../langid/solr/collection1/conf/schema.xml | 1 -
.../uima/solr/collection1/conf/schema.xml | 9 -
.../test-files/uima/uima-tokenizers-schema.xml | 9 -
.../velocity/solr/collection1/conf/schema.xml | 5 -
.../java/org/apache/solr/cloud/Overseer.java | 3 +-
.../cloud/OverseerCollectionMessageHandler.java | 3 +-
.../org/apache/solr/cloud/SolrZkServer.java | 163 +----
.../src/java/org/apache/solr/cloud/ZkCLI.java | 96 +--
.../org/apache/solr/cloud/ZkController.java | 1 +
.../solr/cloud/overseer/SliceMutator.java | 3 +-
.../solr/cloud/overseer/ZkStateWriter.java | 14 +-
.../java/org/apache/solr/core/PluginBag.java | 2 +-
.../solr/core/SimpleTextCodecFactory.java | 38 ++
.../src/java/org/apache/solr/core/SolrCore.java | 18 +-
.../java/org/apache/solr/core/SolrCores.java | 1 +
.../apache/solr/handler/SolrConfigHandler.java | 5 +
.../org/apache/solr/handler/StreamHandler.java | 9 +
.../solr/handler/admin/CoreAdminOperation.java | 90 +--
.../solr/handler/component/FacetComponent.java | 3 +-
.../handler/component/SpatialHeatmapFacets.java | 45 +-
.../handler/component/SpellCheckComponent.java | 12 +-
.../java/org/apache/solr/schema/FieldType.java | 1 +
.../solr/search/FloatPayloadValueSource.java | 221 +++++++
.../apache/solr/search/JoinQParserPlugin.java | 22 +-
.../solr/search/PayloadCheckQParserPlugin.java | 109 ++++
.../solr/search/PayloadScoreQParserPlugin.java | 85 +++
.../org/apache/solr/search/QParserPlugin.java | 2 +
.../org/apache/solr/search/QueryParsing.java | 27 -
.../apache/solr/search/ValueSourceParser.java | 66 +-
.../solr/search/facet/FacetFieldProcessor.java | 10 +-
.../solr/search/facet/FacetProcessor.java | 12 +-
.../apache/solr/search/facet/FacetRequest.java | 74 ++-
.../org/apache/solr/search/facet/HLLAgg.java | 6 +-
.../org/apache/solr/search/facet/MaxAgg.java | 57 --
.../org/apache/solr/search/facet/MinAgg.java | 54 --
.../org/apache/solr/search/facet/MinMaxAgg.java | 236 ++++++++
.../org/apache/solr/search/facet/SlotAcc.java | 36 +-
.../org/apache/solr/search/facet/UniqueAgg.java | 6 +-
.../solr/search/facet/UniqueMultiDvSlotAcc.java | 21 +-
.../search/facet/UniqueMultivaluedSlotAcc.java | 5 +-
.../search/facet/UniqueSinglevaluedSlotAcc.java | 20 +-
.../apache/solr/search/facet/UniqueSlotAcc.java | 6 +-
.../search/join/BlockJoinParentQParser.java | 11 +-
.../join/ChildFieldValueSourceParser.java | 197 ++++++
.../PayloadScoringSimilarityWrapper.java | 80 +++
.../similarities/SchemaSimilarityFactory.java | 23 +-
.../solr/security/PKIAuthenticationPlugin.java | 1 +
.../org/apache/solr/servlet/HttpSolrCall.java | 4 +-
.../apache/solr/servlet/SolrDispatchFilter.java | 75 ++-
.../solr/update/DirectUpdateHandler2.java | 47 +-
.../org/apache/solr/update/SolrIndexConfig.java | 12 -
.../processor/AtomicUpdateProcessorFactory.java | 183 ++++++
.../processor/UpdateRequestProcessorChain.java | 12 +-
.../org/apache/solr/util/PayloadDecoder.java | 27 +
.../java/org/apache/solr/util/PayloadUtils.java | 129 ++++
.../java/org/apache/solr/util/RTimerTree.java | 7 +-
.../org/apache/solr/util/SimplePostTool.java | 10 +-
.../src/java/org/apache/solr/util/SolrCLI.java | 55 +-
.../solr/analysisconfs/analysis-err-schema.xml | 1 -
.../bad-schema-analyzer-class-and-nested.xml | 1 -
.../bad-schema-codec-global-vs-ft-mismatch.xml | 1 -
.../bad-schema-currency-dynamic-multivalued.xml | 1 -
...bad-schema-currency-ft-bogus-code-in-xml.xml | 1 -
...ad-schema-currency-ft-bogus-default-code.xml | 1 -
.../conf/bad-schema-currency-ft-multivalued.xml | 1 -
.../conf/bad-schema-currency-ft-oer-norates.xml | 1 -
.../conf/bad-schema-currency-multivalued.xml | 1 -
.../conf/bad-schema-dup-dynamicField.xml | 1 -
.../collection1/conf/bad-schema-dup-field.xml | 1 -
.../conf/bad-schema-dup-fieldType.xml | 1 -
.../bad-schema-dynamicfield-default-val.xml | 1 -
.../conf/bad-schema-dynamicfield-required.xml | 1 -
.../conf/bad-schema-nontext-analyzer.xml | 1 -
.../conf/bad-schema-not-indexed-but-norms.xml | 1 -
.../conf/bad-schema-not-indexed-but-pos.xml | 1 -
.../conf/bad-schema-not-indexed-but-tf.xml | 1 -
.../conf/bad-schema-omit-tf-but-not-pos.xml | 1 -
.../bad-schema-sim-default-does-not-exist.xml | 2 -
...d-schema-sim-default-has-no-explicit-sim.xml | 2 -
.../bad-schema-sim-global-vs-ft-mismatch.xml | 2 -
.../conf/bad-schema-sweetspot-both-tf.xml | 1 -
.../bad-schema-sweetspot-partial-baseline.xml | 1 -
.../bad-schema-sweetspot-partial-hyperbolic.xml | 3 +-
.../conf/bad-schema-sweetspot-partial-norms.xml | 3 +-
.../bad-schema-uniquekey-is-copyfield-dest.xml | 1 -
.../conf/bad-schema-uniquekey-multivalued.xml | 1 -
.../conf/bad-schema-uniquekey-uses-default.xml | 1 -
.../conf/schema-HighlighterMaxOffsetTest.xml | 2 -
.../collection1/conf/schema-SimpleTextCodec.xml | 32 +
.../conf/schema-blockjoinfacetcomponent.xml | 1 -
.../solr/collection1/conf/schema-bm25.xml | 1 -
.../collection1/conf/schema-charfilters.xml | 1 -
.../solr/collection1/conf/schema-collate-dv.xml | 1 -
.../solr/collection1/conf/schema-collate.xml | 1 -
.../collection1/conf/schema-complex-phrase.xml | 36 --
.../collection1/conf/schema-copyfield-test.xml | 1 -
.../collection1/conf/schema-custom-field.xml | 1 -
.../solr/collection1/conf/schema-dfi.xml | 1 -
.../solr/collection1/conf/schema-dfr.xml | 1 -
.../conf/schema-distrib-interval-faceting.xml | 1 -
.../conf/schema-docValuesFaceting.xml | 1 -
.../collection1/conf/schema-docValuesJoin.xml | 1 -
.../conf/schema-field-sort-values.xml | 1 -
.../solr/collection1/conf/schema-folding.xml | 1 -
.../solr/collection1/conf/schema-hash.xml | 1 -
.../solr/collection1/conf/schema-ib.xml | 1 -
.../collection1/conf/schema-lmdirichlet.xml | 1 -
.../collection1/conf/schema-lmjelinekmercer.xml | 1 -
.../conf/schema-not-required-unique-key.xml | 1 -
.../collection1/conf/schema-phrasesuggest.xml | 1 -
.../conf/schema-postingshighlight.xml | 1 -
.../collection1/conf/schema-psuedo-fields.xml | 3 +-
.../collection1/conf/schema-required-fields.xml | 1 -
.../solr/collection1/conf/schema-rest.xml | 4 -
.../solr/collection1/conf/schema-reversed.xml | 1 -
.../solr/collection1/conf/schema-sim.xml | 1 -
.../collection1/conf/schema-simpleqpplugin.xml | 1 -
.../conf/schema-single-dynamic-copy-field.xml | 4 -
.../collection1/conf/schema-spellchecker.xml | 7 -
.../solr/collection1/conf/schema-sql.xml | 1 -
.../solr/collection1/conf/schema-stop-keep.xml | 59 --
.../solr/collection1/conf/schema-sweetspot.xml | 1 -
.../conf/schema-synonym-tokenizer.xml | 1 -
.../solr/collection1/conf/schema-tfidf.xml | 1 -
.../solr/collection1/conf/schema-trie.xml | 4 -
.../conf/schema-unifiedhighlight.xml | 1 -
.../test-files/solr/collection1/conf/schema.xml | 1 -
.../solr/collection1/conf/schema11.xml | 26 +-
.../solr/collection1/conf/schema12.xml | 1 -
.../solr/collection1/conf/schema15.xml | 9 +-
.../solr/collection1/conf/schema_codec.xml | 1 -
.../solr/collection1/conf/schema_latest.xml | 15 -
.../solr/collection1/conf/schemasurround.xml | 1 -
.../conf/solrconfig-cache-enable-disable.xml | 8 +-
.../conf/solrconfig-collapseqparser.xml | 5 +
.../collection1/conf/solrconfig-elevate.xml | 6 +
.../conf/solrconfig-functionquery.xml | 5 +
.../conf/solrconfig-managed-schema.xml | 6 +
.../collection1/conf/solrconfig-minimal.xml | 6 +
.../collection1/conf/solrconfig-nocache.xml | 6 +
.../conf/solrconfig-plugcollector.xml | 6 +
.../conf/solrconfig-postingshighlight.xml | 1 +
.../conf/solrconfig-response-log-component.xml | 6 +
.../solrconfig-sortingmergepolicyfactory.xml | 5 +
.../conf/solrconfig-spellcheckcomponent.xml | 5 +
.../solrconfig-tlog-with-delayingcomponent.xml | 5 +
.../solr/collection1/conf/solrconfig-tlog.xml | 6 +
.../solr/collection1/conf/solrconfig.xml | 6 +
.../conf/solrconfig_SimpleTextCodec.xml | 26 +
.../configsets/cloud-dynamic/conf/schema.xml | 1 -
.../solr/configsets/doc-expiry/conf/schema.xml | 1 -
.../test-files/solr/crazy-path-to-config.xml | 7 +
.../test-files/solr/crazy-path-to-schema.xml | 1 -
.../apache/solr/TestDistributedGrouping.java | 4 +-
.../solr/cloud/CollectionsAPISolrJTest.java | 38 +-
.../org/apache/solr/cloud/OverseerTest.java | 2 +-
.../apache/solr/cloud/SolrCloudExampleTest.java | 8 +
.../cloud/TestCloudJSONFacetJoinDomain.java | 596 +++++++++++++++++++
.../solr/cloud/TestConfigSetsAPIZkFailure.java | 4 +-
.../test/org/apache/solr/cloud/ZkCLITest.java | 28 +
.../apache/solr/core/TestSimpleTextCodec.java | 67 +++
.../apache/solr/core/TestSolrConfigHandler.java | 4 +-
.../org/apache/solr/handler/JsonLoaderTest.java | 139 +++--
.../solr/handler/admin/StatsReloadRaceTest.java | 13 +-
.../component/SpatialHeatmapFacetsTest.java | 22 +
.../component/SpellCheckComponentTest.java | 79 +--
.../highlight/HighlighterMaxOffsetTest.java | 3 +-
.../metrics/reporters/SolrJmxReporterTest.java | 8 +-
.../schema/TestDefaultSearchFieldResource.java | 28 -
.../solr/rest/schema/TestFieldTypeResource.java | 3 +-
.../solr/rest/schema/TestSchemaResource.java | 12 +-
.../org/apache/solr/schema/CopyFieldTest.java | 6 +-
.../apache/solr/search/QueryEqualityTest.java | 58 +-
.../apache/solr/search/QueryParsingTest.java | 4 +-
.../solr/search/TestExtendedDismaxParser.java | 3 +
.../solr/search/TestMaxScoreQueryParser.java | 4 +-
.../search/TestPayloadCheckQParserPlugin.java | 73 +++
.../search/TestPayloadScoreQParserPlugin.java | 54 ++
.../solr/search/TestReRankQParserPlugin.java | 6 +
.../solr/search/TestSimpleQParserPlugin.java | 4 +-
.../search/facet/TestJsonFacetRefinement.java | 50 +-
.../solr/search/facet/TestJsonFacets.java | 299 +++++++++-
.../solr/search/function/TestFunctionQuery.java | 31 +-
.../search/join/BlockJoinFacetRandomTest.java | 1 +
.../search/join/TestCloudNestedDocsSort.java | 185 ++++++
.../solr/search/join/TestNestedDocsSort.java | 145 +++++
.../AtomicUpdateProcessorFactoryTest.java | 281 +++++++++
.../UpdateRequestProcessorFactoryTest.java | 1 +
.../apache/solr/util/SimplePostToolTest.java | 29 +-
.../apache/solr/util/SolrPluginUtilsTest.java | 7 +-
.../apache/solr/util/TestSolrCLIRunExample.java | 138 +++--
.../example-DIH/solr/db/conf/managed-schema | 20 +-
.../example-DIH/solr/mail/conf/managed-schema | 20 +-
.../example-DIH/solr/solr/conf/managed-schema | 20 +-
solr/licenses/zookeeper-3.4.10.jar.sha1 | 1 +
solr/licenses/zookeeper-3.4.6.jar.sha1 | 1 -
.../basic_configs/conf/managed-schema | 5 +-
.../conf/managed-schema | 30 +-
.../conf/managed-schema | 20 +-
solr/server/solr/zoo.cfg | 14 +
solr/solrj/ivy.xml | 1 +
.../org/apache/solr/client/solrj/io/Tuple.java | 4 +
.../solrj/io/comp/SingleValueComparator.java | 65 ++
.../solr/client/solrj/io/eval/AddEvaluator.java | 4 +-
.../client/solrj/io/eval/ComplexEvaluator.java | 7 +
.../client/solrj/io/eval/FieldEvaluator.java | 17 +-
.../client/solrj/io/eval/NumberEvaluator.java | 13 +
.../client/solrj/io/eval/SimpleEvaluator.java | 3 +
.../client/solrj/io/eval/StreamEvaluator.java | 26 +-
.../client/solrj/io/stream/ColumnEvaluator.java | 77 +++
.../solrj/io/stream/ConvolutionEvaluator.java | 82 +++
.../solrj/io/stream/CorrelationEvaluator.java | 77 +++
.../solrj/io/stream/CovarianceEvaluator.java | 77 +++
.../solr/client/solrj/io/stream/GetStream.java | 14 +-
.../solr/client/solrj/io/stream/LetStream.java | 95 +--
.../solrj/io/stream/PredictEvaluator.java | 68 +++
.../solrj/io/stream/RegressionEvaluator.java | 112 ++++
.../client/solrj/io/stream/StatsStream.java | 65 +-
.../client/solrj/io/stream/StreamContext.java | 6 +-
.../solrj/io/stream/TimeSeriesStream.java | 381 ++++++++++++
.../solr/client/solrj/io/stream/TupStream.java | 218 +++++++
.../io/stream/expr/StreamExpressionParser.java | 2 +-
.../solrj/io/stream/expr/StreamFactory.java | 25 +-
.../solr/client/solrj/util/ClientUtils.java | 29 +
.../apache/solr/common/cloud/SolrZkClient.java | 7 +-
.../apache/solr/common/params/SolrParams.java | 23 +-
.../solr/common/util/JsonRecordReader.java | 1 +
.../solrj/solr/collection1/conf/schema-sql.xml | 1 -
.../solrj/solr/collection1/conf/schema.xml | 1 -
.../solr/configsets/shared/conf/schema.xml | 6 -
.../solr/configsets/shared/conf/solrconfig.xml | 6 +
.../solr/configsets/streaming/conf/schema.xml | 1 -
.../configsets/streaming/conf/solrconfig.xml | 8 +-
.../solrj/solr/crazy-path-to-schema.xml | 1 -
.../solrj/solr/multicore/core0/conf/schema.xml | 6 -
.../solr/multicore/core0/conf/solrconfig.xml | 6 +
.../solrj/solr/multicore/core1/conf/schema.xml | 6 -
.../solr/multicore/core1/conf/solrconfig.xml | 6 +
.../solrj/io/stream/StreamExpressionTest.java | 504 +++++++++++++---
.../stream/eval/AbsoluteValueEvaluatorTest.java | 33 +-
.../solrj/io/stream/eval/AddEvaluatorTest.java | 6 -
solr/webapp/web/css/angular/plugins.css | 6 +
solr/webapp/web/partials/plugins.html | 6 +-
308 files changed, 7733 insertions(+), 1873 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0bb8e47e/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionMessageHandler.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0bb8e47e/solr/core/src/java/org/apache/solr/cloud/ZkController.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0bb8e47e/solr/core/src/java/org/apache/solr/cloud/overseer/SliceMutator.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0bb8e47e/solr/core/src/java/org/apache/solr/cloud/overseer/ZkStateWriter.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0bb8e47e/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0bb8e47e/solr/core/src/test/org/apache/solr/cloud/CollectionsAPISolrJTest.java
----------------------------------------------------------------------
[37/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10622: Add regress
and predict Stream Evaluators
Posted by tf...@apache.org.
SOLR-10622: Add regress and predict Stream Evaluators
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/d724983c
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/d724983c
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/d724983c
Branch: refs/heads/jira/solr-10233
Commit: d724983c03249acd8a26e1c00b77b5573f6eefc0
Parents: 0ed39b2
Author: Joel Bernstein <jb...@apache.org>
Authored: Sun May 7 15:23:56 2017 -0400
Committer: Joel Bernstein <jb...@apache.org>
Committed: Sun May 7 15:24:21 2017 -0400
----------------------------------------------------------------------
.../org/apache/solr/handler/StreamHandler.java | 2 +
.../solrj/io/stream/PredictEvaluator.java | 68 +++++++++++
.../solrj/io/stream/RegressionEvaluator.java | 112 +++++++++++++++++++
.../solrj/io/stream/StreamExpressionTest.java | 50 ++++++++-
4 files changed, 231 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d724983c/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/StreamHandler.java b/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
index 474f5b0..f0282d0 100644
--- a/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
@@ -168,6 +168,8 @@ public class StreamHandler extends RequestHandlerBase implements SolrCoreAware,
.withFunctionName("timeseries", TimeSeriesStream.class)
.withFunctionName("tuple", TupStream.class)
.withFunctionName("col", ColumnEvaluator.class)
+ .withFunctionName("predict", PredictEvaluator.class)
+ .withFunctionName("regress", RegressionEvaluator.class)
// metrics
.withFunctionName("min", MinMetric.class)
.withFunctionName("max", MaxMetric.class)
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d724983c/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/PredictEvaluator.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/PredictEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/PredictEvaluator.java
new file mode 100644
index 0000000..3c3ab84
--- /dev/null
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/PredictEvaluator.java
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr.client.solrj.io.stream;
+
+import java.io.IOException;
+
+import org.apache.solr.client.solrj.io.Tuple;
+import org.apache.solr.client.solrj.io.eval.ComplexEvaluator;
+import org.apache.solr.client.solrj.io.eval.StreamEvaluator;
+import org.apache.solr.client.solrj.io.stream.expr.Explanation;
+import org.apache.solr.client.solrj.io.stream.expr.Explanation.ExpressionType;
+import org.apache.solr.client.solrj.io.stream.expr.Expressible;
+import org.apache.solr.client.solrj.io.stream.expr.StreamExpression;
+import org.apache.solr.client.solrj.io.stream.expr.StreamExpressionParameter;
+import org.apache.solr.client.solrj.io.stream.expr.StreamFactory;
+
+public class PredictEvaluator extends ComplexEvaluator implements Expressible {
+
+ private static final long serialVersionUID = 1;
+
+ public PredictEvaluator(StreamExpression expression, StreamFactory factory) throws IOException {
+ super(expression, factory);
+ }
+
+ public Number evaluate(Tuple tuple) throws IOException {
+
+ if(subEvaluators.size() != 2) {
+ throw new IOException("Predict expects 2 parameters: a regression result and a number");
+ }
+
+ StreamEvaluator r = subEvaluators.get(0);
+ StreamEvaluator d = subEvaluators.get(1);
+
+ RegressionEvaluator.RegressionTuple rt= (RegressionEvaluator.RegressionTuple)r.evaluate(tuple);
+ Number n = (Number)d.evaluate(tuple);
+ return rt.predict(n.doubleValue());
+ }
+
+ @Override
+ public StreamExpressionParameter toExpression(StreamFactory factory) throws IOException {
+ StreamExpression expression = new StreamExpression(factory.getFunctionName(getClass()));
+ return expression;
+ }
+
+ @Override
+ public Explanation toExplanation(StreamFactory factory) throws IOException {
+ return new Explanation(nodeId.toString())
+ .withExpressionType(ExpressionType.EVALUATOR)
+ .withFunctionName(factory.getFunctionName(getClass()))
+ .withImplementingClass(getClass().getName())
+ .withExpression(toExpression(factory).toString());
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d724983c/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RegressionEvaluator.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RegressionEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RegressionEvaluator.java
new file mode 100644
index 0000000..5306193
--- /dev/null
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RegressionEvaluator.java
@@ -0,0 +1,112 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.client.solrj.io.stream;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.math3.stat.regression.SimpleRegression;
+import org.apache.solr.client.solrj.io.Tuple;
+import org.apache.solr.client.solrj.io.eval.ComplexEvaluator;
+import org.apache.solr.client.solrj.io.eval.StreamEvaluator;
+import org.apache.solr.client.solrj.io.stream.expr.Explanation;
+import org.apache.solr.client.solrj.io.stream.expr.Explanation.ExpressionType;
+import org.apache.solr.client.solrj.io.stream.expr.Expressible;
+import org.apache.solr.client.solrj.io.stream.expr.StreamExpression;
+import org.apache.solr.client.solrj.io.stream.expr.StreamExpressionParameter;
+import org.apache.solr.client.solrj.io.stream.expr.StreamFactory;
+
+public class RegressionEvaluator extends ComplexEvaluator implements Expressible {
+
+ private static final long serialVersionUID = 1;
+
+ public RegressionEvaluator(StreamExpression expression, StreamFactory factory) throws IOException {
+ super(expression, factory);
+ }
+
+ public Tuple evaluate(Tuple tuple) throws IOException {
+
+ if(subEvaluators.size() != 2) {
+ throw new IOException("Regress expects 2 columns as parameters");
+ }
+
+ StreamEvaluator colEval1 = subEvaluators.get(0);
+ StreamEvaluator colEval2 = subEvaluators.get(1);
+
+ List<Number> numbers1 = (List<Number>)colEval1.evaluate(tuple);
+ List<Number> numbers2 = (List<Number>)colEval2.evaluate(tuple);
+ double[] column1 = new double[numbers1.size()];
+ double[] column2 = new double[numbers2.size()];
+
+ for(int i=0; i<numbers1.size(); i++) {
+ column1[i] = numbers1.get(i).doubleValue();
+ }
+
+ for(int i=0; i<numbers2.size(); i++) {
+ column2[i] = numbers2.get(i).doubleValue();
+ }
+
+ SimpleRegression regression = new SimpleRegression();
+ for(int i=0; i<column1.length; i++) {
+ regression.addData(column1[i], column2[i]);
+ }
+
+ Map map = new HashMap();
+ map.put("slope", regression.getSlope());
+ map.put("intercept", regression.getIntercept());
+ map.put("R", regression.getR());
+ map.put("N", regression.getN());
+ map.put("regressionSumSquares", regression.getRegressionSumSquares());
+ map.put("slopeConfidenceInterval", regression.getSlopeConfidenceInterval());
+ map.put("interceptStdErr", regression.getInterceptStdErr());
+ map.put("totalSumSquares", regression.getTotalSumSquares());
+ map.put("significance", regression.getSignificance());
+ map.put("meanSquareError", regression.getMeanSquareError());
+ return new RegressionTuple(regression, map);
+ }
+
+ public static class RegressionTuple extends Tuple {
+
+ private SimpleRegression simpleRegression;
+
+ public RegressionTuple(SimpleRegression simpleRegression, Map map) {
+ super(map);
+ this.simpleRegression = simpleRegression;
+ }
+
+ public double predict(double d) {
+ return this.simpleRegression.predict(d);
+ }
+ }
+
+ @Override
+ public StreamExpressionParameter toExpression(StreamFactory factory) throws IOException {
+ StreamExpression expression = new StreamExpression(factory.getFunctionName(getClass()));
+ return expression;
+ }
+
+ @Override
+ public Explanation toExplanation(StreamFactory factory) throws IOException {
+ return new Explanation(nodeId.toString())
+ .withExpressionType(ExpressionType.EVALUATOR)
+ .withFunctionName(factory.getFunctionName(getClass()))
+ .withImplementingClass(getClass().getName())
+ .withExpression(toExpression(factory).toString());
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d724983c/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
index 0af7935..41ffe09 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
@@ -5208,7 +5208,6 @@ public class StreamExpressionTest extends SolrCloudTestCase {
}
-
@Test
public void testCorrelationStream() throws Exception {
UpdateRequest updateRequest = new UpdateRequest();
@@ -5256,6 +5255,55 @@ public class StreamExpressionTest extends SolrCloudTestCase {
+
+ @Test
+ public void testRegressAndPredict() throws Exception {
+ UpdateRequest updateRequest = new UpdateRequest();
+
+
+ updateRequest.add(id, "1", "price_f", "100.0", "col_s", "a", "order_i", "1");
+ updateRequest.add(id, "2", "price_f", "200.0", "col_s", "a", "order_i", "2");
+ updateRequest.add(id, "3", "price_f", "300.0", "col_s", "a", "order_i", "3");
+ updateRequest.add(id, "4", "price_f", "100.0", "col_s", "a", "order_i", "4");
+ updateRequest.add(id, "5", "price_f", "200.0", "col_s", "a", "order_i", "5");
+ updateRequest.add(id, "6", "price_f", "400.0", "col_s", "a", "order_i", "6");
+ updateRequest.add(id, "7", "price_f", "600.0", "col_s", "a", "order_i", "7");
+
+ updateRequest.add(id, "8", "price_f", "200.0", "col_s", "b", "order_i", "1");
+ updateRequest.add(id, "9", "price_f", "400.0", "col_s", "b", "order_i", "2");
+ updateRequest.add(id, "10", "price_f", "600.0", "col_s", "b", "order_i", "3");
+ updateRequest.add(id, "11", "price_f", "200.0", "col_s", "b", "order_i", "4");
+ updateRequest.add(id, "12", "price_f", "400.0", "col_s", "b", "order_i", "5");
+ updateRequest.add(id, "13", "price_f", "800.0", "col_s", "b", "order_i", "6");
+ updateRequest.add(id, "14", "price_f", "1200.0", "col_s", "b", "order_i", "7");
+ updateRequest.commit(cluster.getSolrClient(), COLLECTIONORALIAS);
+
+ String expr1 = "search("+COLLECTIONORALIAS+", q=\"col_s:a\", fl=\"price_f, order_i\", sort=\"order_i asc\")";
+ String expr2 = "search("+COLLECTIONORALIAS+", q=\"col_s:b\", fl=\"price_f, order_i\", sort=\"order_i asc\")";
+
+ String cexpr = "let(a="+expr1+", b="+expr2+", c=col(a, price_f), d=col(b, price_f), e=regress(c, d), tuple(regress=e, p=predict(e, 300)))";
+
+ ModifiableSolrParams paramsLoc = new ModifiableSolrParams();
+ paramsLoc.set("expr", cexpr);
+ paramsLoc.set("qt", "/stream");
+
+ String url = cluster.getJettySolrRunners().get(0).getBaseUrl().toString()+"/"+COLLECTIONORALIAS;
+ TupleStream solrStream = new SolrStream(url, paramsLoc);
+
+ StreamContext context = new StreamContext();
+ solrStream.setStreamContext(context);
+ List<Tuple> tuples = getTuples(solrStream);
+ assertTrue(tuples.size() == 1);
+ Tuple tuple = tuples.get(0);
+ Map regression = (Map)tuple.get("regress");
+ double slope = (double)regression.get("slope");
+ double intercept= (double) regression.get("intercept");
+ assertTrue(slope == 2.0D);
+ assertTrue(intercept == 0.0D);
+ double prediction = tuple.getDouble("p");
+ assertTrue(prediction == 600.0D);
+ }
+
@Test
public void testListStream() throws Exception {
UpdateRequest updateRequest = new UpdateRequest();
[30/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-9530: addressing
test failures with seed 9F9128B8E3E8FAA7
Posted by tf...@apache.org.
SOLR-9530: addressing test failures with seed 9F9128B8E3E8FAA7
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/58837104
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/58837104
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/58837104
Branch: refs/heads/jira/solr-10233
Commit: 58837104abf9efda84a2969557046dc02e7fffb1
Parents: 468d479
Author: Noble Paul <no...@apache.org>
Authored: Sat May 6 07:54:22 2017 +0930
Committer: Noble Paul <no...@apache.org>
Committed: Sat May 6 07:54:22 2017 +0930
----------------------------------------------------------------------
.../solr/update/processor/AtomicUpdateProcessorFactoryTest.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/58837104/solr/core/src/test/org/apache/solr/update/processor/AtomicUpdateProcessorFactoryTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/update/processor/AtomicUpdateProcessorFactoryTest.java b/solr/core/src/test/org/apache/solr/update/processor/AtomicUpdateProcessorFactoryTest.java
index 780e2ba..f3f833d 100644
--- a/solr/core/src/test/org/apache/solr/update/processor/AtomicUpdateProcessorFactoryTest.java
+++ b/solr/core/src/test/org/apache/solr/update/processor/AtomicUpdateProcessorFactoryTest.java
@@ -37,6 +37,7 @@ public class AtomicUpdateProcessorFactoryTest extends SolrTestCaseJ4 {
@BeforeClass
public static void beforeClass() throws Exception {
+ System.setProperty("enable.update.log","true");
initCore("solrconfig.xml", "schema.xml");
}
@@ -277,4 +278,4 @@ public class AtomicUpdateProcessorFactoryTest extends SolrTestCaseJ4 {
return sb.toString();
}
-}
\ No newline at end of file
+}
[03/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10601:
StreamExpressionParser should handle white space around = in named parameters
Posted by tf...@apache.org.
SOLR-10601: StreamExpressionParser should handle white space around = in named parameters
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/17563ce8
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/17563ce8
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/17563ce8
Branch: refs/heads/jira/solr-10233
Commit: 17563ce81f26cb2844c60ba26b1627f6f7e8908d
Parents: b901d16
Author: Joel Bernstein <jb...@apache.org>
Authored: Wed May 3 10:25:30 2017 -0400
Committer: Joel Bernstein <jb...@apache.org>
Committed: Wed May 3 10:25:54 2017 -0400
----------------------------------------------------------------------
.../solr/client/solrj/io/stream/expr/StreamExpressionParser.java | 2 +-
.../apache/solr/client/solrj/io/stream/StreamExpressionTest.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/17563ce8/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/expr/StreamExpressionParser.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/expr/StreamExpressionParser.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/expr/StreamExpressionParser.java
index 294115a..fd5c9d3 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/expr/StreamExpressionParser.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/expr/StreamExpressionParser.java
@@ -147,7 +147,7 @@ public class StreamExpressionParser {
int firstOpenEquals = findNextClear(clause, 0, '=');
if(firstOpenEquals <= 0 || firstOpenEquals == clause.length() - 1){ return false; }
String name = clause.substring(0, firstOpenEquals);
- if(!wordToken(name)){ return false; }
+ if(!wordToken(name.trim())){ return false; }
return true;
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/17563ce8/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
index 9ea8ca4..0af7935 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
@@ -5359,7 +5359,7 @@ public class StreamExpressionTest extends SolrCloudTestCase {
updateRequest.commit(cluster.getSolrClient(), COLLECTIONORALIAS);
String expr = "search("+COLLECTIONORALIAS+", q=\"*:*\", fl=\"id,test_t, test_i\", sort=\"id desc\")";
- String cat = "let(a="+expr+", b=add(1,3), c=col(a, test_i), tuple(test=add(1,1), test1=b, results=a, test2=add(c)))";
+ String cat = "let(a ="+expr+", b = add(1,3), c=col(a, test_i), tuple(test = add(1,1), test1=b, results=a, test2=add(c)))";
ModifiableSolrParams paramsLoc = new ModifiableSolrParams();
paramsLoc.set("expr", cat);
paramsLoc.set("qt", "/stream");
[35/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10614: remove
static backdoor fields from SimplePostTool. Enabling testTechproductsExample
Posted by tf...@apache.org.
SOLR-10614: remove static backdoor fields from SimplePostTool.
Enabling testTechproductsExample
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/dbe6fc5d
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/dbe6fc5d
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/dbe6fc5d
Branch: refs/heads/jira/solr-10233
Commit: dbe6fc5d8f63b4ac87ae015f1cf79ec89c271a01
Parents: df6da67
Author: Mikhail Khludnev <mk...@apache.org>
Authored: Sat May 6 10:44:57 2017 +0300
Committer: Mikhail Khludnev <mk...@apache.org>
Committed: Sat May 6 22:29:10 2017 +0300
----------------------------------------------------------------------
solr/CHANGES.txt | 3 +
.../org/apache/solr/util/SimplePostTool.java | 10 +-
.../apache/solr/util/SimplePostToolTest.java | 29 ++--
.../apache/solr/util/TestSolrCLIRunExample.java | 134 +++++++++----------
4 files changed, 90 insertions(+), 86 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/dbe6fc5d/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 21044bb..4dba434 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -371,6 +371,9 @@ Other Changes
* SOLR-10601: StreamExpressionParser should handle white space around = in named parameters (Joel Bernstein)
+* SOLR-10614: Static fields have turned to instance's field in SimplePostTool.
+ Enabled TestSolrCLIRunExample.testTechproductsExample(). (Andrey Kudryavtsev, Mikhail Khludnev)
+
================== 6.5.1 ==================
Bug Fixes
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/dbe6fc5d/solr/core/src/java/org/apache/solr/util/SimplePostTool.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/util/SimplePostTool.java b/solr/core/src/java/org/apache/solr/util/SimplePostTool.java
index 6e18cf9..327361e 100644
--- a/solr/core/src/java/org/apache/solr/util/SimplePostTool.java
+++ b/solr/core/src/java/org/apache/solr/util/SimplePostTool.java
@@ -125,8 +125,8 @@ public class SimplePostTool {
"Usage: java [SystemProperties] -jar post.jar [-h|-] [<file|folder|url|arg> [<file|folder|url|arg>...]]";
// Used in tests to avoid doing actual network traffic
- static boolean mockMode = false;
- static PageFetcher pageFetcher;
+ boolean mockMode = false;
+ PageFetcher pageFetcher;
static {
DATA_MODES.add(DATA_MODE_FILES);
@@ -810,7 +810,7 @@ public class SimplePostTool {
} else {
if(type == null) type = DEFAULT_CONTENT_TYPE;
}
- info("POSTing file " + file.getName() + (auto?" ("+type+")":"") + " to [base]" + suffix);
+ info("POSTing file " + file.getName() + (auto?" ("+type+")":"") + " to [base]" + suffix + (mockMode ? " MOCK!":""));
is = new FileInputStream(file);
postData(is, file.length(), output, type, url);
} catch (IOException e) {
@@ -851,7 +851,7 @@ public class SimplePostTool {
/**
* Performs a simple get on the given URL
*/
- public static void doGet(String url) {
+ public void doGet(String url) {
try {
doGet(new URL(url));
} catch (MalformedURLException e) {
@@ -862,7 +862,7 @@ public class SimplePostTool {
/**
* Performs a simple get on the given URL
*/
- public static void doGet(URL url) {
+ public void doGet(URL url) {
try {
if(mockMode) return;
HttpURLConnection urlc = (HttpURLConnection) url.openConnection();
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/dbe6fc5d/solr/core/src/test/org/apache/solr/util/SimplePostToolTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/util/SimplePostToolTest.java b/solr/core/src/test/org/apache/solr/util/SimplePostToolTest.java
index c9f8fc5..b9eaa63 100644
--- a/solr/core/src/test/org/apache/solr/util/SimplePostToolTest.java
+++ b/solr/core/src/test/org/apache/solr/util/SimplePostToolTest.java
@@ -16,12 +16,6 @@
*/
package org.apache.solr.util;
-import org.apache.solr.SolrTestCaseJ4;
-import org.apache.solr.util.SimplePostTool.PageFetcher;
-import org.apache.solr.util.SimplePostTool.PageFetcherResult;
-import org.junit.Before;
-import org.junit.Test;
-
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
@@ -34,6 +28,12 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
+import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.util.SimplePostTool.PageFetcher;
+import org.apache.solr.util.SimplePostTool.PageFetcherResult;
+import org.junit.Before;
+import org.junit.Test;
+
/**
* NOTE: do *not* use real hostnames, not even "example.com", in this test.
*
@@ -42,6 +42,7 @@ import java.util.Set;
* the hostnames.
*/
public class SimplePostToolTest extends SolrTestCaseJ4 {
+
SimplePostTool t_file, t_file_auto, t_file_rec, t_web, t_test;
PageFetcher pf;
@@ -70,8 +71,10 @@ public class SimplePostToolTest extends SolrTestCaseJ4 {
t_test = SimplePostTool.parseArgsAndInit(args);
pf = new MockPageFetcher();
- SimplePostTool.pageFetcher = pf;
- SimplePostTool.mockMode = true;
+ for (SimplePostTool mockable : new SimplePostTool[]{t_web, t_file_auto}) {
+ mockable.pageFetcher = pf;
+ mockable.mockMode = true;
+ }
}
@Test
@@ -170,7 +173,7 @@ public class SimplePostToolTest extends SolrTestCaseJ4 {
assertEquals(3, num);
// Without respecting robots.txt
- SimplePostTool.pageFetcher.robotsCache.clear();
+ t_web.pageFetcher.robotsCache.clear();
t_web.recursive = 5;
num = t_web.postWebPages(new String[] {"http://[ff01::114]/#removeme"}, 0, null);
assertEquals(6, num);
@@ -178,9 +181,9 @@ public class SimplePostToolTest extends SolrTestCaseJ4 {
@Test
public void testRobotsExclusion() throws MalformedURLException {
- assertFalse(SimplePostTool.pageFetcher.isDisallowedByRobots(new URL("http://[ff01::114]/")));
- assertTrue(SimplePostTool.pageFetcher.isDisallowedByRobots(new URL("http://[ff01::114]/disallowed")));
- assertTrue("There should be two entries parsed from robots.txt", SimplePostTool.pageFetcher.robotsCache.get("[ff01::114]").size() == 2);
+ assertFalse(t_web.pageFetcher.isDisallowedByRobots(new URL("http://[ff01::114]/")));
+ assertTrue(t_web.pageFetcher.isDisallowedByRobots(new URL("http://[ff01::114]/disallowed")));
+ assertTrue("There should be two entries parsed from robots.txt", t_web.pageFetcher.robotsCache.get("[ff01::114]").size() == 2);
}
static class MockPageFetcher extends PageFetcher {
@@ -219,7 +222,7 @@ public class SimplePostToolTest extends SolrTestCaseJ4 {
sb.append("Disallow: # This is void\n");
sb.append("Disallow: /disallow # Disallow this path\n");
sb.append("Disallow: /nonexistingpath # Disallow this path\n");
- this.robotsCache.put("[ff01::114]", SimplePostTool.pageFetcher.
+ this.robotsCache.put("[ff01::114]", super.
parseRobotsTxt(new ByteArrayInputStream(sb.toString().getBytes(StandardCharsets.UTF_8))));
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/dbe6fc5d/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java b/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
index 8e30b3b..86554b5 100644
--- a/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
+++ b/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
@@ -50,7 +50,6 @@ import org.apache.solr.common.SolrInputDocument;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.BeforeClass;
-import org.junit.Ignore;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -298,7 +297,7 @@ public class TestSolrCLIRunExample extends SolrTestCaseJ4 {
}
}
- @Test @Ignore
+ @Test
public void testTechproductsExample() throws Exception {
testExample("techproducts");
}
@@ -317,75 +316,74 @@ public class TestSolrCLIRunExample extends SolrTestCaseJ4 {
File solrExampleDir = tmpDir.toFile();
File solrServerDir = solrHomeDir.getParentFile();
- for (int i =0; i<2; i++){
- // need a port to start the example server on
- int bindPort = -1;
- try (ServerSocket socket = new ServerSocket(0)) {
- bindPort = socket.getLocalPort();
- }
-
- log.info("Selected port "+bindPort+" to start "+exampleName+" example Solr instance on ...");
-
- String[] toolArgs = new String[] {
- "-e", exampleName,
- "-serverDir", solrServerDir.getAbsolutePath(),
- "-exampleDir", solrExampleDir.getAbsolutePath(),
- "-p", String.valueOf(bindPort)
- };
-
- // capture tool output to stdout
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- PrintStream stdoutSim = new PrintStream(baos, true, StandardCharsets.UTF_8.name());
-
- RunExampleExecutor executor = new RunExampleExecutor(stdoutSim);
- closeables.add(executor);
-
- SolrCLI.RunExampleTool tool = new SolrCLI.RunExampleTool(executor, System.in, stdoutSim);
- try {
- final int status = tool.runTool(SolrCLI.processCommandLineArgs(SolrCLI.joinCommonAndToolOptions(tool.getOptions()), toolArgs));
- assertEquals("it should be ok "+tool+" "+Arrays.toString(toolArgs),0, status);
- } catch (Exception e) {
- log.error("RunExampleTool failed due to: " + e +
- "; stdout from tool prior to failure: " + baos.toString(StandardCharsets.UTF_8.name()));
- throw e;
- }
-
- String toolOutput = baos.toString(StandardCharsets.UTF_8.name());
-
- // dump all the output written by the SolrCLI commands to stdout
- //System.out.println("\n\n"+toolOutput+"\n\n");
-
- File exampleSolrHomeDir = new File(solrExampleDir, exampleName+"/solr");
- assertTrue(exampleSolrHomeDir.getAbsolutePath() + " not found! run " +
- exampleName + " example failed; output: " + toolOutput,
- exampleSolrHomeDir.isDirectory());
-
- if ("techproducts".equals(exampleName)) {
- HttpSolrClient solrClient = getHttpSolrClient("http://localhost:" + bindPort + "/solr/" + exampleName);
- try{
- SolrQuery query = new SolrQuery("*:*");
- QueryResponse qr = solrClient.query(query);
- long numFound = qr.getResults().getNumFound();
- if (numFound == 0) {
- // brief wait in case of timing issue in getting the new docs committed
- log.warn("Going to wait for 1 second before re-trying query for techproduct example docs ...");
- try {
- Thread.sleep(1000);
- } catch (InterruptedException ignore) {
- Thread.interrupted();
+ for (int pass = 0; pass<2; pass++){
+ // need a port to start the example server on
+ int bindPort = -1;
+ try (ServerSocket socket = new ServerSocket(0)) {
+ bindPort = socket.getLocalPort();
+ }
+
+ log.info("Selected port "+bindPort+" to start "+exampleName+" example Solr instance on ...");
+
+ String[] toolArgs = new String[] {
+ "-e", exampleName,
+ "-serverDir", solrServerDir.getAbsolutePath(),
+ "-exampleDir", solrExampleDir.getAbsolutePath(),
+ "-p", String.valueOf(bindPort)
+ };
+
+ // capture tool output to stdout
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ PrintStream stdoutSim = new PrintStream(baos, true, StandardCharsets.UTF_8.name());
+
+ RunExampleExecutor executor = new RunExampleExecutor(stdoutSim);
+ closeables.add(executor);
+
+ SolrCLI.RunExampleTool tool = new SolrCLI.RunExampleTool(executor, System.in, stdoutSim);
+ try {
+ final int status = tool.runTool(SolrCLI.processCommandLineArgs(SolrCLI.joinCommonAndToolOptions(tool.getOptions()), toolArgs));
+ assertEquals("it should be ok "+tool+" "+Arrays.toString(toolArgs),0, status);
+ } catch (Exception e) {
+ log.error("RunExampleTool failed due to: " + e +
+ "; stdout from tool prior to failure: " + baos.toString(StandardCharsets.UTF_8.name()));
+ throw e;
+ }
+
+ String toolOutput = baos.toString(StandardCharsets.UTF_8.name());
+
+ // dump all the output written by the SolrCLI commands to stdout
+ //System.out.println("\n\n"+toolOutput+"\n\n");
+
+ File exampleSolrHomeDir = new File(solrExampleDir, exampleName+"/solr");
+ assertTrue(exampleSolrHomeDir.getAbsolutePath() + " not found! run " +
+ exampleName + " example failed; output: " + toolOutput,
+ exampleSolrHomeDir.isDirectory());
+
+ if ("techproducts".equals(exampleName)) {
+ HttpSolrClient solrClient = getHttpSolrClient("http://localhost:" + bindPort + "/solr/" + exampleName);
+ try{
+ SolrQuery query = new SolrQuery("*:*");
+ QueryResponse qr = solrClient.query(query);
+ long numFound = qr.getResults().getNumFound();
+ if (numFound == 0) {
+ // brief wait in case of timing issue in getting the new docs committed
+ log.warn("Going to wait for 1 second before re-trying query for techproduct example docs ...");
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException ignore) {
+ Thread.interrupted();
+ }
+ numFound = solrClient.query(query).getResults().getNumFound();
}
- numFound = solrClient.query(query).getResults().getNumFound();
+ assertTrue("expected 32 docs in the " + exampleName + " example but found " + numFound + ", output: " + toolOutput,
+ numFound == 32);
+ }finally{
+ solrClient.close();
}
- assertTrue("expected 32 docs in the " + exampleName + " example but found " + numFound + ", output: " + toolOutput,
- numFound == 32);
- }finally{
-
- solrClient.close();
}
- }
-
- // stop the test instance
- executor.execute(org.apache.commons.exec.CommandLine.parse("bin/solr stop -p " + bindPort));
+
+ // stop the test instance
+ executor.execute(org.apache.commons.exec.CommandLine.parse("bin/solr stop -p " + bindPort));
}
}
[34/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10601: Update
CHANGES.txt
Posted by tf...@apache.org.
SOLR-10601: Update 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/df6da672
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/df6da672
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/df6da672
Branch: refs/heads/jira/solr-10233
Commit: df6da672042b869450d87d8abc1817ea83afeac1
Parents: 4b54109
Author: Joel Bernstein <jb...@apache.org>
Authored: Sat May 6 12:53:29 2017 -0400
Committer: Joel Bernstein <jb...@apache.org>
Committed: Sat May 6 12:53:29 2017 -0400
----------------------------------------------------------------------
solr/CHANGES.txt | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/df6da672/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 2a9438b..21044bb 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -369,6 +369,8 @@ Other Changes
* SOLR-7041: Cutover tests to using 'q.op' and 'df' instead of schema 'defaultOperator' and 'defaultSearchField' (janhoy)
+* SOLR-10601: StreamExpressionParser should handle white space around = in named parameters (Joel Bernstein)
+
================== 6.5.1 ==================
Bug Fixes
[14/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-7041: Cut over
tests from in schema to df on requests
Posted by tf...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test/org/apache/solr/search/TestMaxScoreQueryParser.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/TestMaxScoreQueryParser.java b/solr/core/src/test/org/apache/solr/search/TestMaxScoreQueryParser.java
index 4699a66..e995f1e 100644
--- a/solr/core/src/test/org/apache/solr/search/TestMaxScoreQueryParser.java
+++ b/solr/core/src/test/org/apache/solr/search/TestMaxScoreQueryParser.java
@@ -19,6 +19,7 @@ package org.apache.solr.search;
import org.apache.lucene.index.Term;
import org.apache.lucene.legacy.LegacyNumericRangeQuery;
import org.apache.lucene.search.*;
+import org.apache.solr.common.params.MapSolrParams;
import org.apache.solr.common.params.ModifiableSolrParams;
import org.apache.solr.util.AbstractSolrTestCase;
import org.junit.BeforeClass;
@@ -27,6 +28,7 @@ import org.junit.Test;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
+import java.util.Collections;
public class TestMaxScoreQueryParser extends AbstractSolrTestCase {
Query q;
@@ -141,7 +143,7 @@ public class TestMaxScoreQueryParser extends AbstractSolrTestCase {
while(al.size() >= 2) {
p.add(al.remove(0), al.remove(0));
}
- return new MaxScoreQParser(q, p, new ModifiableSolrParams(), req(q)).parse();
+ return new MaxScoreQParser(q, p, new MapSolrParams(Collections.singletonMap("df", "text")), req(q)).parse();
} catch (SyntaxError syntaxError) {
fail("Failed with exception "+syntaxError.getMessage());
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test/org/apache/solr/search/TestReRankQParserPlugin.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/TestReRankQParserPlugin.java b/solr/core/src/test/org/apache/solr/search/TestReRankQParserPlugin.java
index 42d05e9..93cc294 100644
--- a/solr/core/src/test/org/apache/solr/search/TestReRankQParserPlugin.java
+++ b/solr/core/src/test/org/apache/solr/search/TestReRankQParserPlugin.java
@@ -91,6 +91,7 @@ public class TestReRankQParserPlugin extends SolrTestCaseJ4 {
params.add("bff", "field(test_ti)");
params.add("start", "0");
params.add("rows", "6");
+ params.add("df", "text");
assertQ(req(params), "*[count(//doc)=6]",
"//result/doc[1]/float[@name='id'][.='3.0']",
"//result/doc[2]/float[@name='id'][.='4.0']",
@@ -109,6 +110,7 @@ public class TestReRankQParserPlugin extends SolrTestCaseJ4 {
params.add("fl", "id,score");
params.add("start", "0");
params.add("rows", "10");
+ params.add("df", "text");
assertQ(req(params), "*[count(//doc)=6]",
"//result/doc[1]/float[@name='id'][.='2.0']",
@@ -130,6 +132,7 @@ public class TestReRankQParserPlugin extends SolrTestCaseJ4 {
params.add("start", "0");
params.add("rows", "10");
params.add("sort", "score desc");
+ params.add("df", "text");
assertQ(req(params), "*[count(//doc)=6]",
"//result/doc[1]/float[@name='id'][.='2.0']",
"//result/doc[2]/float[@name='id'][.='6.0']",
@@ -151,6 +154,7 @@ public class TestReRankQParserPlugin extends SolrTestCaseJ4 {
params.add("start", "0");
params.add("rows", "10");
params.add("sort", "score desc,test_ti asc");
+ params.add("df", "text");
assertQ(req(params), "*[count(//doc)=6]",
"//result/doc[1]/float[@name='id'][.='2.0']",
@@ -194,6 +198,7 @@ public class TestReRankQParserPlugin extends SolrTestCaseJ4 {
params.add("fl", "id,score");
params.add("start", "0");
params.add("rows", "10");
+ params.add("df", "text");
assertQ(req(params), "*[count(//doc)=6]",
"//result/doc[1]/float[@name='id'][.='2.0']",
@@ -548,6 +553,7 @@ public class TestReRankQParserPlugin extends SolrTestCaseJ4 {
params.add("fl", "id,score");
params.add("start", "0");
params.add("rows", "2");
+ params.add("df", "text");
assertQ(req(params), "*[count(//doc)=2]",
"//result/doc[1]/float[@name='id'][.='8.0']",
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test/org/apache/solr/search/TestSimpleQParserPlugin.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/TestSimpleQParserPlugin.java b/solr/core/src/test/org/apache/solr/search/TestSimpleQParserPlugin.java
index c06c648..0ce6179 100644
--- a/solr/core/src/test/org/apache/solr/search/TestSimpleQParserPlugin.java
+++ b/solr/core/src/test/org/apache/solr/search/TestSimpleQParserPlugin.java
@@ -63,8 +63,8 @@ public class TestSimpleQParserPlugin extends SolrTestCaseJ4 {
@Test
public void testDefaultField() throws Exception {
- assertJQ(req("defType", "simple", "q", "t2 t9 t12"), "/response/numFound==1");
- assertJQ(req("defType", "simple", "q", "t3"), "/response/numFound==0");
+ assertJQ(req("defType", "simple", "df", "text0", "q", "t2 t9 t12"), "/response/numFound==1");
+ assertJQ(req("defType", "simple", "df", "text0", "q", "t3"), "/response/numFound==0");
assertJQ(req("defType", "simple", "df", "text1", "q", "t2 t9 t12"), "/response/numFound==3");
assertJQ(req("defType", "simple", "df", "text1", "q", "t3"), "/response/numFound==1");
assertJQ(req("defType", "simple", "df", "text-keyword0", "q", "\"kw9 kw10 kw11\""), "/response/numFound==1");
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test/org/apache/solr/search/join/BlockJoinFacetRandomTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/join/BlockJoinFacetRandomTest.java b/solr/core/src/test/org/apache/solr/search/join/BlockJoinFacetRandomTest.java
index 4e6fdb1..1b04d79 100644
--- a/solr/core/src/test/org/apache/solr/search/join/BlockJoinFacetRandomTest.java
+++ b/solr/core/src/test/org/apache/solr/search/join/BlockJoinFacetRandomTest.java
@@ -196,6 +196,7 @@ public class BlockJoinFacetRandomTest extends SolrTestCaseJ4 {
BlockJoinFacetComponent.NO_TO_PARENT_BJQ_MESSAGE,
req(
"q", "t",
+ "df", "name",
"qt", handler,
BlockJoinFacetComponent.CHILD_FACET_FIELD_PARAMETER, facetFields[0]
),
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test/org/apache/solr/util/SolrPluginUtilsTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/util/SolrPluginUtilsTest.java b/solr/core/src/test/org/apache/solr/util/SolrPluginUtilsTest.java
index af85ad6..59795d8 100644
--- a/solr/core/src/test/org/apache/solr/util/SolrPluginUtilsTest.java
+++ b/solr/core/src/test/org/apache/solr/util/SolrPluginUtilsTest.java
@@ -35,6 +35,7 @@ import org.apache.lucene.search.TermQuery;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.search.QParser;
+import org.apache.solr.search.QueryParsing;
import org.apache.solr.util.SolrPluginUtils.DisjunctionMaxQueryParser;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -126,11 +127,11 @@ public class SolrPluginUtilsTest extends SolrTestCaseJ4 {
Query out;
String t;
- SolrQueryRequest req = req();
+ SolrQueryRequest req = req("df", "text");
QParser qparser = QParser.getParser("hi", "dismax", req);
DisjunctionMaxQueryParser qp =
- new SolrPluginUtils.DisjunctionMaxQueryParser(qparser, req.getSchema().getDefaultSearchFieldName());
+ new SolrPluginUtils.DisjunctionMaxQueryParser(qparser, QueryParsing.getDefaultField(req.getSchema(), req.getParams().get("df")));
qp.addAlias("hoss", 0.01f, SolrPluginUtils.parseFieldBoosts
("title^2.0 title_stemmed name^1.2 subject^0.5"));
@@ -147,7 +148,7 @@ public class SolrPluginUtilsTest extends SolrTestCaseJ4 {
assertTrue(t+" sanity test isn't TermQuery: " + out.getClass(),
out instanceof TermQuery);
assertEquals(t+" sanity test is wrong field",
- h.getCore().getLatestSchema().getDefaultSearchFieldName(),
+ qp.getDefaultField(),
((TermQuery)out).getTerm().field());
t = "subject:XXXXXXXX";
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/solrj/src/test-files/solrj/solr/collection1/conf/schema-sql.xml
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test-files/solrj/solr/collection1/conf/schema-sql.xml b/solr/solrj/src/test-files/solrj/solr/collection1/conf/schema-sql.xml
index 96bbcd8..da9ad08 100644
--- a/solr/solrj/src/test-files/solrj/solr/collection1/conf/schema-sql.xml
+++ b/solr/solrj/src/test-files/solrj/solr/collection1/conf/schema-sql.xml
@@ -616,7 +616,6 @@
<dynamicField name="*_sim3" type="sim3" indexed="true" stored="true"/>
-->
- <defaultSearchField>text</defaultSearchField>
<uniqueKey>id</uniqueKey>
<!-- copyField commands copy one field to another at the time a document
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/solrj/src/test-files/solrj/solr/collection1/conf/schema.xml
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test-files/solrj/solr/collection1/conf/schema.xml b/solr/solrj/src/test-files/solrj/solr/collection1/conf/schema.xml
index fb1a1ac..cd1422b 100644
--- a/solr/solrj/src/test-files/solrj/solr/collection1/conf/schema.xml
+++ b/solr/solrj/src/test-files/solrj/solr/collection1/conf/schema.xml
@@ -584,7 +584,6 @@
<dynamicField name="*_sim3" type="sim3" indexed="true" stored="true"/>
-->
- <defaultSearchField>text</defaultSearchField>
<uniqueKey>id</uniqueKey>
<!-- copyField commands copy one field to another at the time a document
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/solrj/src/test-files/solrj/solr/configsets/shared/conf/schema.xml
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test-files/solrj/solr/configsets/shared/conf/schema.xml b/solr/solrj/src/test-files/solrj/solr/configsets/shared/conf/schema.xml
index 21f0469..15fc982 100644
--- a/solr/solrj/src/test-files/solrj/solr/configsets/shared/conf/schema.xml
+++ b/solr/solrj/src/test-files/solrj/solr/configsets/shared/conf/schema.xml
@@ -57,8 +57,5 @@
<!-- field to use to determine and enforce document uniqueness. -->
<uniqueKey>id</uniqueKey>
-
- <!-- field for the QueryParser to use when an explicit fieldname is absent -->
- <defaultSearchField>name</defaultSearchField>
</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/solrj/src/test-files/solrj/solr/configsets/shared/conf/solrconfig.xml
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test-files/solrj/solr/configsets/shared/conf/solrconfig.xml b/solr/solrj/src/test-files/solrj/solr/configsets/shared/conf/solrconfig.xml
index eb91b03..0b34685 100644
--- a/solr/solrj/src/test-files/solrj/solr/configsets/shared/conf/solrconfig.xml
+++ b/solr/solrj/src/test-files/solrj/solr/configsets/shared/conf/solrconfig.xml
@@ -46,5 +46,11 @@
<defaultQuery>solr</defaultQuery>
</admin>
+ <initParams path="standard">
+ <lst name="defaults">
+ <str name="df">name</str>
+ </lst>
+ </initParams>
+
</config>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/solrj/src/test-files/solrj/solr/configsets/streaming/conf/schema.xml
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test-files/solrj/solr/configsets/streaming/conf/schema.xml b/solr/solrj/src/test-files/solrj/solr/configsets/streaming/conf/schema.xml
index a3b6a4e..f17da41 100644
--- a/solr/solrj/src/test-files/solrj/solr/configsets/streaming/conf/schema.xml
+++ b/solr/solrj/src/test-files/solrj/solr/configsets/streaming/conf/schema.xml
@@ -609,7 +609,6 @@
<dynamicField name="*_sim3" type="sim3" indexed="true" stored="true"/>
-->
- <defaultSearchField>text</defaultSearchField>
<uniqueKey>id</uniqueKey>
<!-- copyField commands copy one field to another at the time a document
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/solrj/src/test-files/solrj/solr/configsets/streaming/conf/solrconfig.xml
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test-files/solrj/solr/configsets/streaming/conf/solrconfig.xml b/solr/solrj/src/test-files/solrj/solr/configsets/streaming/conf/solrconfig.xml
index 6b10869..bb98650 100644
--- a/solr/solrj/src/test-files/solrj/solr/configsets/streaming/conf/solrconfig.xml
+++ b/solr/solrj/src/test-files/solrj/solr/configsets/streaming/conf/solrconfig.xml
@@ -40,12 +40,18 @@
<requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="2048" />
</requestDispatcher>
- <requestHandler name="standard" class="solr.StandardRequestHandler" default="true" />
+ <requestHandler name="standard" class="solr.StandardRequestHandler" default="true"/>
<!-- config for the admin interface -->
<admin>
<defaultQuery>solr</defaultQuery>
</admin>
+ <initParams path="standard">
+ <lst name="defaults">
+ <str name="df">text</str>
+ </lst>
+ </initParams>
+
</config>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/solrj/src/test-files/solrj/solr/crazy-path-to-schema.xml
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test-files/solrj/solr/crazy-path-to-schema.xml b/solr/solrj/src/test-files/solrj/solr/crazy-path-to-schema.xml
index 2404361..6901cd8 100644
--- a/solr/solrj/src/test-files/solrj/solr/crazy-path-to-schema.xml
+++ b/solr/solrj/src/test-files/solrj/solr/crazy-path-to-schema.xml
@@ -46,6 +46,5 @@ that just finds leaf <fieldType> and <field> nodes and there's no reason to brea
<field name="subject" type="text" indexed="true" stored="true"/>
</fields>
- <defaultSearchField>subject</defaultSearchField>
<uniqueKey>id</uniqueKey>
</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/solrj/src/test-files/solrj/solr/multicore/core0/conf/schema.xml
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test-files/solrj/solr/multicore/core0/conf/schema.xml b/solr/solrj/src/test-files/solrj/solr/multicore/core0/conf/schema.xml
index a724bd9..4899eab 100644
--- a/solr/solrj/src/test-files/solrj/solr/multicore/core0/conf/schema.xml
+++ b/solr/solrj/src/test-files/solrj/solr/multicore/core0/conf/schema.xml
@@ -29,8 +29,5 @@
<!-- field to use to determine and enforce document uniqueness. -->
<uniqueKey>id</uniqueKey>
-
- <!-- field for the QueryParser to use when an explicit fieldname is absent -->
- <defaultSearchField>name</defaultSearchField>
</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/solrj/src/test-files/solrj/solr/multicore/core0/conf/solrconfig.xml
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test-files/solrj/solr/multicore/core0/conf/solrconfig.xml b/solr/solrj/src/test-files/solrj/solr/multicore/core0/conf/solrconfig.xml
index b7f3692..e49a3b7 100644
--- a/solr/solrj/src/test-files/solrj/solr/multicore/core0/conf/solrconfig.xml
+++ b/solr/solrj/src/test-files/solrj/solr/multicore/core0/conf/solrconfig.xml
@@ -68,5 +68,11 @@
<defaultQuery>solr</defaultQuery>
</admin>
+ <initParams path="standard">
+ <lst name="defaults">
+ <str name="df">name</str>
+ </lst>
+ </initParams>
+
</config>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/solrj/src/test-files/solrj/solr/multicore/core1/conf/schema.xml
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test-files/solrj/solr/multicore/core1/conf/schema.xml b/solr/solrj/src/test-files/solrj/solr/multicore/core1/conf/schema.xml
index ecfc2af..260b106 100644
--- a/solr/solrj/src/test-files/solrj/solr/multicore/core1/conf/schema.xml
+++ b/solr/solrj/src/test-files/solrj/solr/multicore/core1/conf/schema.xml
@@ -30,8 +30,5 @@
<!-- field to use to determine and enforce document uniqueness. -->
<uniqueKey>id</uniqueKey>
-
- <!-- field for the QueryParser to use when an explicit fieldname is absent -->
- <defaultSearchField>name</defaultSearchField>
</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/solrj/src/test-files/solrj/solr/multicore/core1/conf/solrconfig.xml
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test-files/solrj/solr/multicore/core1/conf/solrconfig.xml b/solr/solrj/src/test-files/solrj/solr/multicore/core1/conf/solrconfig.xml
index 8d00095..825070a 100644
--- a/solr/solrj/src/test-files/solrj/solr/multicore/core1/conf/solrconfig.xml
+++ b/solr/solrj/src/test-files/solrj/solr/multicore/core1/conf/solrconfig.xml
@@ -68,5 +68,11 @@
<defaultQuery>solr</defaultQuery>
</admin>
+ <initParams path="standard">
+ <lst name="defaults">
+ <str name="df">name</str>
+ </lst>
+ </initParams>
+
</config>
[21/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10426: Add shuffle
Streaming Expression
Posted by tf...@apache.org.
SOLR-10426: Add shuffle Streaming Expression
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/a0fc9433
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/a0fc9433
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/a0fc9433
Branch: refs/heads/jira/solr-10233
Commit: a0fc9433240ae45878930c87abb58b1bf66f96e7
Parents: 8bfe70f
Author: Joel Bernstein <jb...@apache.org>
Authored: Fri May 5 13:32:33 2017 -0400
Committer: Joel Bernstein <jb...@apache.org>
Committed: Fri May 5 13:32:33 2017 -0400
----------------------------------------------------------------------
solr/CHANGES.txt | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a0fc9433/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 710274f..c30cebe 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -213,6 +213,8 @@ New Features
* SOLR-10351: Add analyze Stream Evaluator to support streaming NLP (Joel Bernstein)
+* SOLR-10426: Add shuffle Streaming Expression (Joel Bernstein)
+
Optimizations
----------------------
[40/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10626: Update
CHANGES.txt
Posted by tf...@apache.org.
SOLR-10626: Update 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/34c6c995
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/34c6c995
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/34c6c995
Branch: refs/heads/jira/solr-10233
Commit: 34c6c9956dd4d0e3312ffb12a9a63facc4d6ad80
Parents: c6524c3
Author: Joel Bernstein <jb...@apache.org>
Authored: Sun May 7 21:02:41 2017 -0400
Committer: Joel Bernstein <jb...@apache.org>
Committed: Sun May 7 21:02:41 2017 -0400
----------------------------------------------------------------------
solr/CHANGES.txt | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/34c6c995/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 828b7fb..01d7b2c 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -236,6 +236,8 @@ New Features
* SOLR-10622: Add regress and predict Stream Evaluators (Joel Bernstein)
+* SOLR-10626: Add covariance Stream Evaluator (Joel Bernstein)
+
Optimizations
----------------------
[42/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10524: Explore
in-memory partitioning for processing Overseer queue messages
Posted by tf...@apache.org.
SOLR-10524: Explore in-memory partitioning for processing Overseer queue messages
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/20c48868
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/20c48868
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/20c48868
Branch: refs/heads/jira/solr-10233
Commit: 20c4886816ceae96af9d99a5e99f5cd9037d8ef4
Parents: 37df644
Author: Cao Manh Dat <da...@apache.org>
Authored: Mon May 8 16:21:19 2017 +0700
Committer: Cao Manh Dat <da...@apache.org>
Committed: Mon May 8 16:21:19 2017 +0700
----------------------------------------------------------------------
solr/CHANGES.txt | 2 ++
.../core/src/java/org/apache/solr/cloud/Overseer.java | 3 ++-
.../org/apache/solr/cloud/overseer/ZkStateWriter.java | 14 ++------------
3 files changed, 6 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/20c48868/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 7f81344..118d629 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -254,6 +254,8 @@ Optimizations
* SOLR-10548: JSON Facet API now uses hyper-log-log++ for determining the number of buckets
when merging requests from a multi-shard distributed request. (yonik)
+* SOLR-10524: Explore in-memory partitioning for processing Overseer queue messages (Cao Manh Dat, Noble Paul, shalin, Scott Blum)
+
Bug Fixes
----------------------
* SOLR-10281: ADMIN_PATHS is duplicated in two places and inconsistent. This can cause automatic
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/20c48868/solr/core/src/java/org/apache/solr/cloud/Overseer.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/cloud/Overseer.java b/solr/core/src/java/org/apache/solr/cloud/Overseer.java
index f97fbac..9919e06 100644
--- a/solr/core/src/java/org/apache/solr/cloud/Overseer.java
+++ b/solr/core/src/java/org/apache/solr/cloud/Overseer.java
@@ -64,7 +64,8 @@ import static org.apache.solr.common.params.CommonParams.ID;
public class Overseer implements Closeable {
public static final String QUEUE_OPERATION = "operation";
- public static final int STATE_UPDATE_DELAY = 1500; // delay between cloud state updates
+ public static final int STATE_UPDATE_DELAY = 2000; // delay between cloud state updates
+ public static final int STATE_UPDATE_BATCH_SIZE = 10000;
public static final int NUM_RESPONSES_TO_STORE = 10000;
public static final String OVERSEER_ELECT = "/overseer_elect";
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/20c48868/solr/core/src/java/org/apache/solr/cloud/overseer/ZkStateWriter.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/cloud/overseer/ZkStateWriter.java b/solr/core/src/java/org/apache/solr/cloud/overseer/ZkStateWriter.java
index 23fb56c..48d2ecb 100644
--- a/solr/core/src/java/org/apache/solr/cloud/overseer/ZkStateWriter.java
+++ b/solr/core/src/java/org/apache/solr/cloud/overseer/ZkStateWriter.java
@@ -166,17 +166,7 @@ public class ZkStateWriter {
* @return true if a flush is required, false otherwise
*/
protected boolean maybeFlushBefore(ZkWriteCommand cmd) {
- if (lastUpdatedTime == 0) {
- // first update, make sure we go through
- return false;
- }
- if (cmd.collection == null) {
- return false;
- }
- if (cmd.collection.getStateFormat() != lastStateFormat) {
- return true;
- }
- return cmd.collection.getStateFormat() > 1 && !cmd.name.equals(lastCollectionName);
+ return cmd.collection.getStateFormat() != lastStateFormat;
}
/**
@@ -190,7 +180,7 @@ public class ZkStateWriter {
return false;
lastCollectionName = cmd.name;
lastStateFormat = cmd.collection.getStateFormat();
- return System.nanoTime() - lastUpdatedTime > MAX_FLUSH_INTERVAL;
+ return System.nanoTime() - lastUpdatedTime > MAX_FLUSH_INTERVAL || updates.size() > Overseer.STATE_UPDATE_BATCH_SIZE;
}
public boolean hasPendingUpdates() {
[12/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10607: Improve
RTimerTree documentation
Posted by tf...@apache.org.
SOLR-10607: Improve RTimerTree documentation
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/2af2b55e
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/2af2b55e
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/2af2b55e
Branch: refs/heads/jira/solr-10233
Commit: 2af2b55e2da6894df67c28e52ba8ba47a74d7c06
Parents: 5eb4a8d
Author: Erick Erickson <er...@apache.org>
Authored: Thu May 4 08:10:30 2017 -0700
Committer: Erick Erickson <er...@apache.org>
Committed: Thu May 4 08:10:46 2017 -0700
----------------------------------------------------------------------
solr/core/src/java/org/apache/solr/util/RTimerTree.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/2af2b55e/solr/core/src/java/org/apache/solr/util/RTimerTree.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/util/RTimerTree.java b/solr/core/src/java/org/apache/solr/util/RTimerTree.java
index e4d0021..7e27669 100644
--- a/solr/core/src/java/org/apache/solr/util/RTimerTree.java
+++ b/solr/core/src/java/org/apache/solr/util/RTimerTree.java
@@ -51,9 +51,10 @@ public class RTimerTree extends RTimer {
return new RTimerTree();
}
- /** Create new subtimer with given name
- *
- * Subtimer will be started.
+ /**
+ * Returns a subtimer given its name.
+ * If the subtimer did not exist a new subtimer will be started and returned,
+ * otherwise an existing subtimer will be returned as-is.
*/
public RTimerTree sub(String desc) {
RTimerTree child = children.get( desc );
[20/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10351: Update
CHANGES.txt
Posted by tf...@apache.org.
SOLR-10351: Update 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/8bfe70fb
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/8bfe70fb
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/8bfe70fb
Branch: refs/heads/jira/solr-10233
Commit: 8bfe70fbeaf8bbea5d60b9ecb81c6cbc9924dea0
Parents: 867e816
Author: Joel Bernstein <jb...@apache.org>
Authored: Fri May 5 13:24:59 2017 -0400
Committer: Joel Bernstein <jb...@apache.org>
Committed: Fri May 5 13:24:59 2017 -0400
----------------------------------------------------------------------
solr/CHANGES.txt | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8bfe70fb/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 0b62be4..710274f 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -211,6 +211,7 @@ New Features
* SOLR-10303: Add date/time Stream Evaluators (Gethin James, Dennis Gove, Joel Bernstein)
+* SOLR-10351: Add analyze Stream Evaluator to support streaming NLP (Joel Bernstein)
Optimizations
----------------------
[09/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-9867: make sure
cores are assigned in the end of SolrDispatchFilter.createCoreContainer()
only
Posted by tf...@apache.org.
SOLR-9867: make sure cores are assigned in the end of SolrDispatchFilter.createCoreContainer() only
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/30f1422b
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/30f1422b
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/30f1422b
Branch: refs/heads/jira/solr-10233
Commit: 30f1422ba955a38c37b1ec97244ebb7ede9ee7be
Parents: 32b7791
Author: Mikhail Khludnev <mk...@apache.org>
Authored: Thu May 4 15:45:14 2017 +0300
Committer: Mikhail Khludnev <mk...@apache.org>
Committed: Thu May 4 15:45:14 2017 +0300
----------------------------------------------------------------------
solr/CHANGES.txt | 2 +-
.../src/java/org/apache/solr/servlet/SolrDispatchFilter.java | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/30f1422b/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index ab023cc..ddf694a 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -333,7 +333,7 @@ Other Changes
* SOLR-10519: SolrCLI.atPath cannot handle children that begin with a slash. (Erick Erickson)
* SOLR-9867: Adding isLoading=true as core status. Fixing start after stop scenario in bin/solr
- (Mikhail Khludnev)
+ (Andrey Kudryavtsev, Mikhail Khludnev)
================== 6.5.1 ==================
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/30f1422b/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java b/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
index 02b0460..c4e0d0d 100644
--- a/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
+++ b/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
@@ -247,9 +247,9 @@ public class SolrDispatchFilter extends BaseSolrFilter {
*/
protected CoreContainer createCoreContainer(Path solrHome, Properties extraProperties) {
NodeConfig nodeConfig = loadNodeConfig(solrHome, extraProperties);
- cores = new CoreContainer(nodeConfig, extraProperties, true);
- cores.load();
- return cores;
+ CoreContainer coreContainer = new CoreContainer(nodeConfig, extraProperties, true);
+ coreContainer.load();
+ return coreContainer;
}
/**
[44/50] [abbrv] lucene-solr:jira/solr-10233: Fixed nsToMs calculation
in OverseerTest
Posted by tf...@apache.org.
Fixed nsToMs calculation in OverseerTest
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/a04d9c19
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/a04d9c19
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/a04d9c19
Branch: refs/heads/jira/solr-10233
Commit: a04d9c1963bf3a04d4c5c1cb5c4c0e34a2347d3d
Parents: 54061ed
Author: Shalin Shekhar Mangar <sh...@apache.org>
Authored: Mon May 8 16:11:01 2017 +0530
Committer: Shalin Shekhar Mangar <sh...@apache.org>
Committed: Mon May 8 16:11:01 2017 +0530
----------------------------------------------------------------------
solr/core/src/test/org/apache/solr/cloud/OverseerTest.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a04d9c19/solr/core/src/test/org/apache/solr/cloud/OverseerTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/OverseerTest.java b/solr/core/src/test/org/apache/solr/cloud/OverseerTest.java
index b0721a2..2d327a2 100644
--- a/solr/core/src/test/org/apache/solr/cloud/OverseerTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/OverseerTest.java
@@ -1083,7 +1083,7 @@ public class OverseerTest extends SolrTestCaseJ4 {
}
private static long nsToMs(double ns) {
- return TimeUnit.NANOSECONDS.convert((long)ns, TimeUnit.MILLISECONDS);
+ return TimeUnit.MILLISECONDS.convert((long)ns, TimeUnit.NANOSECONDS);
}
private void close(MockZKController mockController) {
[16/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-9867: @Ignore
TestSolrCLIRunExample.testTechproductsExample()
Posted by tf...@apache.org.
SOLR-9867: @Ignore TestSolrCLIRunExample.testTechproductsExample()
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/c6ebee6a
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/c6ebee6a
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/c6ebee6a
Branch: refs/heads/jira/solr-10233
Commit: c6ebee6a49e82f53090adf95836996ffecf0bb1c
Parents: e776cbe
Author: Mikhail Khludnev <mk...@apache.org>
Authored: Fri May 5 02:17:44 2017 +0300
Committer: Mikhail Khludnev <mk...@apache.org>
Committed: Fri May 5 02:20:17 2017 +0300
----------------------------------------------------------------------
.../core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c6ebee6a/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java b/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
index 6bce8226..8e30b3b 100644
--- a/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
+++ b/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
@@ -50,6 +50,7 @@ import org.apache.solr.common.SolrInputDocument;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.BeforeClass;
+import org.junit.Ignore;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -297,7 +298,7 @@ public class TestSolrCLIRunExample extends SolrTestCaseJ4 {
}
}
- @Test
+ @Test @Ignore
public void testTechproductsExample() throws Exception {
testExample("techproducts");
}
[11/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-9867: fixing
JvmMetricsTest broken earlier,
bring back testTechproductsExample() and single SDF.cores assignment.
Posted by tf...@apache.org.
SOLR-9867: fixing JvmMetricsTest broken earlier, bring back testTechproductsExample()
and single SDF.cores assignment.
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/5eb4a8d7
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/5eb4a8d7
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/5eb4a8d7
Branch: refs/heads/jira/solr-10233
Commit: 5eb4a8d71b491ca7f389b4dc7414dbc1a2620ae2
Parents: 1534b62
Author: Mikhail Khludnev <mk...@apache.org>
Authored: Thu May 4 17:18:24 2017 +0300
Committer: Mikhail Khludnev <mk...@apache.org>
Committed: Thu May 4 17:21:38 2017 +0300
----------------------------------------------------------------------
.../org/apache/solr/servlet/SolrDispatchFilter.java | 14 +++++++-------
.../org/apache/solr/util/TestSolrCLIRunExample.java | 3 +--
2 files changed, 8 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5eb4a8d7/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java b/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
index 02b0460..a4c9504 100644
--- a/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
+++ b/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
@@ -172,7 +172,7 @@ public class SolrDispatchFilter extends BaseSolrFilter {
coresInit = createCoreContainer(solrHome == null ? SolrResourceLoader.locateSolrHome() : Paths.get(solrHome),
extraProperties);
this.httpClient = coresInit.getUpdateShardHandler().getHttpClient();
- setupJvmMetrics();
+ setupJvmMetrics(coresInit);
log.debug("user.dir=" + System.getProperty("user.dir"));
}
catch( Throwable t ) {
@@ -190,9 +190,9 @@ public class SolrDispatchFilter extends BaseSolrFilter {
}
}
- private void setupJvmMetrics() {
- SolrMetricManager metricManager = cores.getMetricManager();
- final Set<String> hiddenSysProps = cores.getConfig().getHiddenSysProps();
+ private void setupJvmMetrics(CoreContainer coresInit) {
+ SolrMetricManager metricManager = coresInit.getMetricManager();
+ final Set<String> hiddenSysProps = coresInit.getConfig().getHiddenSysProps();
try {
String registry = SolrMetricManager.getRegistryName(SolrInfoBean.Group.jvm);
metricManager.registerAll(registry, new AltBufferPoolMetricSet(), true, "buffers");
@@ -247,9 +247,9 @@ public class SolrDispatchFilter extends BaseSolrFilter {
*/
protected CoreContainer createCoreContainer(Path solrHome, Properties extraProperties) {
NodeConfig nodeConfig = loadNodeConfig(solrHome, extraProperties);
- cores = new CoreContainer(nodeConfig, extraProperties, true);
- cores.load();
- return cores;
+ final CoreContainer coreContainer = new CoreContainer(nodeConfig, extraProperties, true);
+ coreContainer.load();
+ return coreContainer;
}
/**
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5eb4a8d7/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java b/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
index 86790c8..6bce8226 100644
--- a/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
+++ b/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
@@ -50,7 +50,6 @@ import org.apache.solr.common.SolrInputDocument;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.BeforeClass;
-import org.junit.Ignore;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -297,7 +296,7 @@ public class TestSolrCLIRunExample extends SolrTestCaseJ4 {
closeables = null;
}
}
- @Ignore
+
@Test
public void testTechproductsExample() throws Exception {
testExample("techproducts");
[07/50] [abbrv] lucene-solr:jira/solr-10233: added extra check if it
is a liveNode
Posted by tf...@apache.org.
added extra check if it is a liveNode
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/e912b7cb
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/e912b7cb
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/e912b7cb
Branch: refs/heads/jira/solr-10233
Commit: e912b7cb5c68fbb87b874d41068cf5a3aea17da0
Parents: 3a7aedc
Author: Noble Paul <no...@apache.org>
Authored: Thu May 4 15:13:01 2017 +0930
Committer: Noble Paul <no...@apache.org>
Committed: Thu May 4 15:13:01 2017 +0930
----------------------------------------------------------------------
.../src/java/org/apache/solr/security/PKIAuthenticationPlugin.java | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e912b7cb/solr/core/src/java/org/apache/solr/security/PKIAuthenticationPlugin.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/security/PKIAuthenticationPlugin.java b/solr/core/src/java/org/apache/solr/security/PKIAuthenticationPlugin.java
index fcc0560..172659a 100644
--- a/solr/core/src/java/org/apache/solr/security/PKIAuthenticationPlugin.java
+++ b/solr/core/src/java/org/apache/solr/security/PKIAuthenticationPlugin.java
@@ -193,6 +193,7 @@ public class PKIAuthenticationPlugin extends AuthenticationPlugin implements Htt
}
PublicKey getRemotePublicKey(String nodename) {
+ if (!cores.getZkController().getZkStateReader().getClusterState().getLiveNodes().contains(nodename)) return null;
String url = cores.getZkController().getZkStateReader().getBaseUrlForNodeName(nodename);
try {
String uri = url + PATH + "?wt=json&omitHeader=true";
[06/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10596: fix
unique/hll docvalue iterator reuse
Posted by tf...@apache.org.
SOLR-10596: fix unique/hll docvalue iterator reuse
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/3a7aedce
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/3a7aedce
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/3a7aedce
Branch: refs/heads/jira/solr-10233
Commit: 3a7aedcef9a6c9f854508629759bcb9b766d2b08
Parents: 40c8ea4
Author: yonik <yo...@apache.org>
Authored: Wed May 3 23:04:33 2017 -0400
Committer: yonik <yo...@apache.org>
Committed: Wed May 3 23:04:33 2017 -0400
----------------------------------------------------------------------
.../solr/search/facet/FacetProcessor.java | 2 +-
.../org/apache/solr/search/facet/HLLAgg.java | 6 +++---
.../org/apache/solr/search/facet/SlotAcc.java | 2 +-
.../org/apache/solr/search/facet/UniqueAgg.java | 6 +++---
.../solr/search/facet/UniqueMultiDvSlotAcc.java | 21 +++++++++++++-------
.../search/facet/UniqueMultivaluedSlotAcc.java | 5 +++--
.../search/facet/UniqueSinglevaluedSlotAcc.java | 20 ++++++++++++++-----
.../apache/solr/search/facet/UniqueSlotAcc.java | 6 +++---
.../solr/search/facet/TestJsonFacets.java | 9 +++++++++
9 files changed, 52 insertions(+), 25 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/3a7aedce/solr/core/src/java/org/apache/solr/search/facet/FacetProcessor.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/search/facet/FacetProcessor.java b/solr/core/src/java/org/apache/solr/search/facet/FacetProcessor.java
index d5a4e23..27cdaec 100644
--- a/solr/core/src/java/org/apache/solr/search/facet/FacetProcessor.java
+++ b/solr/core/src/java/org/apache/solr/search/facet/FacetProcessor.java
@@ -312,7 +312,7 @@ public abstract class FacetProcessor<FacetRequestT extends FacetRequest> {
}
// note: only called by enum/stream prior to collect
- void resetStats() {
+ void resetStats() throws IOException {
countAcc.reset();
for (SlotAcc acc : accs) {
acc.reset();
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/3a7aedce/solr/core/src/java/org/apache/solr/search/facet/HLLAgg.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/search/facet/HLLAgg.java b/solr/core/src/java/org/apache/solr/search/facet/HLLAgg.java
index 28c95e8..80e2bc1 100644
--- a/solr/core/src/java/org/apache/solr/search/facet/HLLAgg.java
+++ b/solr/core/src/java/org/apache/solr/search/facet/HLLAgg.java
@@ -52,16 +52,16 @@ public class HLLAgg extends StrAggValueSource {
SchemaField sf = fcontext.qcontext.searcher().getSchema().getField(getArg());
if (sf.multiValued() || sf.getType().multiValuedFieldCache()) {
if (sf.hasDocValues()) {
- return new UniqueMultiDvSlotAcc(fcontext, getArg(), numSlots, fcontext.isShard() ? factory : null);
+ return new UniqueMultiDvSlotAcc(fcontext, sf, numSlots, fcontext.isShard() ? factory : null);
} else {
- return new UniqueMultivaluedSlotAcc(fcontext, getArg(), numSlots, fcontext.isShard() ? factory : null);
+ return new UniqueMultivaluedSlotAcc(fcontext, sf, numSlots, fcontext.isShard() ? factory : null);
}
} else {
if (sf.getType().getNumberType() != null) {
// always use hll here since we don't know how many values there are?
return new NumericAcc(fcontext, getArg(), numSlots);
} else {
- return new UniqueSinglevaluedSlotAcc(fcontext, getArg(), numSlots, fcontext.isShard() ? factory : null);
+ return new UniqueSinglevaluedSlotAcc(fcontext, sf, numSlots, fcontext.isShard() ? factory : null);
}
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/3a7aedce/solr/core/src/java/org/apache/solr/search/facet/SlotAcc.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/search/facet/SlotAcc.java b/solr/core/src/java/org/apache/solr/search/facet/SlotAcc.java
index 1d8aecb..f5cdf82 100644
--- a/solr/core/src/java/org/apache/solr/search/facet/SlotAcc.java
+++ b/solr/core/src/java/org/apache/solr/search/facet/SlotAcc.java
@@ -94,7 +94,7 @@ public abstract class SlotAcc implements Closeable {
}
}
- public abstract void reset();
+ public abstract void reset() throws IOException;
public abstract void resize(Resizer resizer);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/3a7aedce/solr/core/src/java/org/apache/solr/search/facet/UniqueAgg.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/search/facet/UniqueAgg.java b/solr/core/src/java/org/apache/solr/search/facet/UniqueAgg.java
index 4cdfe02..4775e5f 100644
--- a/solr/core/src/java/org/apache/solr/search/facet/UniqueAgg.java
+++ b/solr/core/src/java/org/apache/solr/search/facet/UniqueAgg.java
@@ -43,15 +43,15 @@ public class UniqueAgg extends StrAggValueSource {
SchemaField sf = fcontext.qcontext.searcher().getSchema().getField(getArg());
if (sf.multiValued() || sf.getType().multiValuedFieldCache()) {
if (sf.hasDocValues()) {
- return new UniqueMultiDvSlotAcc(fcontext, getArg(), numSlots, null);
+ return new UniqueMultiDvSlotAcc(fcontext, sf, numSlots, null);
} else {
- return new UniqueMultivaluedSlotAcc(fcontext, getArg(), numSlots, null);
+ return new UniqueMultivaluedSlotAcc(fcontext, sf, numSlots, null);
}
} else {
if (sf.getType().getNumberType() != null) {
return new NumericAcc(fcontext, getArg(), numSlots);
} else {
- return new UniqueSinglevaluedSlotAcc(fcontext, getArg(), numSlots, null);
+ return new UniqueSinglevaluedSlotAcc(fcontext, sf, numSlots, null);
}
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/3a7aedce/solr/core/src/java/org/apache/solr/search/facet/UniqueMultiDvSlotAcc.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/search/facet/UniqueMultiDvSlotAcc.java b/solr/core/src/java/org/apache/solr/search/facet/UniqueMultiDvSlotAcc.java
index 72a88ca..65fa81a 100644
--- a/solr/core/src/java/org/apache/solr/search/facet/UniqueMultiDvSlotAcc.java
+++ b/solr/core/src/java/org/apache/solr/search/facet/UniqueMultiDvSlotAcc.java
@@ -25,19 +25,23 @@ import org.apache.lucene.index.SortedSetDocValues;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.FixedBitSet;
import org.apache.lucene.util.LongValues;
-import org.apache.solr.search.SolrIndexSearcher;
+import org.apache.solr.schema.SchemaField;
class UniqueMultiDvSlotAcc extends UniqueSlotAcc {
- final SortedSetDocValues topLevel;
- final SortedSetDocValues[] subDvs;
- final MultiDocValues.OrdinalMap ordMap;
+ SortedSetDocValues topLevel;
+ SortedSetDocValues[] subDvs;
+ MultiDocValues.OrdinalMap ordMap;
LongValues toGlobal;
SortedSetDocValues subDv;
- public UniqueMultiDvSlotAcc(FacetContext fcontext, String field, int numSlots, HLLAgg.HLLFactory factory) throws IOException {
+ public UniqueMultiDvSlotAcc(FacetContext fcontext, SchemaField field, int numSlots, HLLAgg.HLLFactory factory) throws IOException {
super(fcontext, field, numSlots, factory);
- SolrIndexSearcher searcher = fcontext.qcontext.searcher();
- topLevel = FieldUtil.getSortedSetDocValues(fcontext.qcontext, searcher.getSchema().getField(field), null);
+ }
+
+ @Override
+ public void reset() throws IOException {
+ super.reset();
+ topLevel = FieldUtil.getSortedSetDocValues(fcontext.qcontext, field, null);
nTerms = (int) topLevel.getValueCount();
if (topLevel instanceof MultiDocValues.MultiSortedSetDocValues) {
ordMap = ((MultiDocValues.MultiSortedSetDocValues) topLevel).mapping;
@@ -55,6 +59,9 @@ class UniqueMultiDvSlotAcc extends UniqueSlotAcc {
@Override
public void setNextReader(LeafReaderContext readerContext) throws IOException {
+ if (topLevel == null) {
+ reset();
+ }
super.setNextReader(readerContext);
if (subDvs != null) {
subDv = subDvs[readerContext.ord];
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/3a7aedce/solr/core/src/java/org/apache/solr/search/facet/UniqueMultivaluedSlotAcc.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/search/facet/UniqueMultivaluedSlotAcc.java b/solr/core/src/java/org/apache/solr/search/facet/UniqueMultivaluedSlotAcc.java
index 56a498e..10adcf0 100644
--- a/solr/core/src/java/org/apache/solr/search/facet/UniqueMultivaluedSlotAcc.java
+++ b/solr/core/src/java/org/apache/solr/search/facet/UniqueMultivaluedSlotAcc.java
@@ -21,16 +21,17 @@ import java.io.IOException;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.FixedBitSet;
+import org.apache.solr.schema.SchemaField;
import org.apache.solr.search.SolrIndexSearcher;
class UniqueMultivaluedSlotAcc extends UniqueSlotAcc implements UnInvertedField.Callback {
private UnInvertedField uif;
private UnInvertedField.DocToTerm docToTerm;
- public UniqueMultivaluedSlotAcc(FacetContext fcontext, String field, int numSlots, HLLAgg.HLLFactory factory) throws IOException {
+ public UniqueMultivaluedSlotAcc(FacetContext fcontext, SchemaField field, int numSlots, HLLAgg.HLLFactory factory) throws IOException {
super(fcontext, field, numSlots, factory);
SolrIndexSearcher searcher = fcontext.qcontext.searcher();
- uif = UnInvertedField.getUnInvertedField(field, searcher);
+ uif = UnInvertedField.getUnInvertedField(field.getName(), searcher);
docToTerm = uif.new DocToTerm();
fcontext.qcontext.addCloseHook(this); // TODO: find way to close accumulators instead of using close hook?
nTerms = uif.numTerms();
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/3a7aedce/solr/core/src/java/org/apache/solr/search/facet/UniqueSinglevaluedSlotAcc.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/search/facet/UniqueSinglevaluedSlotAcc.java b/solr/core/src/java/org/apache/solr/search/facet/UniqueSinglevaluedSlotAcc.java
index e0a1852..b39f282 100644
--- a/solr/core/src/java/org/apache/solr/search/facet/UniqueSinglevaluedSlotAcc.java
+++ b/solr/core/src/java/org/apache/solr/search/facet/UniqueSinglevaluedSlotAcc.java
@@ -25,19 +25,26 @@ import org.apache.lucene.index.SortedDocValues;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.FixedBitSet;
import org.apache.lucene.util.LongValues;
+import org.apache.solr.schema.SchemaField;
import org.apache.solr.search.SolrIndexSearcher;
class UniqueSinglevaluedSlotAcc extends UniqueSlotAcc {
- final SortedDocValues topLevel;
- final SortedDocValues[] subDvs;
- final MultiDocValues.OrdinalMap ordMap;
+ SortedDocValues topLevel;
+ SortedDocValues[] subDvs;
+ MultiDocValues.OrdinalMap ordMap;
LongValues toGlobal;
SortedDocValues subDv;
- public UniqueSinglevaluedSlotAcc(FacetContext fcontext, String field, int numSlots, HLLAgg.HLLFactory factory) throws IOException {
+ public UniqueSinglevaluedSlotAcc(FacetContext fcontext, SchemaField field, int numSlots, HLLAgg.HLLFactory factory) throws IOException {
super(fcontext, field, numSlots, factory);
+ // let setNextReader lazily call reset(), that way an extra call to reset() after creation won't matter
+ }
+
+ @Override
+ public void reset() throws IOException {
+ super.reset();
SolrIndexSearcher searcher = fcontext.qcontext.searcher();
- topLevel = FieldUtil.getSortedDocValues(fcontext.qcontext, searcher.getSchema().getField(field), null);
+ topLevel = FieldUtil.getSortedDocValues(fcontext.qcontext, field, null);
nTerms = topLevel.getValueCount();
if (topLevel instanceof MultiDocValues.MultiSortedDocValues) {
ordMap = ((MultiDocValues.MultiSortedDocValues)topLevel).mapping;
@@ -55,6 +62,9 @@ class UniqueSinglevaluedSlotAcc extends UniqueSlotAcc {
@Override
public void setNextReader(LeafReaderContext readerContext) throws IOException {
+ if (topLevel == null) {
+ reset();
+ }
super.setNextReader(readerContext);
if (subDvs != null) {
subDv = subDvs[readerContext.ord];
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/3a7aedce/solr/core/src/java/org/apache/solr/search/facet/UniqueSlotAcc.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/search/facet/UniqueSlotAcc.java b/solr/core/src/java/org/apache/solr/search/facet/UniqueSlotAcc.java
index ae542ac..607b067 100644
--- a/solr/core/src/java/org/apache/solr/search/facet/UniqueSlotAcc.java
+++ b/solr/core/src/java/org/apache/solr/search/facet/UniqueSlotAcc.java
@@ -37,15 +37,15 @@ abstract class UniqueSlotAcc extends SlotAcc {
int[] counts; // populated with the cardinality once
int nTerms;
- public UniqueSlotAcc(FacetContext fcontext, String field, int numSlots, HLLAgg.HLLFactory factory) throws IOException {
+ public UniqueSlotAcc(FacetContext fcontext, SchemaField field, int numSlots, HLLAgg.HLLFactory factory) throws IOException {
super(fcontext);
this.factory = factory;
arr = new FixedBitSet[numSlots];
- this.field = fcontext.searcher.getSchema().getField(field);
+ this.field = field;
}
@Override
- public void reset() {
+ public void reset() throws IOException {
counts = null;
for (FixedBitSet bits : arr) {
if (bits == null) continue;
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/3a7aedce/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java b/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java
index 3f31cca..4fcee67 100644
--- a/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java
+++ b/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java
@@ -1360,6 +1360,15 @@ public class TestJsonFacets extends SolrTestCaseHS {
"}"
);
+ // test acc reuse (i.e. reset() method). This is normally used for stats that are not calculated in the first phase,
+ // currently non-sorting stats.
+ client.testJQ(params(p, "q", "*:*"
+ , "json.facet", "{f1:{type:terms, field:'${cat_s}', facet:{h:'hll(${where_s})'} }}"
+ )
+ , "facets=={ 'count':6, " +
+ "'f1':{ buckets:[{val:B, count:3, h:2},{val:A, count:2, h:2}] } } "
+ );
+
}
@Test
[05/50] [abbrv] lucene-solr:jira/solr-10233: LUCENE-7814:
DateRangePrefixTree bug in years >= 292M
Posted by tf...@apache.org.
LUCENE-7814: DateRangePrefixTree bug in years >= 292M
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/40c8ea4b
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/40c8ea4b
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/40c8ea4b
Branch: refs/heads/jira/solr-10233
Commit: 40c8ea4b1a82ffab841de87e236ecdb9483381e8
Parents: 15e1c5d
Author: David Smiley <ds...@apache.org>
Authored: Wed May 3 15:50:34 2017 -0400
Committer: David Smiley <ds...@apache.org>
Committed: Wed May 3 15:50:34 2017 -0400
----------------------------------------------------------------------
lucene/CHANGES.txt | 3 +++
.../lucene/spatial/prefix/tree/DateRangePrefixTree.java | 8 ++++----
.../apache/lucene/spatial/prefix/DateNRStrategyTest.java | 9 +++++++++
3 files changed, 16 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/40c8ea4b/lucene/CHANGES.txt
----------------------------------------------------------------------
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index c16c032..002eafc 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -109,6 +109,9 @@ Bug Fixes
* LUCENE-7798: Add .equals and .hashCode to ToParentBlockJoinSortField
(Mikhail Khludnev)
+* LUCENE-7814: DateRangePrefixTree (in spatial-extras ) had edge-case bugs for
+ years >= 292,000,000. (David Smiley)
+
Improvements
* LUCENE-7782: OfflineSorter now passes the total number of items it
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/40c8ea4b/lucene/spatial-extras/src/java/org/apache/lucene/spatial/prefix/tree/DateRangePrefixTree.java
----------------------------------------------------------------------
diff --git a/lucene/spatial-extras/src/java/org/apache/lucene/spatial/prefix/tree/DateRangePrefixTree.java b/lucene/spatial-extras/src/java/org/apache/lucene/spatial/prefix/tree/DateRangePrefixTree.java
index 4d3ef3b..cc47358 100644
--- a/lucene/spatial-extras/src/java/org/apache/lucene/spatial/prefix/tree/DateRangePrefixTree.java
+++ b/lucene/spatial-extras/src/java/org/apache/lucene/spatial/prefix/tree/DateRangePrefixTree.java
@@ -92,7 +92,7 @@ public class DateRangePrefixTree extends NumberRangePrefixTree {
private static final int YEAR_LEVEL = 3;
//how many million years are there?
- private static final int NUM_MYEARS = 585;// we assert how this was computed in the constructor
+ private static final int NUM_MYEARS = 586;// we assert how this was computed in the constructor
/** An instanced based on {@link Calendar#getInstance(TimeZone, Locale)} with UTC and Locale.Root. This
* will (always?) be a {@link GregorianCalendar} with a so-called "Gregorian Change Date" of 1582.
@@ -142,9 +142,9 @@ public class DateRangePrefixTree extends NumberRangePrefixTree {
BC_YEARS = BC_FIRSTYEAR - BC_LASTYEAR + 1;
AD_FIRSTYEAR = MAXCAL.getActualMinimum(Calendar.YEAR); // 1
AD_LASTYEAR = MAXCAL.getActualMaximum(Calendar.YEAR);
- AD_YEAR_BASE = (((BC_YEARS-1) / 1000_000)+1) * 1000_000;
+ AD_YEAR_BASE = (((BC_YEARS-1) / 1000_000)+1) * 1000_000; // align year 0 at an even # of million years
assert BC_LASTYEAR == 1 && AD_FIRSTYEAR == 1;
- assert NUM_MYEARS == (AD_YEAR_BASE + AD_LASTYEAR) / 1000_000;
+ assert NUM_MYEARS == (AD_YEAR_BASE + AD_LASTYEAR) / 1000_000 + 1;
maxLV = toShape((Calendar)MAXCAL.clone());
minLV = toShape((Calendar)MINCAL.clone());
@@ -165,7 +165,7 @@ public class DateRangePrefixTree extends NumberRangePrefixTree {
int cmp = comparePrefix(lv, maxLV);
assert cmp <= 0;
if (cmp == 0)//edge case (literally!)
- return maxLV.getValAtLevel(lv.getLevel()+1);
+ return maxLV.getValAtLevel(lv.getLevel()+1) + 1;
// if using GregorianCalendar and we're after the "Gregorian change date" then we'll compute
// the sub-cells ourselves more efficiently without the need to construct a Calendar.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/40c8ea4b/lucene/spatial-extras/src/test/org/apache/lucene/spatial/prefix/DateNRStrategyTest.java
----------------------------------------------------------------------
diff --git a/lucene/spatial-extras/src/test/org/apache/lucene/spatial/prefix/DateNRStrategyTest.java b/lucene/spatial-extras/src/test/org/apache/lucene/spatial/prefix/DateNRStrategyTest.java
index 9b93aac..77c2529 100644
--- a/lucene/spatial-extras/src/test/org/apache/lucene/spatial/prefix/DateNRStrategyTest.java
+++ b/lucene/spatial-extras/src/test/org/apache/lucene/spatial/prefix/DateNRStrategyTest.java
@@ -103,6 +103,15 @@ public class DateNRStrategyTest extends RandomSpatialOpStrategyTestCase {
tree.parseShape("[2014-04 TO 2014-04-01T02]"), true);
}
+ @Test
+ public void testLastMillionYearPeriod() throws Exception {
+ testOperation(
+ tree.parseShape("+292220922-05-17T18:01:57.572"), // a year in the last million year period (>=292M)
+ SpatialOperation.Intersects,
+ tree.parseShape("[1970 TO *]"), true
+ );
+ }
+
@Override
protected Shape randomIndexedShape() {
Calendar cal1 = randomCalendar();
[26/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10566: Update
CHANGES.txt
Posted by tf...@apache.org.
SOLR-10566: Update 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/554f6600
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/554f6600
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/554f6600
Branch: refs/heads/jira/solr-10233
Commit: 554f6600a0f2c6d18e9768f92c8c85c48a9ad5d7
Parents: a96f394
Author: Joel Bernstein <jb...@apache.org>
Authored: Fri May 5 14:27:46 2017 -0400
Committer: Joel Bernstein <jb...@apache.org>
Committed: Fri May 5 14:27:46 2017 -0400
----------------------------------------------------------------------
solr/CHANGES.txt | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/554f6600/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index ec4ebe2..ced0d3a 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -223,6 +223,8 @@ New Features
* SOLR-10516: Add eval Streaming Expression (Joel Bernstein)
+* SOLR-10566: Add timeseries Streaming Expression (Joel Bernstein)
+
Optimizations
----------------------
[19/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10303: Update
CHANGES.txt
Posted by tf...@apache.org.
SOLR-10303: Update 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/867e8167
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/867e8167
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/867e8167
Branch: refs/heads/jira/solr-10233
Commit: 867e81672a42f2a202382367e0e546947a5e4946
Parents: bcf3405
Author: Joel Bernstein <jb...@apache.org>
Authored: Fri May 5 13:14:15 2017 -0400
Committer: Joel Bernstein <jb...@apache.org>
Committed: Fri May 5 13:14:15 2017 -0400
----------------------------------------------------------------------
solr/CHANGES.txt | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/867e8167/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index ae1ed1f..0b62be4 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -209,6 +209,8 @@ New Features
* SOLR-9530: An Update Processor to convert normal update operation to an atomic operations such as
add, set,inc, remove ,set, removeregex (Amrit Sarkar, noble)
+* SOLR-10303: Add date/time Stream Evaluators (Gethin James, Dennis Gove, Joel Bernstein)
+
Optimizations
----------------------
[32/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10547: consolidate
MinAgg+MaxAgg, add min/max support for single valued string fields
Posted by tf...@apache.org.
SOLR-10547: consolidate MinAgg+MaxAgg, add min/max support for single valued string fields
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/b636d6e9
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/b636d6e9
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/b636d6e9
Branch: refs/heads/jira/solr-10233
Commit: b636d6e96a377e63bcd25c4bfa60920401100d5e
Parents: c02d490
Author: yonik <yo...@apache.org>
Authored: Sat May 6 05:49:19 2017 -0400
Committer: yonik <yo...@apache.org>
Committed: Sat May 6 05:52:15 2017 -0400
----------------------------------------------------------------------
solr/CHANGES.txt | 3 +
.../apache/solr/search/ValueSourceParser.java | 7 +-
.../org/apache/solr/search/facet/MaxAgg.java | 57 -----
.../org/apache/solr/search/facet/MinAgg.java | 54 -----
.../org/apache/solr/search/facet/MinMaxAgg.java | 236 +++++++++++++++++++
.../org/apache/solr/search/facet/SlotAcc.java | 34 ---
.../solr/search/facet/TestJsonFacets.java | 24 ++
7 files changed, 266 insertions(+), 149 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b636d6e9/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 38aac79..ff7bdcf 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -85,6 +85,9 @@ New Features
* SOLR-10046: Add UninvertDocValuesMergePolicyFactory class. (Keith Laban, Christine Poerschke)
+* SOLR-10547: JSON Facet API: Implement support for single-valued string fields for min/max aggregations.
+ (yonik)
+
Bug Fixes
----------------------
* SOLR-9262: Connection and read timeouts are being ignored by UpdateShardHandler after SOLR-4509.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b636d6e9/solr/core/src/java/org/apache/solr/search/ValueSourceParser.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/search/ValueSourceParser.java b/solr/core/src/java/org/apache/solr/search/ValueSourceParser.java
index b511656..517b86f 100644
--- a/solr/core/src/java/org/apache/solr/search/ValueSourceParser.java
+++ b/solr/core/src/java/org/apache/solr/search/ValueSourceParser.java
@@ -56,8 +56,7 @@ import org.apache.solr.search.facet.AggValueSource;
import org.apache.solr.search.facet.AvgAgg;
import org.apache.solr.search.facet.CountAgg;
import org.apache.solr.search.facet.HLLAgg;
-import org.apache.solr.search.facet.MaxAgg;
-import org.apache.solr.search.facet.MinAgg;
+import org.apache.solr.search.facet.MinMaxAgg;
import org.apache.solr.search.facet.PercentileAgg;
import org.apache.solr.search.facet.StddevAgg;
import org.apache.solr.search.facet.SumAgg;
@@ -1009,14 +1008,14 @@ public abstract class ValueSourceParser implements NamedListInitializedPlugin {
addParser("agg_min", new ValueSourceParser() {
@Override
public ValueSource parse(FunctionQParser fp) throws SyntaxError {
- return new MinAgg(fp.parseValueSource());
+ return new MinMaxAgg("min", fp.parseValueSource());
}
});
addParser("agg_max", new ValueSourceParser() {
@Override
public ValueSource parse(FunctionQParser fp) throws SyntaxError {
- return new MaxAgg(fp.parseValueSource());
+ return new MinMaxAgg("max", fp.parseValueSource());
}
});
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b636d6e9/solr/core/src/java/org/apache/solr/search/facet/MaxAgg.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/search/facet/MaxAgg.java b/solr/core/src/java/org/apache/solr/search/facet/MaxAgg.java
deleted file mode 100644
index a66e968..0000000
--- a/solr/core/src/java/org/apache/solr/search/facet/MaxAgg.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.solr.search.facet;
-
-import java.io.IOException;
-
-import org.apache.lucene.queries.function.ValueSource;
-
-
-public class MaxAgg extends SimpleAggValueSource {
- public MaxAgg(ValueSource vs) {
- super("max", vs);
- }
-
- @Override
- public SlotAcc createSlotAcc(FacetContext fcontext, int numDocs, int numSlots) throws IOException {
- return new MaxSlotAcc(getArg(), fcontext, numSlots);
- }
-
- @Override
- public FacetMerger createFacetMerger(Object prototype) {
- return new Merger();
- }
-
- private static class Merger extends FacetDoubleMerger {
- double val = Double.NaN;
-
- @Override
- public void merge(Object facetResult, Context mcontext) {
- double result = ((Number)facetResult).doubleValue();
- if (result > val || Double.isNaN(val)) {
- val = result;
- }
- }
-
- @Override
- protected double getDouble() {
- return val;
- }
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b636d6e9/solr/core/src/java/org/apache/solr/search/facet/MinAgg.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/search/facet/MinAgg.java b/solr/core/src/java/org/apache/solr/search/facet/MinAgg.java
deleted file mode 100644
index 72c7581..0000000
--- a/solr/core/src/java/org/apache/solr/search/facet/MinAgg.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.solr.search.facet;
-
-import java.io.IOException;
-
-import org.apache.lucene.queries.function.ValueSource;
-
-public class MinAgg extends SimpleAggValueSource {
- public MinAgg(ValueSource vs) {
- super("min", vs);
- }
-
- @Override
- public SlotAcc createSlotAcc(FacetContext fcontext, int numDocs, int numSlots) throws IOException {
- return new MinSlotAcc(getArg(), fcontext, numSlots);
- }
-
- @Override
- public FacetMerger createFacetMerger(Object prototype) {
- return new Merger();
- }
-
- private static class Merger extends FacetDoubleMerger {
- double val = Double.NaN;
-
- @Override
- public void merge(Object facetResult, Context mcontext) {
- double result = ((Number)facetResult).doubleValue();
- if (result < val || Double.isNaN(val)) {
- val = result;
- }
- }
-
- @Override
- protected double getDouble() {
- return val;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b636d6e9/solr/core/src/java/org/apache/solr/search/facet/MinMaxAgg.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/search/facet/MinMaxAgg.java b/solr/core/src/java/org/apache/solr/search/facet/MinMaxAgg.java
new file mode 100644
index 0000000..2c37863
--- /dev/null
+++ b/solr/core/src/java/org/apache/solr/search/facet/MinMaxAgg.java
@@ -0,0 +1,236 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.search.facet;
+
+import java.io.IOException;
+import java.util.Arrays;
+
+import org.apache.lucene.index.LeafReaderContext;
+import org.apache.lucene.index.MultiDocValues;
+import org.apache.lucene.index.SortedDocValues;
+import org.apache.lucene.queries.function.ValueSource;
+import org.apache.lucene.util.BytesRef;
+import org.apache.lucene.util.LongValues;
+import org.apache.solr.schema.SchemaField;
+import org.apache.solr.schema.StrFieldSource;
+
+public class MinMaxAgg extends SimpleAggValueSource {
+ final int minmax; // a multiplier to reverse the normal order of compare if this is max instead of min (i.e. max will be -1)
+
+ public MinMaxAgg(String minOrMax, ValueSource vs) {
+ super(minOrMax, vs);
+ minmax = "min".equals(name) ? 1 : -1;
+ }
+
+ @Override
+ public SlotAcc createSlotAcc(FacetContext fcontext, int numDocs, int numSlots) throws IOException {
+ ValueSource vs = getArg();
+
+ if (vs instanceof StrFieldSource) {
+ String field = ((StrFieldSource) vs).getField();
+ SchemaField sf = fcontext.qcontext.searcher().getSchema().getField(field);
+ if (sf.multiValued() || sf.getType().multiValuedFieldCache()) {
+ if (sf.hasDocValues()) {
+ // dv
+ } else {
+ // uif
+ }
+ } else {
+ return new SingleValuedOrdAcc(fcontext, sf, numSlots);
+ }
+ }
+
+ // numeric functions
+ return new ValSlotAcc(vs, fcontext, numSlots);
+ }
+
+ @Override
+ public FacetMerger createFacetMerger(Object prototype) {
+ if (prototype instanceof Number)
+ return new NumericMerger();
+ else if (prototype instanceof Comparable) {
+ return new ComparableMerger();
+ } else {
+ throw new UnsupportedOperationException("min/max merge of " + prototype);
+ }
+ }
+
+ // TODO: can this be replaced by ComparableMerger?
+ private class NumericMerger extends FacetDoubleMerger {
+ double val = Double.NaN;
+
+ @Override
+ public void merge(Object facetResult, Context mcontext) {
+ double result = ((Number)facetResult).doubleValue();
+ if (Double.compare(result, val)*minmax < 0 || Double.isNaN(val)) {
+ val = result;
+ }
+ }
+
+ @Override
+ protected double getDouble() {
+ return val;
+ }
+ }
+
+ private class ComparableMerger extends FacetSortableMerger {
+ Comparable val;
+ @Override
+ public void merge(Object facetResult, Context mcontext) {
+ Comparable other = (Comparable)facetResult;
+ if (val == null) {
+ val = other;
+ } else {
+ if ( other.compareTo(val) * minmax < 0 ) {
+ val = other;
+ }
+ }
+ }
+
+ @Override
+ public Object getMergedResult() {
+ return val;
+ }
+
+ @Override
+ public int compareTo(FacetSortableMerger other, FacetRequest.SortDirection direction) {
+ // NOTE: we don't use the minmax multiplier here because we still want natural ordering between slots (i.e. min(field) asc and max(field) asc) both sort "A" before "Z")
+ return this.val.compareTo(((ComparableMerger)other).val);
+ }
+ }
+
+ class ValSlotAcc extends DoubleFuncSlotAcc {
+ public ValSlotAcc(ValueSource values, FacetContext fcontext, int numSlots) {
+ super(values, fcontext, numSlots, Double.NaN);
+ }
+
+ @Override
+ public void collect(int doc, int slotNum) throws IOException {
+ double val = values.doubleVal(doc);
+ if (val == 0 && !values.exists(doc)) return; // depend on fact that non existing values return 0 for func query
+
+ double currVal = result[slotNum];
+ if (Double.compare(val, currVal) * minmax < 0 || Double.isNaN(currVal)) {
+ result[slotNum] = val;
+ }
+ }
+ }
+
+
+ abstract class OrdAcc extends SlotAcc {
+ final static int MISSING = -1;
+ SchemaField field;
+ int[] slotOrd;
+
+ public OrdAcc(FacetContext fcontext, SchemaField field, int numSlots) throws IOException {
+ super(fcontext);
+ this.field = field;
+ slotOrd = new int[numSlots];
+ if (MISSING != 0) Arrays.fill(slotOrd, MISSING);
+ }
+
+ abstract BytesRef lookupOrd(int ord) throws IOException;
+
+ @Override
+ public int compare(int slotA, int slotB) {
+ int a = slotOrd[slotA];
+ int b = slotOrd[slotB];
+ // NOTE: we don't use the minmax multiplier here because we still want natural ordering between slots (i.e. min(field) asc and max(field) asc) both sort "A" before "Z")
+ return a - b; // TODO: we probably want sort-missing-last functionality
+ }
+
+ @Override
+ public Object getValue(int slotNum) throws IOException {
+ int globOrd = slotOrd[slotNum];
+ if (globOrd == MISSING) return null;
+ BytesRef term = lookupOrd(globOrd);
+ return field.getType().toObject(field, term);
+ }
+
+ @Override
+ public void reset() throws IOException {
+ Arrays.fill(slotOrd, MISSING);
+ }
+
+ @Override
+ public void resize(Resizer resizer) {
+ slotOrd = resizer.resize(slotOrd, MISSING);
+ }
+ }
+
+
+ class SingleValuedOrdAcc extends OrdAcc {
+ SortedDocValues topLevel;
+ SortedDocValues[] subDvs;
+ MultiDocValues.OrdinalMap ordMap;
+ LongValues toGlobal;
+ SortedDocValues subDv;
+
+ public SingleValuedOrdAcc(FacetContext fcontext, SchemaField field, int numSlots) throws IOException {
+ super(fcontext, field, numSlots);
+ }
+
+ @Override
+ public void reset() throws IOException {
+ super.reset();
+ topLevel = FieldUtil.getSortedDocValues(fcontext.qcontext, field, null);
+ if (topLevel instanceof MultiDocValues.MultiSortedDocValues) {
+ ordMap = ((MultiDocValues.MultiSortedDocValues)topLevel).mapping;
+ subDvs = ((MultiDocValues.MultiSortedDocValues)topLevel).values;
+ } else {
+ ordMap = null;
+ subDvs = null;
+ }
+ }
+
+ @Override
+ protected BytesRef lookupOrd(int ord) throws IOException {
+ return topLevel.lookupOrd(ord);
+ }
+
+ @Override
+ public void setNextReader(LeafReaderContext readerContext) throws IOException {
+ if (topLevel == null) {
+ reset();
+ }
+ super.setNextReader(readerContext);
+ if (subDvs != null) {
+ subDv = subDvs[readerContext.ord];
+ toGlobal = ordMap.getGlobalOrds(readerContext.ord);
+ } else {
+ assert readerContext.ord==0 || topLevel.getValueCount() == 0;
+ subDv = topLevel;
+ }
+ }
+
+ @Override
+ public void collect(int doc, int slotNum) throws IOException {
+ if (doc > subDv.docID()) {
+ subDv.advance(doc);
+ }
+ if (doc == subDv.docID()) {
+ int segOrd = subDv.ordValue();
+ int ord = toGlobal==null ? segOrd : (int)toGlobal.get(segOrd);
+ if ((ord - slotOrd[slotNum]) * minmax < 0 || slotOrd[slotNum]==MISSING) {
+ slotOrd[slotNum] = ord;
+ }
+ }
+ }
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b636d6e9/solr/core/src/java/org/apache/solr/search/facet/SlotAcc.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/search/facet/SlotAcc.java b/solr/core/src/java/org/apache/solr/search/facet/SlotAcc.java
index f5cdf82..4f8552b 100644
--- a/solr/core/src/java/org/apache/solr/search/facet/SlotAcc.java
+++ b/solr/core/src/java/org/apache/solr/search/facet/SlotAcc.java
@@ -280,40 +280,6 @@ class SumsqSlotAcc extends DoubleFuncSlotAcc {
}
}
-class MinSlotAcc extends DoubleFuncSlotAcc {
- public MinSlotAcc(ValueSource values, FacetContext fcontext, int numSlots) {
- super(values, fcontext, numSlots, Double.NaN);
- }
-
- @Override
- public void collect(int doc, int slotNum) throws IOException {
- double val = values.doubleVal(doc);
- if (val == 0 && !values.exists(doc)) return; // depend on fact that non existing values return 0 for func query
-
- double currMin = result[slotNum];
- if (!(val >= currMin)) { // val>=currMin will be false for staring value: val>=NaN
- result[slotNum] = val;
- }
- }
-}
-
-class MaxSlotAcc extends DoubleFuncSlotAcc {
- public MaxSlotAcc(ValueSource values, FacetContext fcontext, int numSlots) {
- super(values, fcontext, numSlots, Double.NaN);
- }
-
- @Override
- public void collect(int doc, int slotNum) throws IOException {
- double val = values.doubleVal(doc);
- if (val == 0 && !values.exists(doc)) return; // depend on fact that non existing values return 0 for func query
-
- double currMax = result[slotNum];
- if (!(val <= currMax)) { // reversed order to handle NaN
- result[slotNum] = val;
- }
- }
-
-}
class AvgSlotAcc extends DoubleFuncSlotAcc {
int[] counts;
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b636d6e9/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java b/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java
index 4ca435c..87504f6 100644
--- a/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java
+++ b/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java
@@ -1372,6 +1372,30 @@ public class TestJsonFacets extends SolrTestCaseHS {
);
+
+ // test min/max of string field
+ if (where_s.equals("where_s") || where_s.equals("where_sd")) { // supports only single valued currently...
+ client.testJQ(params(p, "q", "*:* -(+${cat_s}:A +${where_s}:NJ)" // make NY the only value in bucket A
+ , "json.facet", "{" +
+ " f1:{type:terms, field:'${cat_s}', facet:{min:'min(${where_s})', max:'max(${where_s})'} }" +
+ ", f2:{type:terms, field:'${cat_s}', facet:{min:'min(${where_s})', max:'max(${where_s})'} , sort:'min desc'}" +
+ ", f3:{type:terms, field:'${cat_s}', facet:{min:'min(${where_s})', max:'max(${where_s})'} , sort:'min asc'}" +
+ ", f4:{type:terms, field:'${cat_s}', facet:{min:'min(${super_s})', max:'max(${super_s})'} , sort:'max asc'}" +
+ ", f5:{type:terms, field:'${cat_s}', facet:{min:'min(${super_s})', max:'max(${super_s})'} , sort:'max desc'}" +
+ "}"
+ )
+ , "facets=={ count:5, " +
+ " f1:{ buckets:[{val:B, count:3, min:NJ, max:NY}, {val:A, count:1, min:NY, max:NY}]}" +
+ ",f2:{ buckets:[{val:A, count:1, min:NY, max:NY}, {val:B, count:3, min:NJ, max:NY}]}" +
+ ",f3:{ buckets:[{val:B, count:3, min:NJ, max:NY}, {val:A, count:1, min:NY, max:NY}]}" +
+ ",f4:{ buckets:[{val:B, count:3, min:batman, max:superman}, {val:A, count:1, min:zodiac, max:zodiac}]}" +
+ ",f5:{ buckets:[{val:A, count:1, min:zodiac, max:zodiac}, {val:B, count:3, min:batman, max:superman}]}" +
+ " } "
+ );
+
+
+ }
+
}
@Test
[46/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10625: Update
CHANGES.txt
Posted by tf...@apache.org.
SOLR-10625: Update 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/07cc0436
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/07cc0436
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/07cc0436
Branch: refs/heads/jira/solr-10233
Commit: 07cc043664c4b82c208237b111f698ab2ae0ae07
Parents: a3fe9f0
Author: Joel Bernstein <jb...@apache.org>
Authored: Mon May 8 10:19:41 2017 -0400
Committer: Joel Bernstein <jb...@apache.org>
Committed: Mon May 8 10:19:41 2017 -0400
----------------------------------------------------------------------
solr/CHANGES.txt | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/07cc0436/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index f39c0b9..dc5c279 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -238,6 +238,8 @@ New Features
* SOLR-10626: Add covariance Stream Evaluator (Joel Bernstein)
+* SOLR-10625: Add convolution Stream Evaluator (Joel Bernstein)
+
Optimizations
----------------------
[17/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-9530: An Update
Processor to convert normal update operation to an atomic operations such as
add, set, inc, remove , set, removeregex
Posted by tf...@apache.org.
SOLR-9530: An Update Processor to convert normal update operation to an atomic operations such as add, set,inc, remove ,set, removeregex
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/faa74ec7
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/faa74ec7
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/faa74ec7
Branch: refs/heads/jira/solr-10233
Commit: faa74ec7dcddb9fccf240e81a36b21f90336726c
Parents: c6ebee6
Author: Noble Paul <no...@apache.org>
Authored: Fri May 5 10:47:57 2017 +0930
Committer: Noble Paul <no...@apache.org>
Committed: Fri May 5 10:49:11 2017 +0930
----------------------------------------------------------------------
solr/CHANGES.txt | 4 +
.../java/org/apache/solr/core/PluginBag.java | 2 +-
.../processor/AtomicUpdateProcessorFactory.java | 183 ++++++++++++
.../processor/UpdateRequestProcessorChain.java | 12 +-
.../AtomicUpdateProcessorFactoryTest.java | 280 +++++++++++++++++++
5 files changed, 477 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/faa74ec7/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index f9576c2..ae1ed1f 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -206,6 +206,10 @@ New Features
* SOLR-10583: JSON Faceting now supports a query time 'join' domain change option (hossman)
+* SOLR-9530: An Update Processor to convert normal update operation to an atomic operations such as
+ add, set,inc, remove ,set, removeregex (Amrit Sarkar, noble)
+
+
Optimizations
----------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/faa74ec7/solr/core/src/java/org/apache/solr/core/PluginBag.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/core/PluginBag.java b/solr/core/src/java/org/apache/solr/core/PluginBag.java
index 4c0858e..e03fc06 100644
--- a/solr/core/src/java/org/apache/solr/core/PluginBag.java
+++ b/solr/core/src/java/org/apache/solr/core/PluginBag.java
@@ -122,7 +122,7 @@ public class PluginBag<T> implements AutoCloseable {
return result;
}
- PluginHolder<T> createPlugin(PluginInfo info) {
+ public PluginHolder<T> createPlugin(PluginInfo info) {
if ("true".equals(String.valueOf(info.attributes.get("runtimeLib")))) {
log.debug(" {} : '{}' created with runtimeLib=true ", meta.getCleanTag(), info.name);
return new LazyPluginHolder<>(meta, info, core, core.getMemClassLoader());
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/faa74ec7/solr/core/src/java/org/apache/solr/update/processor/AtomicUpdateProcessorFactory.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/update/processor/AtomicUpdateProcessorFactory.java b/solr/core/src/java/org/apache/solr/update/processor/AtomicUpdateProcessorFactory.java
new file mode 100644
index 0000000..2292dc8
--- /dev/null
+++ b/solr/core/src/java/org/apache/solr/update/processor/AtomicUpdateProcessorFactory.java
@@ -0,0 +1,183 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.update.processor;
+
+import static java.util.Collections.singletonMap;
+import static org.apache.solr.common.SolrException.ErrorCode.SERVER_ERROR;
+
+import java.io.IOException;
+import java.lang.invoke.MethodHandles;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.solr.common.SolrException;
+import org.apache.solr.common.SolrException.ErrorCode;
+import org.apache.solr.common.SolrInputDocument;
+import org.apache.solr.common.util.NamedList;
+import org.apache.solr.core.SolrCore;
+import org.apache.solr.request.SolrQueryRequest;
+import org.apache.solr.response.SolrQueryResponse;
+import org.apache.solr.update.AddUpdateCommand;
+import org.apache.solr.update.VersionInfo;
+import org.apache.solr.util.plugin.SolrCoreAware;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * An update processor that will convert conventional field-value document to atomic update document
+ * <p>
+ * sample request:
+ * curl -X POST -H Content-Type: application/json
+ * http://localhost:8983/solr/test/update/json/docs?processor=atomic;ampersand;Atomic.my_newfield=add;ampersand;Atomic.subject=set;ampersand;Atomic.count_i=inc;ampersand;commit=true
+ * --data-binary {"id": 1,"title": "titleA"}
+ * </p>
+ * currently supports all types of atomic updates
+ */
+
+public class AtomicUpdateProcessorFactory extends UpdateRequestProcessorFactory implements SolrCoreAware {
+
+ private final static String ADD = "add";
+ private final static String INC = "inc";
+ private final static String REMOVE = "remove";
+ private final static String SET = "set";
+ private final static String REMOVEREGEX = "removeregex";
+ private final static Set<String> VALID_OPS = new HashSet<>(Arrays.asList(ADD, INC, REMOVE, SET, REMOVEREGEX));
+
+ private final static String VERSION = "_version_";
+ private final static String ATOMIC_FIELD_PREFIX = "Atomic.";
+ private final static int MAX_ATTEMPTS = 5;
+
+ private VersionInfo vinfo;
+
+ private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+
+ @SuppressWarnings({"static-access", "rawtypes", "null"})
+ @Override
+ public void init(final NamedList args) {
+
+ }
+
+ @Override
+ public void inform(SolrCore core) {
+ this.vinfo = core.getUpdateHandler().getUpdateLog() == null ? null : core.getUpdateHandler().getUpdateLog().getVersionInfo();
+
+ }
+
+ @Override
+ public UpdateRequestProcessor getInstance(SolrQueryRequest req, SolrQueryResponse rsp,
+ UpdateRequestProcessor next) {
+ if (vinfo == null) {
+ throw new SolrException
+ (SolrException.ErrorCode.BAD_REQUEST,
+ "Atomic document updates are not supported unless <updateLog/> is configured");
+ }
+ return new AtomicUpdateProcessor(req, next);
+ }
+
+ private class AtomicUpdateProcessor extends UpdateRequestProcessor {
+
+ @SuppressWarnings("unused")
+ private final SolrQueryRequest req;
+ private final UpdateRequestProcessor next;
+
+ private AtomicUpdateProcessor(SolrQueryRequest req,
+ UpdateRequestProcessor next) {
+ super(next);
+ this.next = next;
+ this.req = req;
+ }
+
+ /*
+ * 1. convert incoming update document to atomic-type update document
+ * for specified fields in processor definition.
+ * 2. if incoming update document contains already atomic-type updates, skip
+ * 3. fields not specified in processor param(s) in solrconfig.xml for atomic action
+ * will be treated as conventional updates.
+ * 4. retry when encounter version conflict
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void processAdd(AddUpdateCommand cmd)
+ throws IOException {
+
+ SolrInputDocument orgdoc = cmd.getSolrInputDocument();
+ boolean isAtomicUpdateAddedByMe = false;
+
+ Iterator<String> paramsIterator = req.getParams().getParameterNamesIterator();
+
+ while (paramsIterator.hasNext()) {
+
+ String param = paramsIterator.next();
+
+ if (!param.startsWith(ATOMIC_FIELD_PREFIX)) continue;
+
+ String field = param.substring(ATOMIC_FIELD_PREFIX.length(), param.length());
+ String operation = req.getParams().get(param);
+
+ if (!VALID_OPS.contains(operation)) {
+ throw new SolrException(SERVER_ERROR,
+ "Unexpected param(s) for AtomicUpdateProcessor, invalid atomic op passed: '" +
+ req.getParams().get(param) + "'");
+ }
+ if (orgdoc.get(field) == null || orgdoc.get(field).getValue() instanceof Map) {
+ // no value for the field or it's already an atomic update operation
+ //continue processing other fields
+ continue;
+ }
+
+ orgdoc.setField(field, singletonMap(operation, orgdoc.get(field).getValue()));
+ isAtomicUpdateAddedByMe = true;
+ }
+
+ // if atomic, put _version_ for optimistic concurrency if doc present in index
+ if (isAtomicUpdateAddedByMe) {
+ Long lastVersion = vinfo.lookupVersion(cmd.getIndexedId());
+ if (lastVersion != null) {
+ orgdoc.setField(VERSION, lastVersion);
+ }
+ processAddWithRetry(cmd, 0);
+ } else {
+ super.processAdd(cmd);
+ }
+ // else send it for doc to get inserted for the first time
+ }
+
+ private void processAddWithRetry(AddUpdateCommand cmd, int attempts) throws IOException {
+ try {
+ super.processAdd(cmd);
+ } catch (SolrException e) {
+ if (attempts++ >= MAX_ATTEMPTS) {//maximum number of attempts allowed: 5
+ throw new SolrException(SERVER_ERROR,
+ "Atomic update failed after multiple attempts due to " + e.getMessage());
+ }
+ if (e.code() == ErrorCode.CONFLICT.code) { // version conflict
+ log.warn("Atomic update failed due to " + e.getMessage() +
+ "Retrying with new version .... (" + attempts + ")");
+ Long lastVersion = vinfo.lookupVersion(cmd.getIndexedId());
+ if (lastVersion != null) {
+ cmd.solrDoc.setField(VERSION, lastVersion);
+ }
+ processAddWithRetry(cmd, attempts);
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/faa74ec7/solr/core/src/java/org/apache/solr/update/processor/UpdateRequestProcessorChain.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/update/processor/UpdateRequestProcessorChain.java b/solr/core/src/java/org/apache/solr/update/processor/UpdateRequestProcessorChain.java
index 0ed626c..05d1a5a 100644
--- a/solr/core/src/java/org/apache/solr/update/processor/UpdateRequestProcessorChain.java
+++ b/solr/core/src/java/org/apache/solr/update/processor/UpdateRequestProcessorChain.java
@@ -28,6 +28,8 @@ import org.apache.solr.common.params.MapSolrParams;
import org.apache.solr.common.params.SolrParams;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.common.util.StrUtils;
+import org.apache.solr.common.util.Utils;
+import org.apache.solr.core.PluginBag;
import org.apache.solr.core.PluginInfo;
import org.apache.solr.core.SolrCore;
import org.apache.solr.request.SolrQueryRequest;
@@ -271,9 +273,13 @@ public final class UpdateRequestProcessorChain implements PluginInfoInitialized
UpdateRequestProcessorFactory p = core.getUpdateProcessors().get(s);
if (p == null) {
try {
- p = core.createInstance(s + "UpdateProcessorFactory", UpdateRequestProcessorFactory.class,
- "updateProcessor", null, core.getMemClassLoader());
- core.getUpdateProcessors().put(s, p);
+ PluginInfo pluginInfo = new PluginInfo("updateProcessor",
+ Utils.makeMap("name", s,
+ "class", s + "UpdateProcessorFactory",
+ "runtimeLib", "true"));
+
+ PluginBag.PluginHolder<UpdateRequestProcessorFactory> pluginHolder = core.getUpdateProcessors().createPlugin(pluginInfo);
+ core.getUpdateProcessors().put(s, p = pluginHolder.get());
} catch (SolrException e) {
}
if (p == null)
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/faa74ec7/solr/core/src/test/org/apache/solr/update/processor/AtomicUpdateProcessorFactoryTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/update/processor/AtomicUpdateProcessorFactoryTest.java b/solr/core/src/test/org/apache/solr/update/processor/AtomicUpdateProcessorFactoryTest.java
new file mode 100644
index 0000000..780e2ba
--- /dev/null
+++ b/solr/core/src/test/org/apache/solr/update/processor/AtomicUpdateProcessorFactoryTest.java
@@ -0,0 +1,280 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.update.processor;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringJoiner;
+
+import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.common.SolrException;
+import org.apache.solr.common.SolrInputDocument;
+import org.apache.solr.common.params.ModifiableSolrParams;
+import org.apache.solr.request.LocalSolrQueryRequest;
+import org.apache.solr.response.SolrQueryResponse;
+import org.apache.solr.update.AddUpdateCommand;
+import org.junit.BeforeClass;
+
+/**
+ * test class for @see AtomicUpdateProcessorFactory
+ */
+public class AtomicUpdateProcessorFactoryTest extends SolrTestCaseJ4 {
+
+ @BeforeClass
+ public static void beforeClass() throws Exception {
+ initCore("solrconfig.xml", "schema.xml");
+ }
+
+ public void testWrongAtomicOpPassed() throws Exception {
+ AddUpdateCommand cmd = new AddUpdateCommand(new LocalSolrQueryRequest(h.getCore(),
+ new ModifiableSolrParams()
+ .add("processor", "Atomic")
+ .add("Atomic.cat", "delete")
+ .add("commit","true")
+ ));
+
+ try {
+ AtomicUpdateProcessorFactory factory = new AtomicUpdateProcessorFactory();
+ factory.inform(h.getCore());
+ factory.getInstance(cmd.getReq(), new SolrQueryResponse(),
+ null).processAdd(cmd);
+ } catch (SolrException e) {
+ assertEquals("Unexpected param(s) for AtomicUpdateProcessor, invalid atomic op passed: 'delete'",
+ e.getMessage());
+ }
+ }
+
+ public void testNoUniqueIdPassed() throws Exception { //TODO
+ AddUpdateCommand cmd = new AddUpdateCommand(new LocalSolrQueryRequest(h.getCore(),
+ new ModifiableSolrParams()
+ .add("processor", "Atomic")
+ .add("Atomic.cat", "add")
+ .add("commit","true")
+ ));
+
+ cmd.solrDoc = new SolrInputDocument();
+ cmd.solrDoc.addField("title", 1);
+
+ try {
+ AtomicUpdateProcessorFactory factory = new AtomicUpdateProcessorFactory();
+ factory.inform(h.getCore());
+ factory.getInstance(cmd.getReq(), new SolrQueryResponse(),
+ null).processAdd(cmd);
+ } catch (SolrException e) {
+ assertEquals("Document passed with no unique field: 'id'", e.getMessage());
+ }
+ }
+
+ public void testBasics() throws Exception {
+
+ AddUpdateCommand cmd = new AddUpdateCommand(new LocalSolrQueryRequest(h.getCore(),
+ new ModifiableSolrParams()
+ .add("processor", "Atomic")
+ .add("Atomic.cat", "add")
+ .add("Atomic.title", "set")
+ .add("Atomic.count_i", "set")
+ .add("Atomic.name_s", "set")
+ .add("Atomic.multiDefault", "set")
+ .add("commit","true")
+ ));
+
+ cmd.solrDoc = new SolrInputDocument();
+ cmd.solrDoc.addField("id", 1);
+ cmd.solrDoc.addField("cat", "human");
+ cmd.solrDoc.addField("title", "Mr");
+ cmd.solrDoc.addField("count_i", 20);
+ cmd.solrDoc.addField("name_s", "Virat");
+ cmd.solrDoc.addField("multiDefault", "Delhi");
+
+ AtomicUpdateProcessorFactory factory = new AtomicUpdateProcessorFactory();
+ factory.inform(h.getCore());
+ factory.getInstance(cmd.getReq(), new SolrQueryResponse(),
+ new DistributedUpdateProcessor(cmd.getReq(), new SolrQueryResponse(),
+ new RunUpdateProcessor(cmd.getReq(), null))).processAdd(cmd);
+
+ assertU(commit());
+
+ assertQ("Check the total number of docs",
+ req("q", "id:1")
+ , "//result[@numFound=1]");
+
+ assertQ("Check the total number of docs",
+ req("q", "cat:human")
+ , "//result[@numFound=1]");
+
+ assertQ("Check the total number of docs",
+ req("q", "title:Mr")
+ , "//result[@numFound=1]");
+
+ assertQ("Check the total number of docs",
+ req("q", "count_i:20")
+ , "//result[@numFound=1]");
+
+ assertQ("Check the total number of docs",
+ req("q", "name_s:Virat")
+ , "//result[@numFound=1]");
+
+ assertQ("Check the total number of docs",
+ req("q", "multiDefault:Delhi")
+ , "//result[@numFound=1]");
+
+ cmd = new AddUpdateCommand(new LocalSolrQueryRequest(h.getCore(),
+ new ModifiableSolrParams()
+ .add("processor", "Atomic")
+ .add("Atomic.cat", "add")
+ .add("Atomic.title", "set")
+ .add("Atomic.count_i", "inc")
+ .add("Atomic.name_s", "remove")
+ .add("Atomic.multiDefault", "removeregex")
+ .add("commit","true")
+ ));
+
+ cmd.solrDoc = new SolrInputDocument();
+ cmd.solrDoc.addField("id", 1);
+ cmd.solrDoc.addField("cat", "animal");
+ cmd.solrDoc.addField("title", "Dr");
+ cmd.solrDoc.addField("count_i", 20);
+ cmd.solrDoc.addField("name_s", "Virat");
+ cmd.solrDoc.addField("multiDefault", ".elh.");
+
+ factory = new AtomicUpdateProcessorFactory();
+ factory.inform(h.getCore());
+ factory.getInstance(cmd.getReq(), new SolrQueryResponse(),
+ new DistributedUpdateProcessor(cmd.getReq(), new SolrQueryResponse(),
+ new RunUpdateProcessor(cmd.getReq(), null))).processAdd(cmd);
+
+ assertU(commit());
+
+ assertQ("Check the total number of docs",
+ req("q", "id:1")
+ , "//result[@numFound=1]");
+
+ assertQ("Check the total number of docs",
+ req("q", "cat:human")
+ , "//result[@numFound=1]");
+
+ assertQ("Check the total number of docs",
+ req("q", "cat:animal")
+ , "//result[@numFound=1]");
+
+ assertQ("Check the total number of docs",
+ req("q", "title:Mr")
+ , "//result[@numFound=0]");
+
+ assertQ("Check the total number of docs",
+ req("q", "title:Dr")
+ , "//result[@numFound=1]");
+
+ assertQ("Check the total number of docs",
+ req("q", "count_i:20")
+ , "//result[@numFound=0]");
+
+ assertQ("Check the total number of docs",
+ req("q", "count_i:40")
+ , "//result[@numFound=1]");
+
+ assertQ("Check the total number of docs",
+ req("q", "name_s:Virat")
+ , "//result[@numFound=0]");
+
+ assertQ("Check the total number of docs",
+ req("q", "multiDefault:Delhi")
+ , "//result[@numFound=0]");
+
+ }
+
+ public void testMultipleThreads() throws Exception {
+ clearIndex();
+ String[] strings = new String[5];
+ for (int i=0; i<5; i++) {
+ strings[i] = generateRandomString();
+ }
+
+ List<Thread> threads = new ArrayList<>(100);
+ int finalCount = 0; //int_i
+
+ for (int i = 0; i < 100; i++) {
+ int index = random().nextInt(5);
+ Thread t = new Thread() {
+ @Override
+ public void run() {
+ AddUpdateCommand cmd = new AddUpdateCommand(new LocalSolrQueryRequest(h.getCore(),
+ new ModifiableSolrParams()
+ .add("processor", "Atomic")
+ .add("Atomic.cat", "add")
+ .add("Atomic.int_i", "inc")
+ .add("commit","true")
+
+ ));
+
+ cmd.solrDoc = new SolrInputDocument();
+ cmd.solrDoc.addField("id", 10); //hardcoded id=2
+ cmd.solrDoc.addField("cat", strings[index]);
+ cmd.solrDoc.addField("int_i", index);
+
+ try {
+ AtomicUpdateProcessorFactory factory = new AtomicUpdateProcessorFactory();
+ factory.inform(h.getCore());
+ factory.getInstance(cmd.getReq(), new SolrQueryResponse(),
+ new DistributedUpdateProcessor(cmd.getReq(), new SolrQueryResponse(),
+ new RunUpdateProcessor(cmd.getReq(), null))).processAdd(cmd);
+ } catch (IOException e) {
+ }
+ }
+ };
+ t.run();
+ threads.add(t);
+ finalCount += index; //int_i
+ }
+
+ for (Thread thread: threads) {
+ thread.join();
+ }
+
+ assertU(commit());
+
+ assertQ("Check the total number of docs",
+ req("q", "id:10"), "//result[@numFound=1]");
+
+
+ StringJoiner queryString = new StringJoiner(" ");
+ for(String string: strings) {
+ queryString.add(string);
+ }
+
+ assertQ("Check the total number of docs",
+ req("q", "cat:" + queryString.toString())
+ , "//result[@numFound=1]");
+
+ assertQ("Check the total number of docs",
+ req("q", "int_i:" + finalCount)
+ , "//result[@numFound=1]");
+
+ }
+
+ private String generateRandomString() {
+ char[] chars = "abcdefghijklmnopqrstuvwxyz0123456789".toCharArray();
+ StringBuilder sb = new StringBuilder();
+ for (int i = 0; i < 20; i++) {
+ char c = chars[random().nextInt(chars.length)];
+ sb.append(c);
+ }
+ return sb.toString();
+ }
+
+}
\ No newline at end of file
[10/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-9867: rollback
SDF.createCoreContainer(). disable testTechproductsExample
Posted by tf...@apache.org.
SOLR-9867: rollback SDF.createCoreContainer(). disable testTechproductsExample
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/1534b621
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/1534b621
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/1534b621
Branch: refs/heads/jira/solr-10233
Commit: 1534b6219fa99f7a64f372778e727382e256b423
Parents: 30f1422
Author: Mikhail Khludnev <mk...@apache.org>
Authored: Thu May 4 16:19:14 2017 +0300
Committer: Mikhail Khludnev <mk...@apache.org>
Committed: Thu May 4 16:19:14 2017 +0300
----------------------------------------------------------------------
.../src/java/org/apache/solr/servlet/SolrDispatchFilter.java | 6 +++---
.../src/test/org/apache/solr/util/TestSolrCLIRunExample.java | 3 ++-
2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/1534b621/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java b/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
index c4e0d0d..02b0460 100644
--- a/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
+++ b/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
@@ -247,9 +247,9 @@ public class SolrDispatchFilter extends BaseSolrFilter {
*/
protected CoreContainer createCoreContainer(Path solrHome, Properties extraProperties) {
NodeConfig nodeConfig = loadNodeConfig(solrHome, extraProperties);
- CoreContainer coreContainer = new CoreContainer(nodeConfig, extraProperties, true);
- coreContainer.load();
- return coreContainer;
+ cores = new CoreContainer(nodeConfig, extraProperties, true);
+ cores.load();
+ return cores;
}
/**
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/1534b621/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java b/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
index 6bce8226..86790c8 100644
--- a/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
+++ b/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
@@ -50,6 +50,7 @@ import org.apache.solr.common.SolrInputDocument;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.BeforeClass;
+import org.junit.Ignore;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -296,7 +297,7 @@ public class TestSolrCLIRunExample extends SolrTestCaseJ4 {
closeables = null;
}
}
-
+ @Ignore
@Test
public void testTechproductsExample() throws Exception {
testExample("techproducts");
[31/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10615: latching
SDF.doFilter() on init();
respond 404 instead of 500 in case of init failures or corecontainer shutdown.
Posted by tf...@apache.org.
SOLR-10615: latching SDF.doFilter() on init(); respond 404 instead of 500 in case of init failures or corecontainer shutdown.
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/c02d490d
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/c02d490d
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/c02d490d
Branch: refs/heads/jira/solr-10233
Commit: c02d490d2113c2b3fbe5826f334592cdb65a3dfe
Parents: 5883710
Author: Mikhail Khludnev <mk...@apache.org>
Authored: Sat May 6 00:36:00 2017 +0300
Committer: Mikhail Khludnev <mk...@apache.org>
Committed: Sat May 6 10:47:27 2017 +0300
----------------------------------------------------------------------
solr/CHANGES.txt | 4 ++++
.../org/apache/solr/servlet/SolrDispatchFilter.java | 16 +++++++++++++---
2 files changed, 17 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c02d490d/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 3fbfc96..38aac79 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -302,6 +302,10 @@ Bug Fixes
* SOLR-10549: The new 'large' attribute had been forgotten in /schema/fieldtypes?showDefaults=true (David Smiley)
+* SOLR-10615: requests are suspended until SolrDispatchFilter initialization is completed.
+ After core container shutdown or severe initialization problem Solr responds with
+ http stauts 404 Not Found instead of 500 as it was before (Mikhail Khludnev)
+
Other Changes
----------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c02d490d/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java b/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
index a4c9504..24440e7 100644
--- a/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
+++ b/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
@@ -29,6 +29,7 @@ import java.util.Arrays;
import java.util.Locale;
import java.util.Properties;
import java.util.Set;
+import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
import java.util.regex.Matcher;
@@ -41,6 +42,7 @@ import javax.servlet.ServletInputStream;
import javax.servlet.ServletOutputStream;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
+import javax.servlet.UnavailableException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import javax.servlet.http.HttpServletResponse;
@@ -88,6 +90,7 @@ public class SolrDispatchFilter extends BaseSolrFilter {
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
protected volatile CoreContainer cores;
+ protected final CountDownLatch init = new CountDownLatch(1);
protected String abortErrorMessage = null;
protected HttpClient httpClient;
@@ -187,6 +190,7 @@ public class SolrDispatchFilter extends BaseSolrFilter {
}finally{
log.trace("SolrDispatchFilter.init() done");
this.cores = coresInit; // crucially final assignment
+ init.countDown();
}
}
@@ -318,9 +322,15 @@ public class SolrDispatchFilter extends BaseSolrFilter {
try {
if (cores == null || cores.isShutDown()) {
- log.error("Error processing the request. CoreContainer is either not initialized or shutting down.");
- throw new SolrException(ErrorCode.SERVICE_UNAVAILABLE,
- "Error processing the request. CoreContainer is either not initialized or shutting down.");
+ try {
+ init.await();
+ } catch (InterruptedException e) { //well, no wait then
+ }
+ final String msg = "Error processing the request. CoreContainer is either not initialized or shutting down.";
+ if (cores == null || cores.isShutDown()) {
+ log.error(msg);
+ throw new UnavailableException(msg);
+ }
}
AtomicReference<ServletRequest> wrappedRequest = new AtomicReference<>();
[29/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-9530: fixing test
error
Posted by tf...@apache.org.
SOLR-9530: fixing test error
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/468d479b
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/468d479b
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/468d479b
Branch: refs/heads/jira/solr-10233
Commit: 468d479b5f90d6bf3d1ae5f62019956b76fa2a25
Parents: 52b252c
Author: Noble Paul <no...@apache.org>
Authored: Sat May 6 06:00:54 2017 +0930
Committer: Noble Paul <no...@apache.org>
Committed: Sat May 6 06:00:54 2017 +0930
----------------------------------------------------------------------
.../solr/update/processor/UpdateRequestProcessorFactoryTest.java | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/468d479b/solr/core/src/test/org/apache/solr/update/processor/UpdateRequestProcessorFactoryTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/update/processor/UpdateRequestProcessorFactoryTest.java b/solr/core/src/test/org/apache/solr/update/processor/UpdateRequestProcessorFactoryTest.java
index 7ebefec..07f0484 100644
--- a/solr/core/src/test/org/apache/solr/update/processor/UpdateRequestProcessorFactoryTest.java
+++ b/solr/core/src/test/org/apache/solr/update/processor/UpdateRequestProcessorFactoryTest.java
@@ -40,6 +40,7 @@ public class UpdateRequestProcessorFactoryTest extends AbstractSolrTestCase {
@BeforeClass
public static void beforeClass() throws Exception {
+ System.setProperty("enable.runtime.lib", "true");
initCore("solrconfig-transformers.xml", "schema.xml");
}
[13/50] [abbrv] lucene-solr:jira/solr-10233: LUCENE-7811: add
concurrent SortedSet facets implementation
Posted by tf...@apache.org.
LUCENE-7811: add concurrent SortedSet facets implementation
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/de709b12
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/de709b12
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/de709b12
Branch: refs/heads/jira/solr-10233
Commit: de709b122d84d85c510dfad8f35a039c38af62b4
Parents: 2af2b55
Author: Mike McCandless <mi...@apache.org>
Authored: Thu May 4 15:16:05 2017 -0400
Committer: Mike McCandless <mi...@apache.org>
Committed: Thu May 4 15:16:05 2017 -0400
----------------------------------------------------------------------
lucene/CHANGES.txt | 8 +
.../lucene/util/SameThreadExecutorService.java | 6 +-
.../apache/lucene/facet/FacetsCollector.java | 56 +--
.../lucene/facet/FacetsCollectorManager.java | 16 +-
...ConcurrentSortedSetDocValuesFacetCounts.java | 353 +++++++++++++++++++
.../DefaultSortedSetDocValuesReaderState.java | 20 +-
.../SortedSetDocValuesFacetCounts.java | 231 +++++-------
.../sortedset/SortedSetDocValuesFacetField.java | 1 +
.../SortedSetDocValuesReaderState.java | 4 +-
.../sortedset/TestSortedSetDocValuesFacets.java | 57 ++-
.../lucene/replicator/nrt/CopyOneFile.java | 5 +-
11 files changed, 542 insertions(+), 215 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/de709b12/lucene/CHANGES.txt
----------------------------------------------------------------------
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 002eafc..e9aefe5 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -91,6 +91,11 @@ Other
======================= Lucene 6.6.0 =======================
+New Features
+
+* LUCENE-7811: Add a concurrent SortedSet facets implementation.
+ (Mike McCandless)
+
Bug Fixes
* LUCENE-7777: ByteBlockPool.readBytes sometimes throws
@@ -127,6 +132,9 @@ Improvements
* LUCENE-7792: OfflineSorter can now run concurrently if you pass it
an optional ExecutorService (Dawid Weiss, Mike McCandless)
+* LUCENE-7811: Sorted set facets now use sparse storage when
+ collecting hits, when appropriate. (Mike McCandless)
+
Optimizations
* LUCENE-7787: spatial-extras HeatmapFacetCounter will now short-circuit it's
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/de709b12/lucene/core/src/java/org/apache/lucene/util/SameThreadExecutorService.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/SameThreadExecutorService.java b/lucene/core/src/java/org/apache/lucene/util/SameThreadExecutorService.java
index 169b9f8..517e7e2 100644
--- a/lucene/core/src/java/org/apache/lucene/util/SameThreadExecutorService.java
+++ b/lucene/core/src/java/org/apache/lucene/util/SameThreadExecutorService.java
@@ -22,8 +22,10 @@ import java.util.concurrent.AbstractExecutorService;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.TimeUnit;
-/** An {@code ExecutorService} that executes tasks immediately in the calling thread during submit. */
-class SameThreadExecutorService extends AbstractExecutorService {
+/** An {@code ExecutorService} that executes tasks immediately in the calling thread during submit.
+ *
+ * @lucene.internal */
+public final class SameThreadExecutorService extends AbstractExecutorService {
private volatile boolean shutdown;
@Override
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/de709b12/lucene/facet/src/java/org/apache/lucene/facet/FacetsCollector.java
----------------------------------------------------------------------
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/FacetsCollector.java b/lucene/facet/src/java/org/apache/lucene/facet/FacetsCollector.java
index b942f7e..9333353 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/FacetsCollector.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/FacetsCollector.java
@@ -38,8 +38,7 @@ import org.apache.lucene.search.TopFieldDocs;
import org.apache.lucene.search.TopScoreDocCollector;
import org.apache.lucene.search.TotalHitCountCollector;
import org.apache.lucene.util.ArrayUtil;
-import org.apache.lucene.util.BitDocIdSet;
-import org.apache.lucene.util.FixedBitSet;
+import org.apache.lucene.util.DocIdSetBuilder;
/** Collects hits for subsequent faceting. Once you've run
* a search and collect hits into this, instantiate one of
@@ -56,25 +55,9 @@ public class FacetsCollector extends SimpleCollector implements Collector {
private float[] scores;
private final boolean keepScores;
private final List<MatchingDocs> matchingDocs = new ArrayList<>();
- private Docs docs;
+ private DocIdSetBuilder docsBuilder;
/**
- * Used during collection to record matching docs and then return a
- * {@link DocIdSet} that contains them.
- */
- protected static abstract class Docs {
-
- /** Solr constructor. */
- public Docs() {}
-
- /** Record the given document. */
- public abstract void addDoc(int docId) throws IOException;
-
- /** Return the {@link DocIdSet} which contains all the recorded docs. */
- public abstract DocIdSet getDocIdSet();
- }
-
- /**
* Holds the documents that were matched in the {@link org.apache.lucene.index.LeafReaderContext}.
* If scores were required, then {@code scores} is not null.
*/
@@ -112,27 +95,6 @@ public class FacetsCollector extends SimpleCollector implements Collector {
this.keepScores = keepScores;
}
- /**
- * Creates a {@link Docs} to record hits. The default uses {@link FixedBitSet}
- * to record hits and you can override to e.g. record the docs in your own
- * {@link DocIdSet}.
- */
- protected Docs createDocs(final int maxDoc) {
- return new Docs() {
- private final FixedBitSet bits = new FixedBitSet(maxDoc);
-
- @Override
- public void addDoc(int docId) throws IOException {
- bits.set(docId);
- }
-
- @Override
- public DocIdSet getDocIdSet() {
- return new BitDocIdSet(bits);
- }
- };
- }
-
/** True if scores were saved. */
public final boolean getKeepScores() {
return keepScores;
@@ -143,9 +105,9 @@ public class FacetsCollector extends SimpleCollector implements Collector {
* visited segment.
*/
public List<MatchingDocs> getMatchingDocs() {
- if (docs != null) {
- matchingDocs.add(new MatchingDocs(this.context, docs.getDocIdSet(), totalHits, scores));
- docs = null;
+ if (docsBuilder != null) {
+ matchingDocs.add(new MatchingDocs(this.context, docsBuilder.build(), totalHits, scores));
+ docsBuilder = null;
scores = null;
context = null;
}
@@ -155,7 +117,7 @@ public class FacetsCollector extends SimpleCollector implements Collector {
@Override
public final void collect(int doc) throws IOException {
- docs.addDoc(doc);
+ docsBuilder.grow(1).add(doc);
if (keepScores) {
if (totalHits >= scores.length) {
float[] newScores = new float[ArrayUtil.oversize(totalHits + 1, 4)];
@@ -179,10 +141,10 @@ public class FacetsCollector extends SimpleCollector implements Collector {
@Override
protected void doSetNextReader(LeafReaderContext context) throws IOException {
- if (docs != null) {
- matchingDocs.add(new MatchingDocs(this.context, docs.getDocIdSet(), totalHits, scores));
+ if (docsBuilder != null) {
+ matchingDocs.add(new MatchingDocs(this.context, docsBuilder.build(), totalHits, scores));
}
- docs = createDocs(context.reader().maxDoc());
+ docsBuilder = new DocIdSetBuilder(context.reader().maxDoc());
totalHits = 0;
if (keepScores) {
scores = new float[64]; // some initial size
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/de709b12/lucene/facet/src/java/org/apache/lucene/facet/FacetsCollectorManager.java
----------------------------------------------------------------------
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/FacetsCollectorManager.java b/lucene/facet/src/java/org/apache/lucene/facet/FacetsCollectorManager.java
index 652436d..385a897 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/FacetsCollectorManager.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/FacetsCollectorManager.java
@@ -23,12 +23,14 @@ import java.util.Collection;
import java.util.List;
/**
- * A {@link CollectorManager} implementation which produce FacetsCollector and product a merged FacetsCollector.
+ * A {@link CollectorManager} implementation which produces FacetsCollector and produces a merged FacetsCollector.
* This is used for concurrent FacetsCollection.
*/
-class FacetsCollectorManager implements CollectorManager<FacetsCollector, FacetsCollector> {
+public class FacetsCollectorManager implements CollectorManager<FacetsCollector, FacetsCollector> {
- public final static FacetsCollector EMPTY = new FacetsCollector();
+ /** Sole constructor. */
+ public FacetsCollectorManager() {
+ }
@Override
public FacetsCollector newCollector() throws IOException {
@@ -37,10 +39,11 @@ class FacetsCollectorManager implements CollectorManager<FacetsCollector, Facets
@Override
public FacetsCollector reduce(Collection<FacetsCollector> collectors) throws IOException {
- if (collectors == null || collectors.size() == 0)
- return EMPTY;
- if (collectors.size() == 1)
+ if (collectors == null || collectors.size() == 0) {
+ return new FacetsCollector();
+ } if (collectors.size() == 1) {
return collectors.iterator().next();
+ }
return new ReducedFacetsCollector(collectors);
}
@@ -51,5 +54,4 @@ class FacetsCollectorManager implements CollectorManager<FacetsCollector, Facets
facetsCollectors.forEach(facetsCollector -> matchingDocs.addAll(facetsCollector.getMatchingDocs()));
}
}
-
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/de709b12/lucene/facet/src/java/org/apache/lucene/facet/sortedset/ConcurrentSortedSetDocValuesFacetCounts.java
----------------------------------------------------------------------
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/sortedset/ConcurrentSortedSetDocValuesFacetCounts.java b/lucene/facet/src/java/org/apache/lucene/facet/sortedset/ConcurrentSortedSetDocValuesFacetCounts.java
new file mode 100644
index 0000000..bcb6acf
--- /dev/null
+++ b/lucene/facet/src/java/org/apache/lucene/facet/sortedset/ConcurrentSortedSetDocValuesFacetCounts.java
@@ -0,0 +1,353 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.facet.sortedset;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Future;
+import java.util.concurrent.atomic.AtomicIntegerArray;
+
+import org.apache.lucene.facet.FacetResult;
+import org.apache.lucene.facet.Facets;
+import org.apache.lucene.facet.FacetsCollector.MatchingDocs;
+import org.apache.lucene.facet.FacetsCollector;
+import org.apache.lucene.facet.FacetsConfig;
+import org.apache.lucene.facet.LabelAndValue;
+import org.apache.lucene.facet.TopOrdAndIntQueue;
+import org.apache.lucene.facet.sortedset.SortedSetDocValuesReaderState.OrdRange;
+import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.LeafReader;
+import org.apache.lucene.index.LeafReaderContext;
+import org.apache.lucene.index.MultiDocValues.MultiSortedSetDocValues;
+import org.apache.lucene.index.MultiDocValues;
+import org.apache.lucene.index.ReaderUtil;
+import org.apache.lucene.index.SortedSetDocValues;
+import org.apache.lucene.search.ConjunctionDISI;
+import org.apache.lucene.search.DocIdSetIterator;
+import org.apache.lucene.search.MatchAllDocsQuery;
+import org.apache.lucene.util.BytesRef;
+import org.apache.lucene.util.IOUtils;
+import org.apache.lucene.util.LongValues;
+
+/** Like {@link SortedSetDocValuesFacetCounts}, but aggregates counts concurrently across segments.
+ *
+ * @lucene.experimental */
+public class ConcurrentSortedSetDocValuesFacetCounts extends Facets {
+
+ final ExecutorService exec;
+ final SortedSetDocValuesReaderState state;
+ final SortedSetDocValues dv;
+ final String field;
+ final AtomicIntegerArray counts;
+
+ /** Returns all facet counts, same result as searching on {@link MatchAllDocsQuery} but faster. */
+ public ConcurrentSortedSetDocValuesFacetCounts(SortedSetDocValuesReaderState state, ExecutorService exec)
+ throws IOException, InterruptedException {
+ this(state, null, exec);
+ }
+
+ /** Counts all facet dimensions across the provided hits. */
+ public ConcurrentSortedSetDocValuesFacetCounts(SortedSetDocValuesReaderState state, FacetsCollector hits, ExecutorService exec)
+ throws IOException, InterruptedException {
+ this.state = state;
+ this.field = state.getField();
+ this.exec = exec;
+ dv = state.getDocValues();
+ counts = new AtomicIntegerArray(state.getSize());
+ if (hits == null) {
+ // browse only
+ countAll();
+ } else {
+ count(hits.getMatchingDocs());
+ }
+ }
+
+ @Override
+ public FacetResult getTopChildren(int topN, String dim, String... path) throws IOException {
+ if (topN <= 0) {
+ throw new IllegalArgumentException("topN must be > 0 (got: " + topN + ")");
+ }
+ if (path.length > 0) {
+ throw new IllegalArgumentException("path should be 0 length");
+ }
+ OrdRange ordRange = state.getOrdRange(dim);
+ if (ordRange == null) {
+ throw new IllegalArgumentException("dimension \"" + dim + "\" was not indexed");
+ }
+ return getDim(dim, ordRange, topN);
+ }
+
+ private final FacetResult getDim(String dim, OrdRange ordRange, int topN) throws IOException {
+
+ TopOrdAndIntQueue q = null;
+
+ int bottomCount = 0;
+
+ int dimCount = 0;
+ int childCount = 0;
+
+ TopOrdAndIntQueue.OrdAndValue reuse = null;
+ //System.out.println("getDim : " + ordRange.start + " - " + ordRange.end);
+ for(int ord=ordRange.start; ord<=ordRange.end; ord++) {
+ //System.out.println(" ord=" + ord + " count=" + counts[ord]);
+ if (counts.get(ord) > 0) {
+ dimCount += counts.get(ord);
+ childCount++;
+ if (counts.get(ord) > bottomCount) {
+ if (reuse == null) {
+ reuse = new TopOrdAndIntQueue.OrdAndValue();
+ }
+ reuse.ord = ord;
+ reuse.value = counts.get(ord);
+ if (q == null) {
+ // Lazy init, so we don't create this for the
+ // sparse case unnecessarily
+ q = new TopOrdAndIntQueue(topN);
+ }
+ reuse = q.insertWithOverflow(reuse);
+ if (q.size() == topN) {
+ bottomCount = q.top().value;
+ }
+ }
+ }
+ }
+
+ if (q == null) {
+ return null;
+ }
+
+ LabelAndValue[] labelValues = new LabelAndValue[q.size()];
+ for(int i=labelValues.length-1;i>=0;i--) {
+ TopOrdAndIntQueue.OrdAndValue ordAndValue = q.pop();
+ final BytesRef term = dv.lookupOrd(ordAndValue.ord);
+ String[] parts = FacetsConfig.stringToPath(term.utf8ToString());
+ labelValues[i] = new LabelAndValue(parts[1], ordAndValue.value);
+ }
+
+ return new FacetResult(dim, new String[0], dimCount, labelValues, childCount);
+ }
+
+ private class CountOneSegment implements Callable<Void> {
+ final LeafReader leafReader;
+ final MatchingDocs hits;
+ final MultiDocValues.OrdinalMap ordinalMap;
+ final int segOrd;
+
+ public CountOneSegment(LeafReader leafReader, MatchingDocs hits, MultiDocValues.OrdinalMap ordinalMap, int segOrd) {
+ this.leafReader = leafReader;
+ this.hits = hits;
+ this.ordinalMap = ordinalMap;
+ this.segOrd = segOrd;
+ }
+
+ @Override
+ public Void call() throws IOException {
+ SortedSetDocValues segValues = leafReader.getSortedSetDocValues(field);
+ if (segValues == null) {
+ // nothing to count here
+ return null;
+ }
+
+ // TODO: yet another option is to count all segs
+ // first, only in seg-ord space, and then do a
+ // merge-sort-PQ in the end to only "resolve to
+ // global" those seg ords that can compete, if we know
+ // we just want top K? ie, this is the same algo
+ // that'd be used for merging facets across shards
+ // (distributed faceting). but this has much higher
+ // temp ram req'ts (sum of number of ords across all
+ // segs)
+ DocIdSetIterator it;
+ if (hits == null) {
+ // count all
+ it = segValues;
+ } else {
+ it = ConjunctionDISI.intersectIterators(Arrays.asList(hits.bits.iterator(), segValues));
+ }
+
+ if (ordinalMap != null) {
+ final LongValues ordMap = ordinalMap.getGlobalOrds(segOrd);
+
+ int numSegOrds = (int) segValues.getValueCount();
+
+ if (hits != null && hits.totalHits < numSegOrds/10) {
+ // Remap every ord to global ord as we iterate:
+ for (int doc = it.nextDoc(); doc != DocIdSetIterator.NO_MORE_DOCS; doc = it.nextDoc()) {
+ int term = (int) segValues.nextOrd();
+ while (term != SortedSetDocValues.NO_MORE_ORDS) {
+ counts.incrementAndGet((int) ordMap.get(term));
+ term = (int) segValues.nextOrd();
+ }
+ }
+ } else {
+
+ // First count in seg-ord space:
+ final int[] segCounts = new int[numSegOrds];
+ for (int doc = it.nextDoc(); doc != DocIdSetIterator.NO_MORE_DOCS; doc = it.nextDoc()) {
+ int term = (int) segValues.nextOrd();
+ while (term != SortedSetDocValues.NO_MORE_ORDS) {
+ segCounts[term]++;
+ term = (int) segValues.nextOrd();
+ }
+ }
+
+ // Then, migrate to global ords:
+ for(int ord=0;ord<numSegOrds;ord++) {
+ int count = segCounts[ord];
+ if (count != 0) {
+ counts.addAndGet((int) ordMap.get(ord), count);
+ }
+ }
+ }
+ } else {
+ // No ord mapping (e.g., single segment index):
+ // just aggregate directly into counts:
+ for (int doc = it.nextDoc(); doc != DocIdSetIterator.NO_MORE_DOCS; doc = it.nextDoc()) {
+ int term = (int) segValues.nextOrd();
+ while (term != SortedSetDocValues.NO_MORE_ORDS) {
+ counts.incrementAndGet(term);
+ term = (int) segValues.nextOrd();
+ }
+ }
+ }
+
+ return null;
+ }
+ }
+
+ /** Does all the "real work" of tallying up the counts. */
+ private final void count(List<MatchingDocs> matchingDocs) throws IOException, InterruptedException {
+
+ MultiDocValues.OrdinalMap ordinalMap;
+
+ // TODO: is this right? really, we need a way to
+ // verify that this ordinalMap "matches" the leaves in
+ // matchingDocs...
+ if (dv instanceof MultiDocValues.MultiSortedSetDocValues && matchingDocs.size() > 1) {
+ ordinalMap = ((MultiSortedSetDocValues) dv).mapping;
+ } else {
+ ordinalMap = null;
+ }
+
+ IndexReader reader = state.getReader();
+ List<Future<Void>> results = new ArrayList<>();
+
+ for (MatchingDocs hits : matchingDocs) {
+ // LUCENE-5090: make sure the provided reader context "matches"
+ // the top-level reader passed to the
+ // SortedSetDocValuesReaderState, else cryptic
+ // AIOOBE can happen:
+ if (ReaderUtil.getTopLevelContext(hits.context).reader() != reader) {
+ throw new IllegalStateException("the SortedSetDocValuesReaderState provided to this class does not match the reader being searched; you must create a new SortedSetDocValuesReaderState every time you open a new IndexReader");
+ }
+
+ results.add(exec.submit(new CountOneSegment(hits.context.reader(), hits, ordinalMap, hits.context.ord)));
+ }
+
+ for (Future<Void> result : results) {
+ try {
+ result.get();
+ } catch (ExecutionException ee) {
+ // Theoretically cause can be null; guard against that.
+ Throwable cause = ee.getCause();
+ throw IOUtils.rethrowAlways(cause != null ? cause : ee);
+ }
+ }
+ }
+
+ /** Does all the "real work" of tallying up the counts. */
+ private final void countAll() throws IOException, InterruptedException {
+ //System.out.println("ssdv count");
+
+ MultiDocValues.OrdinalMap ordinalMap;
+
+ // TODO: is this right? really, we need a way to
+ // verify that this ordinalMap "matches" the leaves in
+ // matchingDocs...
+ if (dv instanceof MultiDocValues.MultiSortedSetDocValues) {
+ ordinalMap = ((MultiSortedSetDocValues) dv).mapping;
+ } else {
+ ordinalMap = null;
+ }
+
+ List<Future<Void>> results = new ArrayList<>();
+
+ for (LeafReaderContext context : state.getReader().leaves()) {
+ results.add(exec.submit(new CountOneSegment(context.reader(), null, ordinalMap, context.ord)));
+ }
+
+ for (Future<Void> result : results) {
+ try {
+ result.get();
+ } catch (ExecutionException ee) {
+ // Theoretically cause can be null; guard against that.
+ Throwable cause = ee.getCause();
+ throw IOUtils.rethrowAlways(cause != null ? cause : ee);
+ }
+ }
+ }
+
+ @Override
+ public Number getSpecificValue(String dim, String... path) throws IOException {
+ if (path.length != 1) {
+ throw new IllegalArgumentException("path must be length=1");
+ }
+ int ord = (int) dv.lookupTerm(new BytesRef(FacetsConfig.pathToString(dim, path)));
+ if (ord < 0) {
+ return -1;
+ }
+
+ return counts.get(ord);
+ }
+
+ @Override
+ public List<FacetResult> getAllDims(int topN) throws IOException {
+
+ List<FacetResult> results = new ArrayList<>();
+ for(Map.Entry<String,OrdRange> ent : state.getPrefixToOrdRange().entrySet()) {
+ FacetResult fr = getDim(ent.getKey(), ent.getValue(), topN);
+ if (fr != null) {
+ results.add(fr);
+ }
+ }
+
+ // Sort by highest count:
+ Collections.sort(results,
+ new Comparator<FacetResult>() {
+ @Override
+ public int compare(FacetResult a, FacetResult b) {
+ if (a.value.intValue() > b.value.intValue()) {
+ return -1;
+ } else if (b.value.intValue() > a.value.intValue()) {
+ return 1;
+ } else {
+ return a.dim.compareTo(b.dim);
+ }
+ }
+ });
+
+ return results;
+ }
+}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/de709b12/lucene/facet/src/java/org/apache/lucene/facet/sortedset/DefaultSortedSetDocValuesReaderState.java
----------------------------------------------------------------------
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/sortedset/DefaultSortedSetDocValuesReaderState.java b/lucene/facet/src/java/org/apache/lucene/facet/sortedset/DefaultSortedSetDocValuesReaderState.java
index cff1cca..832ff3b 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/sortedset/DefaultSortedSetDocValuesReaderState.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/sortedset/DefaultSortedSetDocValuesReaderState.java
@@ -48,7 +48,7 @@ public class DefaultSortedSetDocValuesReaderState extends SortedSetDocValuesRead
private final int valueCount;
/** {@link IndexReader} passed to the constructor. */
- public final IndexReader origReader;
+ public final IndexReader reader;
private final Map<String,OrdinalMap> cachedOrdMaps = new HashMap<>();
@@ -64,7 +64,7 @@ public class DefaultSortedSetDocValuesReaderState extends SortedSetDocValuesRead
* field. */
public DefaultSortedSetDocValuesReaderState(IndexReader reader, String field) throws IOException {
this.field = field;
- this.origReader = reader;
+ this.reader = reader;
// We need this to create thread-safe MultiSortedSetDV
// per collector:
@@ -136,7 +136,7 @@ public class DefaultSortedSetDocValuesReaderState extends SortedSetDocValuesRead
@Override
public String toString() {
- return "DefaultSortedSetDocValuesReaderState(field=" + field + " origReader=" + origReader + ")";
+ return "DefaultSortedSetDocValuesReaderState(field=" + field + " reader=" + reader + ")";
}
/** Return top-level doc values. */
@@ -151,10 +151,10 @@ public class DefaultSortedSetDocValuesReaderState extends SortedSetDocValuesRead
map = cachedOrdMaps.get(field);
if (map == null) {
// uncached, or not a multi dv
- SortedSetDocValues dv = MultiDocValues.getSortedSetValues(origReader, field);
+ SortedSetDocValues dv = MultiDocValues.getSortedSetValues(reader, field);
if (dv instanceof MultiDocValues.MultiSortedSetDocValues) {
map = ((MultiDocValues.MultiSortedSetDocValues)dv).mapping;
- IndexReader.CacheHelper cacheHelper = origReader.getReaderCacheHelper();
+ IndexReader.CacheHelper cacheHelper = reader.getReaderCacheHelper();
if (cacheHelper != null && map.owner == cacheHelper.getKey()) {
cachedOrdMaps.put(field, map);
}
@@ -164,12 +164,12 @@ public class DefaultSortedSetDocValuesReaderState extends SortedSetDocValuesRead
}
assert map != null;
- int size = origReader.leaves().size();
+ int size = reader.leaves().size();
final SortedSetDocValues[] values = new SortedSetDocValues[size];
final int[] starts = new int[size+1];
long cost = 0;
for (int i = 0; i < size; i++) {
- LeafReaderContext context = origReader.leaves().get(i);
+ LeafReaderContext context = reader.leaves().get(i);
final LeafReader reader = context.reader();
final FieldInfo fieldInfo = reader.getFieldInfos().fieldInfo(field);
if (fieldInfo != null && fieldInfo.getDocValuesType() != DocValuesType.SORTED_SET) {
@@ -183,7 +183,7 @@ public class DefaultSortedSetDocValuesReaderState extends SortedSetDocValuesRead
starts[i] = context.docBase;
cost += v.cost();
}
- starts[size] = origReader.maxDoc();
+ starts[size] = reader.maxDoc();
return new MultiSortedSetDocValues(values, starts, map, cost);
}
@@ -206,8 +206,8 @@ public class DefaultSortedSetDocValuesReaderState extends SortedSetDocValuesRead
}
@Override
- public IndexReader getOrigReader() {
- return origReader;
+ public IndexReader getReader() {
+ return reader;
}
/** Number of unique labels. */
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/de709b12/lucene/facet/src/java/org/apache/lucene/facet/sortedset/SortedSetDocValuesFacetCounts.java
----------------------------------------------------------------------
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/sortedset/SortedSetDocValuesFacetCounts.java b/lucene/facet/src/java/org/apache/lucene/facet/sortedset/SortedSetDocValuesFacetCounts.java
index 9ba8547..2198fc0 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/sortedset/SortedSetDocValuesFacetCounts.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/sortedset/SortedSetDocValuesFacetCounts.java
@@ -42,7 +42,6 @@ import org.apache.lucene.index.SortedSetDocValues;
import org.apache.lucene.search.ConjunctionDISI;
import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.search.MatchAllDocsQuery;
-import org.apache.lucene.util.Bits;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.LongValues;
@@ -70,27 +69,25 @@ public class SortedSetDocValuesFacetCounts extends Facets {
final String field;
final int[] counts;
- /** Sparse faceting: returns any dimension that had any
- * hits, topCount labels per dimension. */
- public SortedSetDocValuesFacetCounts(SortedSetDocValuesReaderState state, FacetsCollector hits)
+ /** Returns all facet counts, same result as searching on {@link MatchAllDocsQuery} but faster. */
+ public SortedSetDocValuesFacetCounts(SortedSetDocValuesReaderState state)
throws IOException {
- this.state = state;
- this.field = state.getField();
- dv = state.getDocValues();
- counts = new int[state.getSize()];
- //System.out.println("field=" + field);
- count(hits.getMatchingDocs());
+ this(state, null);
}
- /** Returns all facet counts, same result as searching on {@link MatchAllDocsQuery} but faster. */
- public SortedSetDocValuesFacetCounts(SortedSetDocValuesReaderState state)
+ /** Counts all facet dimensions across the provided hits. */
+ public SortedSetDocValuesFacetCounts(SortedSetDocValuesReaderState state, FacetsCollector hits)
throws IOException {
this.state = state;
this.field = state.getField();
dv = state.getDocValues();
counts = new int[state.getSize()];
- //System.out.println("field=" + field);
- countAll();
+ if (hits == null) {
+ // browse only
+ countAll();
+ } else {
+ count(hits.getMatchingDocs());
+ }
}
@Override
@@ -158,6 +155,83 @@ public class SortedSetDocValuesFacetCounts extends Facets {
return new FacetResult(dim, new String[0], dimCount, labelValues, childCount);
}
+ private void countOneSegment(MultiDocValues.OrdinalMap ordinalMap, LeafReader reader, int segOrd, MatchingDocs hits) throws IOException {
+ SortedSetDocValues segValues = reader.getSortedSetDocValues(field);
+ if (segValues == null) {
+ // nothing to count
+ return;
+ }
+
+ DocIdSetIterator it;
+ if (hits == null) {
+ it = segValues;
+ } else {
+ it = ConjunctionDISI.intersectIterators(Arrays.asList(hits.bits.iterator(), segValues));
+ }
+
+ // TODO: yet another option is to count all segs
+ // first, only in seg-ord space, and then do a
+ // merge-sort-PQ in the end to only "resolve to
+ // global" those seg ords that can compete, if we know
+ // we just want top K? ie, this is the same algo
+ // that'd be used for merging facets across shards
+ // (distributed faceting). but this has much higher
+ // temp ram req'ts (sum of number of ords across all
+ // segs)
+ if (ordinalMap != null) {
+ final LongValues ordMap = ordinalMap.getGlobalOrds(segOrd);
+
+ int numSegOrds = (int) segValues.getValueCount();
+
+ if (hits != null && hits.totalHits < numSegOrds/10) {
+ //System.out.println(" remap as-we-go");
+ // Remap every ord to global ord as we iterate:
+ for (int doc = it.nextDoc(); doc != DocIdSetIterator.NO_MORE_DOCS; doc = it.nextDoc()) {
+ int term = (int) segValues.nextOrd();
+ while (term != SortedSetDocValues.NO_MORE_ORDS) {
+ //System.out.println(" segOrd=" + segOrd + " ord=" + term + " globalOrd=" + ordinalMap.getGlobalOrd(segOrd, term));
+ counts[(int) ordMap.get(term)]++;
+ term = (int) segValues.nextOrd();
+ }
+ }
+ } else {
+ //System.out.println(" count in seg ord first");
+
+ // First count in seg-ord space:
+ final int[] segCounts = new int[numSegOrds];
+ for (int doc = it.nextDoc(); doc != DocIdSetIterator.NO_MORE_DOCS; doc = it.nextDoc()) {
+ int term = (int) segValues.nextOrd();
+ while (term != SortedSetDocValues.NO_MORE_ORDS) {
+ //System.out.println(" ord=" + term);
+ segCounts[term]++;
+ term = (int) segValues.nextOrd();
+ }
+ }
+
+ // Then, migrate to global ords:
+ for(int ord=0;ord<numSegOrds;ord++) {
+ int count = segCounts[ord];
+ if (count != 0) {
+ //System.out.println(" migrate segOrd=" + segOrd + " ord=" + ord + " globalOrd=" + ordinalMap.getGlobalOrd(segOrd, ord));
+ counts[(int) ordMap.get(ord)] += count;
+ }
+ }
+ }
+ } else {
+ // No ord mapping (e.g., single segment index):
+ // just aggregate directly into counts:
+ for (int doc = it.nextDoc(); doc != DocIdSetIterator.NO_MORE_DOCS; doc = it.nextDoc()) {
+ int term = (int) segValues.nextOrd();
+ while (term != SortedSetDocValues.NO_MORE_ORDS) {
+ counts[term]++;
+ term = (int) segValues.nextOrd();
+ }
+ }
+ }
+
+
+ }
+
/** Does all the "real work" of tallying up the counts. */
private final void count(List<MatchingDocs> matchingDocs) throws IOException {
//System.out.println("ssdv count");
@@ -173,88 +247,19 @@ public class SortedSetDocValuesFacetCounts extends Facets {
ordinalMap = null;
}
- IndexReader origReader = state.getOrigReader();
+ IndexReader reader = state.getReader();
for(MatchingDocs hits : matchingDocs) {
- LeafReader reader = hits.context.reader();
- //System.out.println(" reader=" + reader);
// LUCENE-5090: make sure the provided reader context "matches"
// the top-level reader passed to the
// SortedSetDocValuesReaderState, else cryptic
// AIOOBE can happen:
- if (ReaderUtil.getTopLevelContext(hits.context).reader() != origReader) {
+ if (ReaderUtil.getTopLevelContext(hits.context).reader() != reader) {
throw new IllegalStateException("the SortedSetDocValuesReaderState provided to this class does not match the reader being searched; you must create a new SortedSetDocValuesReaderState every time you open a new IndexReader");
}
-
- SortedSetDocValues segValues = reader.getSortedSetDocValues(field);
- if (segValues == null) {
- continue;
- }
- DocIdSetIterator it = ConjunctionDISI.intersectIterators(Arrays.asList(
- hits.bits.iterator(), segValues));
-
- // TODO: yet another option is to count all segs
- // first, only in seg-ord space, and then do a
- // merge-sort-PQ in the end to only "resolve to
- // global" those seg ords that can compete, if we know
- // we just want top K? ie, this is the same algo
- // that'd be used for merging facets across shards
- // (distributed faceting). but this has much higher
- // temp ram req'ts (sum of number of ords across all
- // segs)
- if (ordinalMap != null) {
- final int segOrd = hits.context.ord;
- final LongValues ordMap = ordinalMap.getGlobalOrds(segOrd);
-
- int numSegOrds = (int) segValues.getValueCount();
-
- if (hits.totalHits < numSegOrds/10) {
- //System.out.println(" remap as-we-go");
- // Remap every ord to global ord as we iterate:
- for (int doc = it.nextDoc(); doc != DocIdSetIterator.NO_MORE_DOCS; doc = it.nextDoc()) {
- int term = (int) segValues.nextOrd();
- while (term != SortedSetDocValues.NO_MORE_ORDS) {
- //System.out.println(" segOrd=" + segOrd + " ord=" + term + " globalOrd=" + ordinalMap.getGlobalOrd(segOrd, term));
- counts[(int) ordMap.get(term)]++;
- term = (int) segValues.nextOrd();
- }
- }
- } else {
- //System.out.println(" count in seg ord first");
-
- // First count in seg-ord space:
- final int[] segCounts = new int[numSegOrds];
- for (int doc = it.nextDoc(); doc != DocIdSetIterator.NO_MORE_DOCS; doc = it.nextDoc()) {
- int term = (int) segValues.nextOrd();
- while (term != SortedSetDocValues.NO_MORE_ORDS) {
- //System.out.println(" ord=" + term);
- segCounts[term]++;
- term = (int) segValues.nextOrd();
- }
- }
-
- // Then, migrate to global ords:
- for(int ord=0;ord<numSegOrds;ord++) {
- int count = segCounts[ord];
- if (count != 0) {
- //System.out.println(" migrate segOrd=" + segOrd + " ord=" + ord + " globalOrd=" + ordinalMap.getGlobalOrd(segOrd, ord));
- counts[(int) ordMap.get(ord)] += count;
- }
- }
- }
- } else {
- // No ord mapping (e.g., single segment index):
- // just aggregate directly into counts:
- for (int doc = it.nextDoc(); doc != DocIdSetIterator.NO_MORE_DOCS; doc = it.nextDoc()) {
- int term = (int) segValues.nextOrd();
- while (term != SortedSetDocValues.NO_MORE_ORDS) {
- counts[term]++;
- term = (int) segValues.nextOrd();
- }
- }
- }
+ countOneSegment(ordinalMap, hits.context.reader(), hits.context.ord, hits);
}
}
@@ -273,58 +278,8 @@ public class SortedSetDocValuesFacetCounts extends Facets {
ordinalMap = null;
}
- IndexReader origReader = state.getOrigReader();
-
- for(LeafReaderContext context : origReader.leaves()) {
-
- LeafReader reader = context.reader();
-
- SortedSetDocValues segValues = reader.getSortedSetDocValues(field);
- if (segValues == null) {
- continue;
- }
-
- Bits liveDocs = reader.getLiveDocs();
-
- if (ordinalMap != null) {
- final LongValues ordMap = ordinalMap.getGlobalOrds(context.ord);
-
- int numSegOrds = (int) segValues.getValueCount();
-
- // First count in seg-ord space:
- final int[] segCounts = new int[numSegOrds];
- int docID;
- while ((docID = segValues.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) {
- if (liveDocs == null || liveDocs.get(docID)) {
- int term = (int) segValues.nextOrd();
- while (term != SortedSetDocValues.NO_MORE_ORDS) {
- segCounts[term]++;
- term = (int) segValues.nextOrd();
- }
- }
- }
-
- // Then, migrate to global ords:
- for(int ord=0;ord<numSegOrds;ord++) {
- int count = segCounts[ord];
- if (count != 0) {
- counts[(int) ordMap.get(ord)] += count;
- }
- }
- } else {
- // No ord mapping (e.g., single segment index):
- // just aggregate directly into counts:
- int docID;
- while ((docID = segValues.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) {
- if (liveDocs == null || liveDocs.get(docID)) {
- int term = (int) segValues.nextOrd();
- while (term != SortedSetDocValues.NO_MORE_ORDS) {
- counts[term]++;
- term = (int) segValues.nextOrd();
- }
- }
- }
- }
+ for(LeafReaderContext context : state.getReader().leaves()) {
+ countOneSegment(ordinalMap, context.reader(), context.ord, null);
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/de709b12/lucene/facet/src/java/org/apache/lucene/facet/sortedset/SortedSetDocValuesFacetField.java
----------------------------------------------------------------------
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/sortedset/SortedSetDocValuesFacetField.java b/lucene/facet/src/java/org/apache/lucene/facet/sortedset/SortedSetDocValuesFacetField.java
index 9b6c26e..dd27bc3 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/sortedset/SortedSetDocValuesFacetField.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/sortedset/SortedSetDocValuesFacetField.java
@@ -28,6 +28,7 @@ public class SortedSetDocValuesFacetField extends Field {
/** Indexed {@link FieldType}. */
public static final FieldType TYPE = new FieldType();
static {
+ // NOTE: we don't actually use these index options, because this field is "processed" by FacetsConfig.build()
TYPE.setIndexOptions(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS);
TYPE.freeze();
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/de709b12/lucene/facet/src/java/org/apache/lucene/facet/sortedset/SortedSetDocValuesReaderState.java
----------------------------------------------------------------------
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/sortedset/SortedSetDocValuesReaderState.java b/lucene/facet/src/java/org/apache/lucene/facet/sortedset/SortedSetDocValuesReaderState.java
index 546b319..1fdea85 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/sortedset/SortedSetDocValuesReaderState.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/sortedset/SortedSetDocValuesReaderState.java
@@ -72,9 +72,9 @@ public abstract class SortedSetDocValuesReaderState implements Accountable {
/** Returns mapping from prefix to {@link OrdRange}. */
public abstract Map<String,OrdRange> getPrefixToOrdRange();
-
+
/** Returns top-level index reader. */
- public abstract IndexReader getOrigReader();
+ public abstract IndexReader getReader();
/** Number of unique labels. */
public abstract int getSize();
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/de709b12/lucene/facet/src/test/org/apache/lucene/facet/sortedset/TestSortedSetDocValuesFacets.java
----------------------------------------------------------------------
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/sortedset/TestSortedSetDocValuesFacets.java b/lucene/facet/src/test/org/apache/lucene/facet/sortedset/TestSortedSetDocValuesFacets.java
index 3ad6e68..805eae8 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/sortedset/TestSortedSetDocValuesFacets.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/sortedset/TestSortedSetDocValuesFacets.java
@@ -22,6 +22,10 @@ import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
@@ -42,6 +46,7 @@ import org.apache.lucene.search.TopDocs;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.Accountable;
import org.apache.lucene.util.IOUtils;
+import org.apache.lucene.util.NamedThreadFactory;
import org.apache.lucene.util.TestUtil;
public class TestSortedSetDocValuesFacets extends FacetTestCase {
@@ -76,7 +81,8 @@ public class TestSortedSetDocValuesFacets extends FacetTestCase {
// Per-top-reader state:
SortedSetDocValuesReaderState state = new DefaultSortedSetDocValuesReaderState(searcher.getIndexReader());
- SortedSetDocValuesFacetCounts facets = getAllFacets(searcher, state);
+ ExecutorService exec = randomExecutorServiceOrNull();
+ Facets facets = getAllFacets(searcher, state, exec);
assertEquals("dim=a path=[] value=4 childCount=3\n foo (2)\n bar (1)\n zoo (1)\n", facets.getTopChildren(10, "a").toString());
assertEquals("dim=b path=[] value=1 childCount=1\n baz (1)\n", facets.getTopChildren(10, "b").toString());
@@ -88,6 +94,9 @@ public class TestSortedSetDocValuesFacets extends FacetTestCase {
TopDocs hits = searcher.search(q, 1);
assertEquals(1, hits.totalHits);
+ if (exec != null) {
+ exec.shutdownNow();
+ }
writer.close();
IOUtils.close(searcher.getIndexReader(), dir);
}
@@ -170,7 +179,8 @@ public class TestSortedSetDocValuesFacets extends FacetTestCase {
// Per-top-reader state:
SortedSetDocValuesReaderState state = new DefaultSortedSetDocValuesReaderState(searcher.getIndexReader());
- SortedSetDocValuesFacetCounts facets = getAllFacets(searcher, state);
+ ExecutorService exec = randomExecutorServiceOrNull();
+ Facets facets = getAllFacets(searcher, state, exec);
// Ask for top 10 labels for any dims that have counts:
List<FacetResult> results = facets.getAllDims(10);
@@ -191,6 +201,9 @@ public class TestSortedSetDocValuesFacets extends FacetTestCase {
assertTrue(resources.isEmpty());
}
+ if (exec != null) {
+ exec.shutdownNow();
+ }
searcher.getIndexReader().close();
dir.close();
}
@@ -223,11 +236,15 @@ public class TestSortedSetDocValuesFacets extends FacetTestCase {
// Per-top-reader state:
SortedSetDocValuesReaderState state = new DefaultSortedSetDocValuesReaderState(searcher.getIndexReader());
- SortedSetDocValuesFacetCounts facets = getAllFacets(searcher, state);
+ ExecutorService exec = randomExecutorServiceOrNull();
+ Facets facets = getAllFacets(searcher, state, exec);
// Ask for top 10 labels for any dims that have counts:
assertEquals("dim=a path=[] value=2 childCount=2\n foo1 (1)\n foo2 (1)\n", facets.getTopChildren(10, "a").toString());
+ if (exec != null) {
+ exec.shutdownNow();
+ }
searcher.getIndexReader().close();
dir.close();
}
@@ -258,6 +275,7 @@ public class TestSortedSetDocValuesFacets extends FacetTestCase {
// Per-top-reader state:
SortedSetDocValuesReaderState state = new DefaultSortedSetDocValuesReaderState(searcher.getIndexReader());
+ ExecutorService exec = randomExecutorServiceOrNull();
int iters = atLeast(100);
for(int iter=0;iter<iters;iter++) {
@@ -267,7 +285,12 @@ public class TestSortedSetDocValuesFacets extends FacetTestCase {
}
FacetsCollector fc = new FacetsCollector();
FacetsCollector.search(searcher, new TermQuery(new Term("content", searchToken)), 10, fc);
- Facets facets = new SortedSetDocValuesFacetCounts(state, fc);
+ Facets facets;
+ if (exec != null) {
+ facets = new ConcurrentSortedSetDocValuesFacetCounts(state, fc, exec);
+ } else {
+ facets = new SortedSetDocValuesFacetCounts(state, fc);
+ }
// Slow, yet hopefully bug-free, faceting:
@SuppressWarnings({"rawtypes","unchecked"}) Map<String,Integer>[] expectedCounts = new HashMap[numDims];
@@ -315,17 +338,37 @@ public class TestSortedSetDocValuesFacets extends FacetTestCase {
assertEquals(expected, actual);
}
+ if (exec != null) {
+ exec.shutdownNow();
+ }
w.close();
IOUtils.close(searcher.getIndexReader(), indexDir, taxoDir);
}
- private static SortedSetDocValuesFacetCounts getAllFacets(IndexSearcher searcher, SortedSetDocValuesReaderState state) throws IOException {
+ private static Facets getAllFacets(IndexSearcher searcher, SortedSetDocValuesReaderState state,
+ ExecutorService exec) throws IOException, InterruptedException {
if (random().nextBoolean()) {
FacetsCollector c = new FacetsCollector();
- searcher.search(new MatchAllDocsQuery(), c);
- return new SortedSetDocValuesFacetCounts(state, c);
+ searcher.search(new MatchAllDocsQuery(), c);
+ if (exec != null) {
+ return new ConcurrentSortedSetDocValuesFacetCounts(state, c, exec);
+ } else {
+ return new SortedSetDocValuesFacetCounts(state, c);
+ }
+ } else if (exec != null) {
+ return new ConcurrentSortedSetDocValuesFacetCounts(state, exec);
} else {
return new SortedSetDocValuesFacetCounts(state);
}
}
+
+ private ExecutorService randomExecutorServiceOrNull() {
+ if (random().nextBoolean()) {
+ return null;
+ } else {
+ return new ThreadPoolExecutor(1, TestUtil.nextInt(random(), 2, 6), Long.MAX_VALUE, TimeUnit.MILLISECONDS,
+ new LinkedBlockingQueue<Runnable>(),
+ new NamedThreadFactory("TestIndexSearcher"));
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/de709b12/lucene/replicator/src/java/org/apache/lucene/replicator/nrt/CopyOneFile.java
----------------------------------------------------------------------
diff --git a/lucene/replicator/src/java/org/apache/lucene/replicator/nrt/CopyOneFile.java b/lucene/replicator/src/java/org/apache/lucene/replicator/nrt/CopyOneFile.java
index dd9f16c..7db296b 100644
--- a/lucene/replicator/src/java/org/apache/lucene/replicator/nrt/CopyOneFile.java
+++ b/lucene/replicator/src/java/org/apache/lucene/replicator/nrt/CopyOneFile.java
@@ -49,8 +49,8 @@ public class CopyOneFile implements Closeable {
out = dest.createTempOutput(name, "copy", IOContext.DEFAULT);
tmpName = out.getName();
- // last 8 bytes are checksum:
- bytesToCopy = metaData.length - 8;
+ // last 8 bytes are checksum, which we write ourselves after copying all bytes and confirming checksum:
+ bytesToCopy = metaData.length - Long.BYTES;
if (Node.VERBOSE_FILES) {
dest.message("file " + name + ": start copying to tmp file " + tmpName + " length=" + (8+bytesToCopy));
@@ -101,6 +101,7 @@ public class CopyOneFile implements Closeable {
throw new IOException("file " + name + ": checksum mismatch after file copy");
}
out.writeLong(checksum);
+ bytesCopied += Long.BYTES;
close();
if (Node.VERBOSE_FILES) {
[50/50] [abbrv] lucene-solr:jira/solr-10233: Temporary commit for
SOLR-10524
Posted by tf...@apache.org.
Temporary commit for SOLR-10524
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/b16f0e35
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/b16f0e35
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/b16f0e35
Branch: refs/heads/jira/solr-10233
Commit: b16f0e3531bce9ca600bb53d4bea908c269ce0d1
Parents: 0bb8e47
Author: Tomas Fernandez Lobbe <tf...@apache.org>
Authored: Mon May 8 15:06:26 2017 -0700
Committer: Tomas Fernandez Lobbe <tf...@apache.org>
Committed: Mon May 8 15:06:26 2017 -0700
----------------------------------------------------------------------
.../src/java/org/apache/solr/cloud/overseer/ZkStateWriter.java | 3 +++
.../test/org/apache/solr/cloud/overseer/ZkStateWriterTest.java | 2 ++
2 files changed, 5 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b16f0e35/solr/core/src/java/org/apache/solr/cloud/overseer/ZkStateWriter.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/cloud/overseer/ZkStateWriter.java b/solr/core/src/java/org/apache/solr/cloud/overseer/ZkStateWriter.java
index c7e8c52..1eddeaa 100644
--- a/solr/core/src/java/org/apache/solr/cloud/overseer/ZkStateWriter.java
+++ b/solr/core/src/java/org/apache/solr/cloud/overseer/ZkStateWriter.java
@@ -166,6 +166,9 @@ public class ZkStateWriter {
* @return true if a flush is required, false otherwise
*/
protected boolean maybeFlushBefore(ZkWriteCommand cmd) {
+ if (cmd.collection == null) {
+ return false;
+ }
return cmd.collection.getStateFormat() != lastStateFormat;
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b16f0e35/solr/core/src/test/org/apache/solr/cloud/overseer/ZkStateWriterTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/overseer/ZkStateWriterTest.java b/solr/core/src/test/org/apache/solr/cloud/overseer/ZkStateWriterTest.java
index 85dbf4a..729857f 100644
--- a/solr/core/src/test/org/apache/solr/cloud/overseer/ZkStateWriterTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/overseer/ZkStateWriterTest.java
@@ -35,6 +35,7 @@ import org.apache.solr.common.cloud.SolrZkClient;
import org.apache.solr.common.cloud.ZkStateReader;
import org.apache.solr.common.util.Utils;
import org.apache.zookeeper.KeeperException;
+import org.junit.Ignore;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -42,6 +43,7 @@ public class ZkStateWriterTest extends SolrTestCaseJ4 {
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+ @Ignore
public void testZkStateWriterBatching() throws Exception {
String zkDir = createTempDir("testZkStateWriterBatching").toFile().getAbsolutePath();
[02/50] [abbrv] lucene-solr:jira/solr-10233: * SOLR-10549: (typo fix
in CHANGES.txt)
Posted by tf...@apache.org.
* SOLR-10549: (typo fix in 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/b901d16b
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/b901d16b
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/b901d16b
Branch: refs/heads/jira/solr-10233
Commit: b901d16b9b15e227f4a48fe5891326169d29bd5e
Parents: 037d864
Author: David Smiley <ds...@apache.org>
Authored: Wed May 3 10:07:12 2017 -0400
Committer: David Smiley <ds...@apache.org>
Committed: Wed May 3 10:07:12 2017 -0400
----------------------------------------------------------------------
solr/CHANGES.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b901d16b/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index b443862..75f54c1 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -275,7 +275,7 @@ Bug Fixes
* SOLR-10588: Prevent redundant core reload on config update (Mikhail Khludnev)
-* SOLR-10549: The new 'large' attribute had been forgotten in /schema/fieldstypes?showDefaults=true (David Smiley)
+* SOLR-10549: The new 'large' attribute had been forgotten in /schema/fieldtypes?showDefaults=true (David Smiley)
Other Changes
----------------------
[15/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-7041: Cut over
tests from in schema to df on requests
Posted by tf...@apache.org.
SOLR-7041: Cut over tests from <defaultSearchField> in schema to df on requests
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/e776cbe4
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/e776cbe4
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/e776cbe4
Branch: refs/heads/jira/solr-10233
Commit: e776cbe4464e52a28ceffd9fa46d7c47ed44bb57
Parents: de709b1
Author: Jan Høydahl <ja...@apache.org>
Authored: Fri May 5 00:53:50 2017 +0200
Committer: Jan Høydahl <ja...@apache.org>
Committed: Fri May 5 00:53:50 2017 +0200
----------------------------------------------------------------------
solr/CHANGES.txt | 2 +
.../collection1/conf/schema-folding-extra.xml | 1 -
.../collection1/conf/schema-icucollate-dv.xml | 1 -
.../solr/collection1/conf/schema-icucollate.xml | 1 -
.../conf/schema-icucollateoptions.xml | 1 -
.../clustering/solr/collection1/conf/schema.xml | 3 -
.../conf/dataimport-schema-no-unique-key.xml | 3 -
.../solr/collection1/conf/dataimport-schema.xml | 1 -
.../conf/dataimport-solr_id-schema.xml | 3 -
.../collection1/conf/dataimport-solrconfig.xml | 1 +
.../dataimport/TestContentStreamDataSource.java | 2 +-
.../extraction/solr/collection1/conf/schema.xml | 1 -
.../extraction/TestXLSXResponseWriter.java | 2 +-
.../langid/solr/collection1/conf/schema.xml | 1 -
.../uima/solr/collection1/conf/schema.xml | 6 --
.../test-files/uima/uima-tokenizers-schema.xml | 6 --
.../velocity/solr/collection1/conf/schema.xml | 2 -
.../solr/analysisconfs/analysis-err-schema.xml | 1 -
.../conf/schema-HighlighterMaxOffsetTest.xml | 1 -
.../conf/schema-blockjoinfacetcomponent.xml | 1 -
.../solr/collection1/conf/schema-bm25.xml | 1 -
.../collection1/conf/schema-charfilters.xml | 1 -
.../solr/collection1/conf/schema-collate-dv.xml | 1 -
.../solr/collection1/conf/schema-collate.xml | 1 -
.../collection1/conf/schema-copyfield-test.xml | 1 -
.../collection1/conf/schema-custom-field.xml | 1 -
.../solr/collection1/conf/schema-dfi.xml | 1 -
.../solr/collection1/conf/schema-dfr.xml | 1 -
.../conf/schema-distrib-interval-faceting.xml | 1 -
.../conf/schema-docValuesFaceting.xml | 1 -
.../collection1/conf/schema-docValuesJoin.xml | 1 -
.../conf/schema-field-sort-values.xml | 1 -
.../solr/collection1/conf/schema-folding.xml | 1 -
.../solr/collection1/conf/schema-hash.xml | 1 -
.../solr/collection1/conf/schema-ib.xml | 1 -
.../collection1/conf/schema-lmdirichlet.xml | 1 -
.../collection1/conf/schema-lmjelinekmercer.xml | 1 -
.../conf/schema-not-required-unique-key.xml | 1 -
.../collection1/conf/schema-phrasesuggest.xml | 1 -
.../conf/schema-postingshighlight.xml | 1 -
.../collection1/conf/schema-psuedo-fields.xml | 3 +-
.../collection1/conf/schema-required-fields.xml | 1 -
.../solr/collection1/conf/schema-rest.xml | 1 -
.../solr/collection1/conf/schema-reversed.xml | 1 -
.../solr/collection1/conf/schema-sim.xml | 1 -
.../collection1/conf/schema-simpleqpplugin.xml | 1 -
.../conf/schema-single-dynamic-copy-field.xml | 1 -
.../collection1/conf/schema-spellchecker.xml | 3 -
.../solr/collection1/conf/schema-sql.xml | 1 -
.../solr/collection1/conf/schema-stop-keep.xml | 59 --------------------
.../solr/collection1/conf/schema-sweetspot.xml | 1 -
.../conf/schema-synonym-tokenizer.xml | 1 -
.../solr/collection1/conf/schema-tfidf.xml | 1 -
.../solr/collection1/conf/schema-trie.xml | 4 --
.../conf/schema-unifiedhighlight.xml | 1 -
.../test-files/solr/collection1/conf/schema.xml | 1 -
.../solr/collection1/conf/schema11.xml | 12 ++--
.../solr/collection1/conf/schema12.xml | 1 -
.../solr/collection1/conf/schema15.xml | 1 -
.../solr/collection1/conf/schema_codec.xml | 1 -
.../solr/collection1/conf/schemasurround.xml | 1 -
.../conf/solrconfig-cache-enable-disable.xml | 8 ++-
.../conf/solrconfig-collapseqparser.xml | 5 ++
.../collection1/conf/solrconfig-elevate.xml | 6 ++
.../conf/solrconfig-functionquery.xml | 5 ++
.../conf/solrconfig-managed-schema.xml | 6 ++
.../collection1/conf/solrconfig-minimal.xml | 6 ++
.../collection1/conf/solrconfig-nocache.xml | 6 ++
.../conf/solrconfig-plugcollector.xml | 6 ++
.../conf/solrconfig-postingshighlight.xml | 1 +
.../conf/solrconfig-response-log-component.xml | 6 ++
.../solrconfig-sortingmergepolicyfactory.xml | 5 ++
.../conf/solrconfig-spellcheckcomponent.xml | 5 ++
.../solrconfig-tlog-with-delayingcomponent.xml | 5 ++
.../solr/collection1/conf/solrconfig-tlog.xml | 6 ++
.../solr/collection1/conf/solrconfig.xml | 6 ++
.../configsets/cloud-dynamic/conf/schema.xml | 1 -
.../solr/configsets/doc-expiry/conf/schema.xml | 1 -
.../test-files/solr/crazy-path-to-config.xml | 7 +++
.../test-files/solr/crazy-path-to-schema.xml | 1 -
.../apache/solr/TestDistributedGrouping.java | 4 +-
.../apache/solr/core/TestSolrConfigHandler.java | 4 +-
.../highlight/HighlighterMaxOffsetTest.java | 3 +-
.../schema/TestDefaultSearchFieldResource.java | 28 ----------
.../solr/rest/schema/TestSchemaResource.java | 7 +--
.../apache/solr/search/QueryEqualityTest.java | 9 ++-
.../apache/solr/search/QueryParsingTest.java | 4 +-
.../solr/search/TestExtendedDismaxParser.java | 3 +
.../solr/search/TestMaxScoreQueryParser.java | 4 +-
.../solr/search/TestReRankQParserPlugin.java | 6 ++
.../solr/search/TestSimpleQParserPlugin.java | 4 +-
.../search/join/BlockJoinFacetRandomTest.java | 1 +
.../apache/solr/util/SolrPluginUtilsTest.java | 7 ++-
.../solrj/solr/collection1/conf/schema-sql.xml | 1 -
.../solrj/solr/collection1/conf/schema.xml | 1 -
.../solr/configsets/shared/conf/schema.xml | 3 -
.../solr/configsets/shared/conf/solrconfig.xml | 6 ++
.../solr/configsets/streaming/conf/schema.xml | 1 -
.../configsets/streaming/conf/solrconfig.xml | 8 ++-
.../solrj/solr/crazy-path-to-schema.xml | 1 -
.../solrj/solr/multicore/core0/conf/schema.xml | 3 -
.../solr/multicore/core0/conf/solrconfig.xml | 6 ++
.../solrj/solr/multicore/core1/conf/schema.xml | 3 -
.../solr/multicore/core1/conf/solrconfig.xml | 6 ++
104 files changed, 158 insertions(+), 214 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index ddf694a..f9576c2 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -335,6 +335,8 @@ Other Changes
* SOLR-9867: Adding isLoading=true as core status. Fixing start after stop scenario in bin/solr
(Andrey Kudryavtsev, Mikhail Khludnev)
+* SOLR-7041: Cutover tests to using 'q.op' and 'df' instead of schema 'defaultOperator' and 'defaultSearchField' (janhoy)
+
================== 6.5.1 ==================
Bug Fixes
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/collection1/conf/schema-folding-extra.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/collection1/conf/schema-folding-extra.xml b/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/collection1/conf/schema-folding-extra.xml
index 8e13cf6..573ca53 100644
--- a/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/collection1/conf/schema-folding-extra.xml
+++ b/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/collection1/conf/schema-folding-extra.xml
@@ -47,7 +47,6 @@
<field name="content_icutransform" type="text_icutransform" indexed="true" stored="true"/>
- <defaultSearchField>id</defaultSearchField>
<uniqueKey>id</uniqueKey>
</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/collection1/conf/schema-icucollate-dv.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/collection1/conf/schema-icucollate-dv.xml b/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/collection1/conf/schema-icucollate-dv.xml
index 3631077..1e2029d 100644
--- a/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/collection1/conf/schema-icucollate-dv.xml
+++ b/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/collection1/conf/schema-icucollate-dv.xml
@@ -46,7 +46,6 @@
<field name="sort_da" type="sort_da_t" indexed="false" stored="false" multiValued="false" docValues="true"/>
<field name="sort_custom" type="sort_custom_t" indexed="false" stored="false" multiValued="true" docValues="true"/>
- <defaultSearchField>text</defaultSearchField>
<uniqueKey>id</uniqueKey>
<!-- copy our text to some sort fields with different orders -->
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/collection1/conf/schema-icucollate.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/collection1/conf/schema-icucollate.xml b/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/collection1/conf/schema-icucollate.xml
index 563669a..1d121f2 100644
--- a/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/collection1/conf/schema-icucollate.xml
+++ b/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/collection1/conf/schema-icucollate.xml
@@ -46,7 +46,6 @@
<field name="sort_custom" type="sort_custom_t" indexed="true" stored="false" multiValued="false"/>
- <defaultSearchField>text</defaultSearchField>
<uniqueKey>id</uniqueKey>
<!-- copy our text to some sort fields with different orders -->
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/collection1/conf/schema-icucollateoptions.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/collection1/conf/schema-icucollateoptions.xml b/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/collection1/conf/schema-icucollateoptions.xml
index 525b73f..cc8e340 100644
--- a/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/collection1/conf/schema-icucollateoptions.xml
+++ b/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/collection1/conf/schema-icucollateoptions.xml
@@ -57,7 +57,6 @@
<field name="sort_uppercase_first" type="sort_uppercase_first_t" indexed="true" stored="false" multiValued="false"/>
- <defaultSearchField>text</defaultSearchField>
<uniqueKey>id</uniqueKey>
<!-- copy our text to some sort fields with different orders -->
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/contrib/clustering/src/test-files/clustering/solr/collection1/conf/schema.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/clustering/src/test-files/clustering/solr/collection1/conf/schema.xml b/solr/contrib/clustering/src/test-files/clustering/solr/collection1/conf/schema.xml
index 254cc85..66a6223 100644
--- a/solr/contrib/clustering/src/test-files/clustering/solr/collection1/conf/schema.xml
+++ b/solr/contrib/clustering/src/test-files/clustering/solr/collection1/conf/schema.xml
@@ -334,9 +334,6 @@
-->
<uniqueKey>id</uniqueKey>
- <!-- field for the QueryParser to use when an explicit fieldname is absent -->
- <defaultSearchField>text</defaultSearchField>
-
<!-- copyField commands copy one field to another at the time a document
is added to the index. It's used either to index the same field differently,
or to add multiple fields to the same field for easier/faster searching. -->
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/contrib/dataimporthandler-extras/src/test-files/dihextras/solr/collection1/conf/dataimport-schema-no-unique-key.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/dataimporthandler-extras/src/test-files/dihextras/solr/collection1/conf/dataimport-schema-no-unique-key.xml b/solr/contrib/dataimporthandler-extras/src/test-files/dihextras/solr/collection1/conf/dataimport-schema-no-unique-key.xml
index bfe918c..ad01778 100644
--- a/solr/contrib/dataimporthandler-extras/src/test-files/dihextras/solr/collection1/conf/dataimport-schema-no-unique-key.xml
+++ b/solr/contrib/dataimporthandler-extras/src/test-files/dihextras/solr/collection1/conf/dataimport-schema-no-unique-key.xml
@@ -202,7 +202,4 @@
<field name="text" type="text" indexed="true" stored="true"/>
<field name="foo_i" type="int" indexed="true" stored="false"/>
<field name="home" type="latLon" indexed="true" stored="true"/>
-
- <!-- field for the QueryParser to use when an explicit fieldname is absent -->
- <defaultSearchField>text</defaultSearchField>
</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/contrib/dataimporthandler/src/test-files/dih/solr/collection1/conf/dataimport-schema.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/dataimporthandler/src/test-files/dih/solr/collection1/conf/dataimport-schema.xml b/solr/contrib/dataimporthandler/src/test-files/dih/solr/collection1/conf/dataimport-schema.xml
index e770523..7f34e00 100644
--- a/solr/contrib/dataimporthandler/src/test-files/dih/solr/collection1/conf/dataimport-schema.xml
+++ b/solr/contrib/dataimporthandler/src/test-files/dih/solr/collection1/conf/dataimport-schema.xml
@@ -67,5 +67,4 @@
<dynamicField name="*_dt" type="date" indexed="true" stored="true"/>
<uniqueKey>id</uniqueKey>
- <defaultSearchField>desc</defaultSearchField>
</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/contrib/dataimporthandler/src/test-files/dih/solr/collection1/conf/dataimport-solr_id-schema.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/dataimporthandler/src/test-files/dih/solr/collection1/conf/dataimport-solr_id-schema.xml b/solr/contrib/dataimporthandler/src/test-files/dih/solr/collection1/conf/dataimport-solr_id-schema.xml
index 8927bce..fabe7e2 100644
--- a/solr/contrib/dataimporthandler/src/test-files/dih/solr/collection1/conf/dataimport-solr_id-schema.xml
+++ b/solr/contrib/dataimporthandler/src/test-files/dih/solr/collection1/conf/dataimport-solr_id-schema.xml
@@ -310,7 +310,4 @@
Unless this field is marked with required="false", it will be a required field
-->
<uniqueKey>solr_id</uniqueKey>
-
- <!-- field for the QueryParser to use when an explicit fieldname is absent -->
- <defaultSearchField>desc</defaultSearchField>
</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/contrib/dataimporthandler/src/test-files/dih/solr/collection1/conf/dataimport-solrconfig.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/dataimporthandler/src/test-files/dih/solr/collection1/conf/dataimport-solrconfig.xml b/solr/contrib/dataimporthandler/src/test-files/dih/solr/collection1/conf/dataimport-solrconfig.xml
index e3fb314..1029373 100644
--- a/solr/contrib/dataimporthandler/src/test-files/dih/solr/collection1/conf/dataimport-solrconfig.xml
+++ b/solr/contrib/dataimporthandler/src/test-files/dih/solr/collection1/conf/dataimport-solrconfig.xml
@@ -232,6 +232,7 @@
<!-- default values for query parameters -->
<lst name="defaults">
<str name="echoParams">explicit</str>
+ <str name="df">desc</str>
<!--
<int name="rows">10</int>
<str name="fl">*</str>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestContentStreamDataSource.java
----------------------------------------------------------------------
diff --git a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestContentStreamDataSource.java b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestContentStreamDataSource.java
index 089a133..06fd51c 100644
--- a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestContentStreamDataSource.java
+++ b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestContentStreamDataSource.java
@@ -92,7 +92,7 @@ public class TestContentStreamDataSource extends AbstractDataImportHandlerTestCa
try (HttpSolrClient solrServer = getHttpSolrClient(buildUrl(jetty.getLocalPort(), "/solr/collection1"))) {
solrServer.request(req);
Thread.sleep(100);
- ModifiableSolrParams queryAll = params("q", "*");
+ ModifiableSolrParams queryAll = params("q", "*", "df", "desc");
QueryResponse qres = solrServer.query(queryAll);
SolrDocumentList results = qres.getResults();
assertEquals(0, results.getNumFound());
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/contrib/extraction/src/test-files/extraction/solr/collection1/conf/schema.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/extraction/src/test-files/extraction/solr/collection1/conf/schema.xml b/solr/contrib/extraction/src/test-files/extraction/solr/collection1/conf/schema.xml
index b65c345..2865653 100644
--- a/solr/contrib/extraction/src/test-files/extraction/solr/collection1/conf/schema.xml
+++ b/solr/contrib/extraction/src/test-files/extraction/solr/collection1/conf/schema.xml
@@ -478,7 +478,6 @@
<dynamicField name="ignored_*" type="text" indexed="false" stored="false"/>
- <defaultSearchField>text</defaultSearchField>
<uniqueKey>id</uniqueKey>
<!-- copyField commands copy one field to another at the time a document
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/contrib/extraction/src/test/org/apache/solr/handler/extraction/TestXLSXResponseWriter.java
----------------------------------------------------------------------
diff --git a/solr/contrib/extraction/src/test/org/apache/solr/handler/extraction/TestXLSXResponseWriter.java b/solr/contrib/extraction/src/test/org/apache/solr/handler/extraction/TestXLSXResponseWriter.java
index fd4e63d..5c79f0d 100644
--- a/solr/contrib/extraction/src/test/org/apache/solr/handler/extraction/TestXLSXResponseWriter.java
+++ b/solr/contrib/extraction/src/test/org/apache/solr/handler/extraction/TestXLSXResponseWriter.java
@@ -218,7 +218,7 @@ public class TestXLSXResponseWriter extends SolrTestCaseJ4 {
assertEquals("1,0,hi", lines[1] );
//assertions specific to multiple pseudofields functions like abs, div, exists, etc.. (SOLR-5423)
- String funcText = getStringFromSheet(getWSResultForQuery(req("q","*", "wt","xlsx", "fl","XXX:id,YYY:exists(foo_s1)")));
+ String funcText = getStringFromSheet(getWSResultForQuery(req("df", "text", "q","*", "wt","xlsx", "fl","XXX:id,YYY:exists(foo_s1)")));
String[] funcLines = funcText.split("\n");
assertEquals(5, funcLines.length);
assertEquals("XXX,YYY", funcLines[0] );
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/contrib/langid/src/test-files/langid/solr/collection1/conf/schema.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/langid/src/test-files/langid/solr/collection1/conf/schema.xml b/solr/contrib/langid/src/test-files/langid/solr/collection1/conf/schema.xml
index 8fe71e9..5e52e99 100644
--- a/solr/contrib/langid/src/test-files/langid/solr/collection1/conf/schema.xml
+++ b/solr/contrib/langid/src/test-files/langid/solr/collection1/conf/schema.xml
@@ -68,7 +68,6 @@
<dynamicField name="subject_*" type="string" indexed="true" stored="false"/>
- <defaultSearchField>name</defaultSearchField>
<uniqueKey>id</uniqueKey>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/contrib/uima/src/test-files/uima/solr/collection1/conf/schema.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/uima/src/test-files/uima/solr/collection1/conf/schema.xml b/solr/contrib/uima/src/test-files/uima/solr/collection1/conf/schema.xml
index e15fed8..35d3131 100644
--- a/solr/contrib/uima/src/test-files/uima/solr/collection1/conf/schema.xml
+++ b/solr/contrib/uima/src/test-files/uima/solr/collection1/conf/schema.xml
@@ -579,12 +579,6 @@
<uniqueKey>id</uniqueKey>
<!--
- field for the QueryParser to use when an explicit fieldname is
- absent
- -->
- <defaultSearchField>text</defaultSearchField>
-
- <!--
copyField commands copy one field to another at the time a document
is added to the index. It's used either to index the same field
differently, or to add multiple fields to the same field for
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/contrib/uima/src/test-files/uima/uima-tokenizers-schema.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/uima/src/test-files/uima/uima-tokenizers-schema.xml b/solr/contrib/uima/src/test-files/uima/uima-tokenizers-schema.xml
index 38241fc..bf4c72d 100644
--- a/solr/contrib/uima/src/test-files/uima/uima-tokenizers-schema.xml
+++ b/solr/contrib/uima/src/test-files/uima/uima-tokenizers-schema.xml
@@ -577,12 +577,6 @@
<uniqueKey>id</uniqueKey>
<!--
- field for the QueryParser to use when an explicit fieldname is
- absent
- -->
- <defaultSearchField>text</defaultSearchField>
-
- <!--
copyField commands copy one field to another at the time a document
is added to the index. It's used either to index the same field
differently, or to add multiple fields to the same field for
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/contrib/velocity/src/test-files/velocity/solr/collection1/conf/schema.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/velocity/src/test-files/velocity/solr/collection1/conf/schema.xml b/solr/contrib/velocity/src/test-files/velocity/solr/collection1/conf/schema.xml
index e156406..5b12cda 100644
--- a/solr/contrib/velocity/src/test-files/velocity/solr/collection1/conf/schema.xml
+++ b/solr/contrib/velocity/src/test-files/velocity/solr/collection1/conf/schema.xml
@@ -23,6 +23,4 @@
<dynamicField name="*_s" type="string" indexed="true" stored="true"/>
<uniqueKey>id</uniqueKey>
-
- <defaultSearchField>id</defaultSearchField>
</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/analysisconfs/analysis-err-schema.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/analysisconfs/analysis-err-schema.xml b/solr/core/src/test-files/solr/analysisconfs/analysis-err-schema.xml
index 54f1b1c..168df6b 100644
--- a/solr/core/src/test-files/solr/analysisconfs/analysis-err-schema.xml
+++ b/solr/core/src/test-files/solr/analysisconfs/analysis-err-schema.xml
@@ -36,6 +36,5 @@
<field name="text" type="text" indexed="true" stored="true"/>
<field name="_version_" type="long"/>
- <defaultSearchField>text</defaultSearchField>
<uniqueKey>id</uniqueKey>
</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-HighlighterMaxOffsetTest.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-HighlighterMaxOffsetTest.xml b/solr/core/src/test-files/solr/collection1/conf/schema-HighlighterMaxOffsetTest.xml
index b13f598..c447222 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-HighlighterMaxOffsetTest.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-HighlighterMaxOffsetTest.xml
@@ -37,7 +37,6 @@ Test for HighlighterMaxOffsetTest which requires the use of ReversedWildcardFilt
<uniqueKey>id</uniqueKey>
- <defaultSearchField>content</defaultSearchField>
<fieldType name="string" class="solr.StrField" sortMissingLast="true"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-blockjoinfacetcomponent.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-blockjoinfacetcomponent.xml b/solr/core/src/test-files/solr/collection1/conf/schema-blockjoinfacetcomponent.xml
index 9ea5ec7..e262b73 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-blockjoinfacetcomponent.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-blockjoinfacetcomponent.xml
@@ -36,6 +36,5 @@
<dynamicField name="*_f_multi" type="float" indexed="true" stored="true" docValues="true" multiValued="true"/>
- <defaultSearchField>name</defaultSearchField>
<uniqueKey>id</uniqueKey>
</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-bm25.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-bm25.xml b/solr/core/src/test-files/solr/collection1/conf/schema-bm25.xml
index ad76b6e..13924b7 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-bm25.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-bm25.xml
@@ -41,7 +41,6 @@
<field name="text" type="text" indexed="true" stored="false"/>
<field name="text_params" type="text_params" indexed="true" stored="false"/>
- <defaultSearchField>text</defaultSearchField>
<uniqueKey>id</uniqueKey>
</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-charfilters.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-charfilters.xml b/solr/core/src/test-files/solr/collection1/conf/schema-charfilters.xml
index 852c9cf..11e2aa7 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-charfilters.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-charfilters.xml
@@ -42,7 +42,6 @@
<field name="content" type="text" indexed="true" stored="true"/>
<field name="content2" type="text2" indexed="true" stored="true"/>
- <defaultSearchField>content</defaultSearchField>
<uniqueKey>id</uniqueKey>
</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-collate-dv.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-collate-dv.xml b/solr/core/src/test-files/solr/collection1/conf/schema-collate-dv.xml
index 20d2da0..af74654 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-collate-dv.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-collate-dv.xml
@@ -47,7 +47,6 @@
<field name="sort_da" type="sort_da_t" indexed="false" stored="false" multiValued="false" docValues="true"/>
<field name="sort_custom" type="sort_custom_t" indexed="false" stored="false" multiValued="true" docValues="true"/>
- <defaultSearchField>text</defaultSearchField>
<uniqueKey>id</uniqueKey>
<!-- copy our text to some sort fields with different orders -->
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-collate.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-collate.xml b/solr/core/src/test-files/solr/collection1/conf/schema-collate.xml
index 5167134..d5c4d69 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-collate.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-collate.xml
@@ -46,7 +46,6 @@
<field name="sort_da" type="sort_da_t" indexed="true" stored="false" multiValued="false"/>
<field name="sort_custom" type="sort_custom_t" indexed="true" stored="false" multiValued="false"/>
- <defaultSearchField>text</defaultSearchField>
<uniqueKey>id</uniqueKey>
<!-- copy our text to some sort fields with different orders -->
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-copyfield-test.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-copyfield-test.xml b/solr/core/src/test-files/solr/collection1/conf/schema-copyfield-test.xml
index 665114a..c16bf55 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-copyfield-test.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-copyfield-test.xml
@@ -462,7 +462,6 @@
termVectors="true" termPositions="true" termOffsets="true"/>
- <defaultSearchField>text</defaultSearchField>
<uniqueKey>id</uniqueKey>
<!-- copyField commands copy one field to another at the time a document
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-custom-field.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-custom-field.xml b/solr/core/src/test-files/solr/collection1/conf/schema-custom-field.xml
index cdf5dee..58c40d5 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-custom-field.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-custom-field.xml
@@ -36,6 +36,5 @@
<!-- catchall wildcard to help ensure we aren't breaking function sorting -->
<dynamicField name="*" type="string" indexed="true" stored="true"/>
- <defaultSearchField>text</defaultSearchField>
<uniqueKey>id</uniqueKey>
</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-dfi.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-dfi.xml b/solr/core/src/test-files/solr/collection1/conf/schema-dfi.xml
index 038ce51..c3dc509 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-dfi.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-dfi.xml
@@ -43,7 +43,6 @@
<field name="text" type="text" indexed="true" stored="false"/>
<field name="text_params" type="text_params" indexed="true" stored="false"/>
- <defaultSearchField>text</defaultSearchField>
<uniqueKey>id</uniqueKey>
<similarity class="solr.SchemaSimilarityFactory"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-dfr.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-dfr.xml b/solr/core/src/test-files/solr/collection1/conf/schema-dfr.xml
index f99a776..4b27707 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-dfr.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-dfr.xml
@@ -59,7 +59,6 @@
<field name="text_params" type="text_params" indexed="true" stored="false"/>
<field name="text_paramc" type="text_paramc" indexed="true" stored="false"/>
- <defaultSearchField>text</defaultSearchField>
<uniqueKey>id</uniqueKey>
</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-distrib-interval-faceting.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-distrib-interval-faceting.xml b/solr/core/src/test-files/solr/collection1/conf/schema-distrib-interval-faceting.xml
index e843e0a..37da642 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-distrib-interval-faceting.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-distrib-interval-faceting.xml
@@ -73,7 +73,6 @@
<dynamicField name="*_d1" type="double" indexed="true" stored="true" multiValued="false"/>
<dynamicField name="*_dt1" type="date" indexed="true" stored="true" multiValued="false"/>
- <defaultSearchField>id</defaultSearchField>
<uniqueKey>id</uniqueKey>
<copyField source="*_i" dest="*_i_dv"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-docValuesFaceting.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-docValuesFaceting.xml b/solr/core/src/test-files/solr/collection1/conf/schema-docValuesFaceting.xml
index 0917ff5..571d915 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-docValuesFaceting.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-docValuesFaceting.xml
@@ -64,7 +64,6 @@
<dynamicField name="*_dt_dv" type="${solr.tests.dateClass:pdate}" indexed="true" stored="false" docValues="true"/>
<dynamicField name="*_dts_dv" type="${solr.tests.dateClass:pdate}" indexed="true" stored="false" docValues="true" multiValued="true"/>
- <defaultSearchField>id</defaultSearchField>
<uniqueKey>id</uniqueKey>
<copyField source="*_i" dest="*_i_dv"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-docValuesJoin.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-docValuesJoin.xml b/solr/core/src/test-files/solr/collection1/conf/schema-docValuesJoin.xml
index d152d98..d2188fc 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-docValuesJoin.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-docValuesJoin.xml
@@ -93,7 +93,6 @@
<field name="_version_" type="long" indexed="true" stored="true" multiValued="false"/>
- <defaultSearchField>id</defaultSearchField>
<uniqueKey>id</uniqueKey>
<copyField source="*_i" dest="*_i_dv"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-field-sort-values.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-field-sort-values.xml b/solr/core/src/test-files/solr/collection1/conf/schema-field-sort-values.xml
index f678663..0cd22b0 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-field-sort-values.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-field-sort-values.xml
@@ -32,6 +32,5 @@
<field name="payload" type="wrapped_int" indexed="false"
stored="true" multiValued="false" docValues="true" required="true"/>
- <defaultSearchField>text</defaultSearchField>
<uniqueKey>id</uniqueKey>
</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-folding.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-folding.xml b/solr/core/src/test-files/solr/collection1/conf/schema-folding.xml
index 2b0bf32..5962136 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-folding.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-folding.xml
@@ -256,7 +256,6 @@
<dynamicField name="*_fr" type="text_fr" indexed="true" stored="true"/>
- <defaultSearchField>content</defaultSearchField>
<uniqueKey>id</uniqueKey>
</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-hash.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-hash.xml b/solr/core/src/test-files/solr/collection1/conf/schema-hash.xml
index 6a7987c..07ef7b1 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-hash.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-hash.xml
@@ -609,7 +609,6 @@
<dynamicField name="*_sim3" type="sim3" indexed="true" stored="true"/>
-->
- <defaultSearchField>text</defaultSearchField>
<uniqueKey>id</uniqueKey>
<!-- copyField commands copy one field to another at the time a document
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-ib.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-ib.xml b/solr/core/src/test-files/solr/collection1/conf/schema-ib.xml
index db7d5a3..e477e25 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-ib.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-ib.xml
@@ -46,7 +46,6 @@
<field name="text" type="text" indexed="true" stored="false"/>
<field name="text_params" type="text_params" indexed="true" stored="false"/>
- <defaultSearchField>text</defaultSearchField>
<uniqueKey>id</uniqueKey>
</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-lmdirichlet.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-lmdirichlet.xml b/solr/core/src/test-files/solr/collection1/conf/schema-lmdirichlet.xml
index 063957b..a51685e 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-lmdirichlet.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-lmdirichlet.xml
@@ -39,7 +39,6 @@
<field name="text" type="text" indexed="true" stored="false"/>
<field name="text_params" type="text_params" indexed="true" stored="false"/>
- <defaultSearchField>text</defaultSearchField>
<uniqueKey>id</uniqueKey>
</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-lmjelinekmercer.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-lmjelinekmercer.xml b/solr/core/src/test-files/solr/collection1/conf/schema-lmjelinekmercer.xml
index e137bd7..7c0fcd3 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-lmjelinekmercer.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-lmjelinekmercer.xml
@@ -39,7 +39,6 @@
<field name="text" type="text" indexed="true" stored="false"/>
<field name="text_params" type="text_params" indexed="true" stored="false"/>
- <defaultSearchField>text</defaultSearchField>
<uniqueKey>id</uniqueKey>
</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-not-required-unique-key.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-not-required-unique-key.xml b/solr/core/src/test-files/solr/collection1/conf/schema-not-required-unique-key.xml
index fa61c89..e2bbef3 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-not-required-unique-key.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-not-required-unique-key.xml
@@ -36,6 +36,5 @@
<field name="signatureField" type="string" indexed="true" stored="false"/>
<dynamicField name="*_sS" type="string" indexed="false" stored="true"/>
- <defaultSearchField>subject</defaultSearchField>
<uniqueKey>id</uniqueKey>
</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-phrasesuggest.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-phrasesuggest.xml b/solr/core/src/test-files/solr/collection1/conf/schema-phrasesuggest.xml
index 0c8261c..0bc78d6 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-phrasesuggest.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-phrasesuggest.xml
@@ -52,6 +52,5 @@
<field name="text" type="text" indexed="true" stored="false"/>
<field name="stext" type="text" indexed="true" stored="true"/>
- <defaultSearchField>text</defaultSearchField>
<uniqueKey>id</uniqueKey>
</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-postingshighlight.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-postingshighlight.xml b/solr/core/src/test-files/solr/collection1/conf/schema-postingshighlight.xml
index cdacba4..18aa51a 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-postingshighlight.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-postingshighlight.xml
@@ -42,6 +42,5 @@
<field name="text2" type="text" indexed="true" stored="true"/>
<field name="text3" type="text_offsets" indexed="true" stored="true"/>
- <defaultSearchField>text</defaultSearchField>
<uniqueKey>id</uniqueKey>
</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-psuedo-fields.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-psuedo-fields.xml b/solr/core/src/test-files/solr/collection1/conf/schema-psuedo-fields.xml
index f3b0e30..5e048bd 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-psuedo-fields.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-psuedo-fields.xml
@@ -35,8 +35,7 @@
<dynamicField name="*" type="string" indexed="true" stored="true" />
<uniqueKey>id</uniqueKey>
- <defaultSearchField>text</defaultSearchField>
-
+
<fieldType name="ignored" class="solr.StrField" indexed="false" stored="false"/>
<fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
<fieldType name="long" class="solr.TrieLongField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-required-fields.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-required-fields.xml b/solr/core/src/test-files/solr/collection1/conf/schema-required-fields.xml
index cf980ca..f394bbb 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-required-fields.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-required-fields.xml
@@ -426,7 +426,6 @@
<dynamicField name="*aaa" type="int" indexed="false" stored="true"/>
- <defaultSearchField>text</defaultSearchField>
<uniqueKey>id</uniqueKey>
<!-- copyField commands copy one field to another at the time a document
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-rest.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-rest.xml b/solr/core/src/test-files/solr/collection1/conf/schema-rest.xml
index ca50051..3233258 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-rest.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-rest.xml
@@ -657,7 +657,6 @@
<dynamicField name="random_*" type="random"/>
- <defaultSearchField>text</defaultSearchField>
<uniqueKey>id</uniqueKey>
<copyField source="title" dest="title_stemmed" maxChars="200"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-reversed.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-reversed.xml b/solr/core/src/test-files/solr/collection1/conf/schema-reversed.xml
index 8730e93..63887cb 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-reversed.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-reversed.xml
@@ -77,7 +77,6 @@
<dynamicField name="*_sS" type="string" indexed="false" stored="true"/>
- <defaultSearchField>one</defaultSearchField>
<uniqueKey>id</uniqueKey>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-sim.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-sim.xml b/solr/core/src/test-files/solr/collection1/conf/schema-sim.xml
index cffd1e5..68c4d6d 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-sim.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-sim.xml
@@ -56,7 +56,6 @@
<dynamicField name="*_sim2" type="sim2" indexed="true" stored="true"/>
<dynamicField name="*_sim3" type="sim3" indexed="true" stored="true"/>
- <defaultSearchField>sim1text</defaultSearchField>
<uniqueKey>id</uniqueKey>
<!-- Global similarity, defers to the fieldType.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-simpleqpplugin.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-simpleqpplugin.xml b/solr/core/src/test-files/solr/collection1/conf/schema-simpleqpplugin.xml
index 507024f..1183fd0 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-simpleqpplugin.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-simpleqpplugin.xml
@@ -56,6 +56,5 @@
<field name="text-keyword0" type="text-keyword" indexed="true" stored="true"/>
<field name="text-query0" type="text-query" indexed="true" stored="true"/>
- <defaultSearchField>text0</defaultSearchField>
<uniqueKey>id</uniqueKey>
</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-single-dynamic-copy-field.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-single-dynamic-copy-field.xml b/solr/core/src/test-files/solr/collection1/conf/schema-single-dynamic-copy-field.xml
index b185576..1652d88 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-single-dynamic-copy-field.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-single-dynamic-copy-field.xml
@@ -657,7 +657,6 @@
<dynamicField name="random_*" type="random"/>
- <defaultSearchField>text</defaultSearchField>
<uniqueKey>id</uniqueKey>
<copyField source="*" dest="text"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-spellchecker.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-spellchecker.xml b/solr/core/src/test-files/solr/collection1/conf/schema-spellchecker.xml
index 7d3618a..3b6174f 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-spellchecker.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-spellchecker.xml
@@ -71,7 +71,4 @@
<!-- field to use to determine and enforce document uniqueness. -->
<uniqueKey>id</uniqueKey>
-
- <!-- field for the QueryParser to use when an explicit fieldname is absent -->
- <defaultSearchField>text</defaultSearchField>
</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-sql.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-sql.xml b/solr/core/src/test-files/solr/collection1/conf/schema-sql.xml
index dbaac57..efa110c 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-sql.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-sql.xml
@@ -616,7 +616,6 @@
<dynamicField name="*_sim3" type="sim3" indexed="true" stored="true"/>
-->
- <defaultSearchField>text</defaultSearchField>
<uniqueKey>id</uniqueKey>
<!-- copyField commands copy one field to another at the time a document
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-stop-keep.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-stop-keep.xml b/solr/core/src/test-files/solr/collection1/conf/schema-stop-keep.xml
deleted file mode 100644
index b787c0c..0000000
--- a/solr/core/src/test-files/solr/collection1/conf/schema-stop-keep.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" ?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<!--
-
- For testing stopword configuration and keep word configuration
-
- -->
-
-<schema name="test" version="1.0">
-
- <fieldType name="integer" class="solr.TrieIntField" precisionStep="0"/>
-
- <fieldType name="string" class="solr.StrField" sortMissingLast="true"/>
- <fieldType name="stop-one" class="solr.TextField">
- <analyzer>
- <tokenizer class="solr.MockTokenizerFactory"/>
- <filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true"
- words="stop-1.txt"/>
-
- </analyzer>
- </fieldType>
- <fieldType name="stop-two" class="solr.TextField">
- <analyzer>
- <tokenizer class="solr.MockTokenizerFactory"/>
- <filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true"
- words="stop-1.txt,stop-2.txt"/>
-
- </analyzer>
- </fieldType>
-
-
- <field name="id" type="integer" indexed="true" stored="true" multiValued="false" required="false"/>
- <field name="one" type="stop-one" indexed="true" stored="false"/>
- <field name="two" type="stop-two" indexed="true" stored="false"/>
-
-
- <defaultSearchField>one</defaultSearchField>
- <uniqueKey>id</uniqueKey>
-
-
-</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-sweetspot.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-sweetspot.xml b/solr/core/src/test-files/solr/collection1/conf/schema-sweetspot.xml
index a3933a9..ba021a2 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-sweetspot.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-sweetspot.xml
@@ -64,7 +64,6 @@
<field name="text_baseline" type="text_baseline"/>
<field name="text_hyperbolic" type="text_hyperbolic"/>
- <defaultSearchField>text</defaultSearchField>
<uniqueKey>id</uniqueKey>
</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-synonym-tokenizer.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-synonym-tokenizer.xml b/solr/core/src/test-files/solr/collection1/conf/schema-synonym-tokenizer.xml
index e3ff5ec..09792f9 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-synonym-tokenizer.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-synonym-tokenizer.xml
@@ -36,6 +36,5 @@
<field name="id" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
<field name="text" type="text_synonyms" indexed="true" stored="false"/>
- <defaultSearchField>text</defaultSearchField>
<uniqueKey>id</uniqueKey>
</schema>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-tfidf.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-tfidf.xml b/solr/core/src/test-files/solr/collection1/conf/schema-tfidf.xml
index 97a68d1..0bec86f 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-tfidf.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-tfidf.xml
@@ -40,6 +40,5 @@
<field name="id" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
<fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
- <defaultSearchField>text</defaultSearchField>
<uniqueKey>id</uniqueKey>
</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-trie.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-trie.xml b/solr/core/src/test-files/solr/collection1/conf/schema-trie.xml
index f3d4c10..8cab0c8 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-trie.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-trie.xml
@@ -323,8 +323,4 @@
Unless this field is marked with required="false", it will be a required field
-->
<uniqueKey>id</uniqueKey>
-
- <!-- field for the QueryParser to use when an explicit fieldname is absent -->
- <defaultSearchField>text</defaultSearchField>
-
</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema-unifiedhighlight.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-unifiedhighlight.xml b/solr/core/src/test-files/solr/collection1/conf/schema-unifiedhighlight.xml
index 8d71088..3e093f3 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-unifiedhighlight.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-unifiedhighlight.xml
@@ -41,6 +41,5 @@
<field name="text2" type="text" indexed="true" stored="true"/>
<field name="text3" type="text_offsets" indexed="true" stored="true" large="true"/>
- <defaultSearchField>text</defaultSearchField>
<uniqueKey>id</uniqueKey>
</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema.xml b/solr/core/src/test-files/solr/collection1/conf/schema.xml
index bdda244..05145f9 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema.xml
@@ -773,7 +773,6 @@
<copyField source="single_d_dvn" dest="copy_single_d_dvn"/>
<copyField source="single_s_dvn" dest="copy_single_s_dvn"/>
- <defaultSearchField>text</defaultSearchField>
<uniqueKey>id</uniqueKey>
<!-- copyField commands copy one field to another at the time a document
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema11.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema11.xml b/solr/core/src/test-files/solr/collection1/conf/schema11.xml
index 179f804..caa24cc 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema11.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema11.xml
@@ -482,12 +482,8 @@ valued. -->
</analyzer>
</fieldType>
- <!-- Field to use to determine and enforce document uniqueness.
- Unless this field is marked with required="false", it will be a required field
- -->
- <uniqueKey>id</uniqueKey>
-
- <!-- field for the QueryParser to use when an explicit fieldname is absent -->
- <defaultSearchField>text</defaultSearchField>
-
+ <!-- Field to use to determine and enforce document uniqueness.
+ Unless this field is marked with required="false", it will be a required field
+ -->
+ <uniqueKey>id</uniqueKey>
</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema12.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema12.xml b/solr/core/src/test-files/solr/collection1/conf/schema12.xml
index 5a85c1f..214fc26 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema12.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema12.xml
@@ -641,7 +641,6 @@
<dynamicField name="*core" type="ignored" multiValued="true"/>
- <defaultSearchField>text</defaultSearchField>
<uniqueKey>id</uniqueKey>
<copyField source="title" dest="title_stemmed"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema15.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema15.xml b/solr/core/src/test-files/solr/collection1/conf/schema15.xml
index 9b4f0b1..7db2142 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema15.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema15.xml
@@ -627,7 +627,6 @@
</fieldType>
- <defaultSearchField>text</defaultSearchField>
<uniqueKey>id</uniqueKey>
<copyField source="title" dest="title_stemmed"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schema_codec.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema_codec.xml b/solr/core/src/test-files/solr/collection1/conf/schema_codec.xml
index 0454f3e..a90cf9c 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema_codec.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema_codec.xml
@@ -50,6 +50,5 @@
<dynamicField name="*_disk" type="string_disk" indexed="false" stored="false" docValues="true"/>
<dynamicField name="*_memory" type="string_memory" indexed="false" stored="false" docValues="true"/>
- <defaultSearchField>string_f</defaultSearchField>
<uniqueKey>string_f</uniqueKey>
</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/schemasurround.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schemasurround.xml b/solr/core/src/test-files/solr/collection1/conf/schemasurround.xml
index a0c29c9..c941f6f 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schemasurround.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schemasurround.xml
@@ -615,7 +615,6 @@
<dynamicField name="random_*" type="random"/>
- <defaultSearchField>text</defaultSearchField>
<uniqueKey>id</uniqueKey>
<copyField source="title" dest="title_stemmed"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/solrconfig-cache-enable-disable.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-cache-enable-disable.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-cache-enable-disable.xml
index 4053ebe..5990a81 100644
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-cache-enable-disable.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-cache-enable-disable.xml
@@ -73,7 +73,13 @@
<boolTofilterOptimizer enabled="false" cacheSize="32" threshold=".05"/>
</query>
-
+
+ <initParams path="standard">
+ <lst name="defaults">
+ <str name="df">text</str>
+ </lst>
+ </initParams>
+
</config>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/solrconfig-collapseqparser.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-collapseqparser.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-collapseqparser.xml
index 3ac0b50..77b456c 100644
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-collapseqparser.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-collapseqparser.xml
@@ -448,5 +448,10 @@ based HashBitset. -->
<processor class="solr.RunUpdateProcessorFactory" />
</updateRequestProcessorChain>
+ <initParams path="/elevate,standard">
+ <lst name="defaults">
+ <str name="df">text</str>
+ </lst>
+ </initParams>
</config>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/solrconfig-elevate.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-elevate.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-elevate.xml
index a591816..e190d68 100644
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-elevate.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-elevate.xml
@@ -169,4 +169,10 @@
<queryParser name="foo" class="FooQParserPlugin"/>
+ <initParams path="/elevate,/dataElevate">
+ <lst name="defaults">
+ <str name="df">text</str>
+ </lst>
+ </initParams>
+
</config>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/solrconfig-functionquery.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-functionquery.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-functionquery.xml
index 37c2057..10f5e85 100644
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-functionquery.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-functionquery.xml
@@ -39,5 +39,10 @@
<valueSourceParser name="nvl" class="org.apache.solr.search.function.NvlValueSourceParser">
<float name="nvlFloatValue">0.0</float>
</valueSourceParser>
+ <initParams path="standard">
+ <lst name="defaults">
+ <str name="df">text</str>
+ </lst>
+ </initParams>
</config>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/solrconfig-managed-schema.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-managed-schema.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-managed-schema.xml
index c1390c8..146b154 100644
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-managed-schema.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-managed-schema.xml
@@ -72,4 +72,10 @@
</lst>
</requestHandler>
+ <initParams path="standard">
+ <lst name="defaults">
+ <str name="df">text</str>
+ </lst>
+ </initParams>
+
</config>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/solrconfig-minimal.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-minimal.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-minimal.xml
index 75e71d9..aedb683 100644
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-minimal.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-minimal.xml
@@ -55,5 +55,11 @@
</requestHandler>
+ <initParams path="/select">
+ <lst name="defaults">
+ <str name="df">text</str>
+ </lst>
+ </initParams>
+
</config>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/solrconfig-nocache.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-nocache.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-nocache.xml
index 0f13842..c6d33b2 100644
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-nocache.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-nocache.xml
@@ -39,4 +39,10 @@
<httpCaching never304="true" />
</requestDispatcher>
+ <initParams path="standard">
+ <lst name="defaults">
+ <str name="df">text</str>
+ </lst>
+ </initParams>
+
</config>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/solrconfig-plugcollector.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-plugcollector.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-plugcollector.xml
index c61ce08..75f7ced 100644
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-plugcollector.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-plugcollector.xml
@@ -550,5 +550,11 @@ based HashBitset. -->
<processor class="solr.RunUpdateProcessorFactory" />
</updateRequestProcessorChain>
+ <initParams path="standard,dismax,defaults,lazy,spellCheckCompRH,spellCheckWithWordbreak,spellCheckCompRH_Direct,spellCheckCompRH1,mltrh,tvrh,/terms">
+ <lst name="defaults">
+ <str name="df">text</str>
+ </lst>
+ </initParams>
+
</config>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/solrconfig-postingshighlight.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-postingshighlight.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-postingshighlight.xml
index 30f4158..9db6205 100644
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-postingshighlight.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-postingshighlight.xml
@@ -27,6 +27,7 @@
<requestHandler name="standard" class="solr.StandardRequestHandler">
<lst name="defaults">
<bool name="hl.defaultSummary">false</bool>
+ <str name="df">text</str>
</lst>
</requestHandler>
<searchComponent class="solr.HighlightComponent" name="highlight">
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/solrconfig-response-log-component.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-response-log-component.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-response-log-component.xml
index bf8ed42..f89b187 100644
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-response-log-component.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-response-log-component.xml
@@ -52,4 +52,10 @@
</lst>
</requestHandler>
+ <initParams path="withlog,nolog">
+ <lst name="defaults">
+ <str name="df">text</str>
+ </lst>
+ </initParams>
+
</config>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/solrconfig-sortingmergepolicyfactory.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-sortingmergepolicyfactory.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-sortingmergepolicyfactory.xml
index 3746827..a7a8358 100644
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-sortingmergepolicyfactory.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-sortingmergepolicyfactory.xml
@@ -47,5 +47,10 @@
<maxTime>${solr.autoSoftCommit.maxTime:-1}</maxTime>
</autoSoftCommit>
</updateHandler>
+ <initParams path="standard">
+ <lst name="defaults">
+ <str name="df">text</str>
+ </lst>
+ </initParams>
</config>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/solrconfig-spellcheckcomponent.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-spellcheckcomponent.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-spellcheckcomponent.xml
index 23e1cd2..5324a35 100644
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-spellcheckcomponent.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-spellcheckcomponent.xml
@@ -189,5 +189,10 @@
<str>spellcheck</str>
</arr>
</requestHandler>
+ <initParams path="spellCheckCompRH,spellCheckCompRH1,spellCheckWithWordbreak">
+ <lst name="defaults">
+ <str name="df">text</str>
+ </lst>
+ </initParams>
</config>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog-with-delayingcomponent.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog-with-delayingcomponent.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog-with-delayingcomponent.xml
index 4b04cab..4083975 100644
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog-with-delayingcomponent.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog-with-delayingcomponent.xml
@@ -115,5 +115,10 @@
<str>delayingSearchComponent</str>
</arr>
</requestHandler>
+ <initParams path="standard,/select">
+ <lst name="defaults">
+ <str name="df">text</str>
+ </lst>
+ </initParams>
</config>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog.xml
index 315d1be..b08af83 100644
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog.xml
@@ -158,4 +158,10 @@
</query>
+ <initParams path="standard">
+ <lst name="defaults">
+ <str name="df">text</str>
+ </lst>
+ </initParams>
+
</config>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/collection1/conf/solrconfig.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig.xml
index 0d01067..58f9551 100644
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig.xml
@@ -572,5 +572,11 @@
<str name="storageIO">org.apache.solr.rest.ManagedResourceStorage$InMemoryStorageIO</str>
</restManager>
+ <initParams path="standard,dismax,defaults,lazy,spellCheckCompRH,spellCheckWithWordbreak,spellCheckCompRH_Direct,spellCheckCompRH1,mltrh,tvrh,/search-facet-def,/search-facet-invariants,/terms">
+ <lst name="defaults">
+ <str name="df">text</str>
+ </lst>
+ </initParams>
+
</config>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/configsets/cloud-dynamic/conf/schema.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/configsets/cloud-dynamic/conf/schema.xml b/solr/core/src/test-files/solr/configsets/cloud-dynamic/conf/schema.xml
index d15c199..5612724 100644
--- a/solr/core/src/test-files/solr/configsets/cloud-dynamic/conf/schema.xml
+++ b/solr/core/src/test-files/solr/configsets/cloud-dynamic/conf/schema.xml
@@ -283,7 +283,6 @@
<dynamicField name="random_*" type="random"/>
- <defaultSearchField>text</defaultSearchField>
<uniqueKey>id</uniqueKey>
<!-- example of a custom similarity -->
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/configsets/doc-expiry/conf/schema.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/configsets/doc-expiry/conf/schema.xml b/solr/core/src/test-files/solr/configsets/doc-expiry/conf/schema.xml
index c622eba..7adede3 100644
--- a/solr/core/src/test-files/solr/configsets/doc-expiry/conf/schema.xml
+++ b/solr/core/src/test-files/solr/configsets/doc-expiry/conf/schema.xml
@@ -277,7 +277,6 @@
<dynamicField name="random_*" type="random"/>
- <defaultSearchField>text</defaultSearchField>
<uniqueKey>id</uniqueKey>
<!-- example of a custom similarity -->
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/crazy-path-to-config.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/crazy-path-to-config.xml b/solr/core/src/test-files/solr/crazy-path-to-config.xml
index 4b086dc..c6dc859 100644
--- a/solr/core/src/test-files/solr/crazy-path-to-config.xml
+++ b/solr/core/src/test-files/solr/crazy-path-to-config.xml
@@ -42,6 +42,7 @@
<requestHandler name="crazy_custom_qt" class="solr.StandardRequestHandler">
<lst name="defaults">
<str name="fl">implicit</str>
+ <str name="df">subject</str>
</lst>
</requestHandler>
@@ -54,4 +55,10 @@
<gettableFiles>solrconfig.xml schema.xml</gettableFiles>
</admin>
+ <initParams path="standard,crazy_custom_qt">
+ <lst name="defaults">
+ <str name="df">subject</str>
+ </lst>
+ </initParams>
+
</config>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test-files/solr/crazy-path-to-schema.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/crazy-path-to-schema.xml b/solr/core/src/test-files/solr/crazy-path-to-schema.xml
index 7d06ff9..ef9ce3a 100644
--- a/solr/core/src/test-files/solr/crazy-path-to-schema.xml
+++ b/solr/core/src/test-files/solr/crazy-path-to-schema.xml
@@ -41,6 +41,5 @@
<field name="subject" type="text" indexed="true" stored="true"/>
</fields>
- <defaultSearchField>subject</defaultSearchField>
<uniqueKey>id</uniqueKey>
</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test/org/apache/solr/TestDistributedGrouping.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/TestDistributedGrouping.java b/solr/core/src/test/org/apache/solr/TestDistributedGrouping.java
index a9e6d57..ca7f9ee 100644
--- a/solr/core/src/test/org/apache/solr/TestDistributedGrouping.java
+++ b/solr/core/src/test/org/apache/solr/TestDistributedGrouping.java
@@ -62,7 +62,7 @@ public class TestDistributedGrouping extends BaseDistributedSearchTestCase {
query("q", "*:*", "rows", 100, "fl", "id," + i1, "group", "true", "group.field", i1, "group.limit", -1, "sort", i1 + " asc, id asc", "hl","true","hl.fl",t1);
query("q", "*:*", "rows", 100, "fl", "id," + i1, "group", "true", "group.field", i1, "group.limit", -1, "sort", i1 + " asc, id asc", "facet", "true", "facet.field", t1);
query("q", "*:*", "rows", 100, "fl", "id," + i1, "group", "true", "group.field", i1, "group.limit", -1, "sort", i1 + " asc, id asc", "stats", "true", "stats.field", i1);
- query("q", "kings", "rows", 100, "fl", "id," + i1, "group", "true", "group.field", i1, "group.limit", -1, "sort", i1 + " asc, id asc", "spellcheck", "true", "spellcheck.build", "true", "qt", "spellCheckCompRH");
+ query("q", "kings", "rows", 100, "fl", "id," + i1, "group", "true", "group.field", i1, "group.limit", -1, "sort", i1 + " asc, id asc", "spellcheck", "true", "spellcheck.build", "true", "qt", "spellCheckCompRH", "df", "subject");
query("q", "*:*", "fq", s1 + ":a", "rows", 100, "fl", "id," + i1, "group", "true", "group.field", i1, "group.limit", -1, "sort", i1 + " asc, id asc", "group.truncate", "true", "facet", "true", "facet.field", t1);
indexr(id,1, i1, 100, tlong, 100, i1dv, 100, t1,"now is the time for all good men",
@@ -160,7 +160,7 @@ public class TestDistributedGrouping extends BaseDistributedSearchTestCase {
query("q", "*:*", "rows", 100, "fl", "id," + i1, "group", "true", "group.field", i1, "group.limit", -1, "sort", "{!func}add(" + i1 + ",5) asc, id asc");
query("q", "*:*", "rows", 100, "fl", "id," + i1, "group", "true", "group.field", i1, "group.limit", -1, "sort", i1 + " asc, id asc", "facet", "true", "facet.field", t1);
query("q", "*:*", "rows", 100, "fl", "id," + i1, "group", "true", "group.field", i1, "group.limit", -1, "sort", i1 + " asc, id asc", "stats", "true", "stats.field", tlong);
- query("q", "kings", "rows", 100, "fl", "id," + i1, "group", "true", "group.field", i1, "group.limit", -1, "sort", i1 + " asc, id asc", "spellcheck", "true", "spellcheck.build", "true", "qt", "spellCheckCompRH");
+ query("q", "kings", "rows", 100, "fl", "id," + i1, "group", "true", "group.field", i1, "group.limit", -1, "sort", i1 + " asc, id asc", "spellcheck", "true", "spellcheck.build", "true", "qt", "spellCheckCompRH", "df", "subject");
query("q", "*:*", "rows", 100, "fl", "id," + i1, "group", "true", "group.field", i1, "group.limit", -1, "sort", i1 + " asc, id asc", "facet", "true", "hl","true","hl.fl",t1);
query("q", "*:*", "rows", 100, "fl", "id," + i1, "group", "true", "group.field", i1, "group.limit", -1, "sort", i1 + " asc, id asc", "group.sort", "id desc");
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test/org/apache/solr/core/TestSolrConfigHandler.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/core/TestSolrConfigHandler.java b/solr/core/src/test/org/apache/solr/core/TestSolrConfigHandler.java
index ec81c25..13d4d01 100644
--- a/solr/core/src/test/org/apache/solr/core/TestSolrConfigHandler.java
+++ b/solr/core/src/test/org/apache/solr/core/TestSolrConfigHandler.java
@@ -414,8 +414,8 @@ public class TestSolrConfigHandler extends RestTestBase {
List l = (List) Utils.getObjectByPath(map, false, Arrays.asList("config", "initParams"));
assertNotNull("no object /config/initParams : "+ TestBlobHandler.getAsString(map) , l);
- assertEquals( 1, l.size());
- assertEquals( "val", ((Map)l.get(0)).get("key") );
+ assertEquals( 2, l.size());
+ assertEquals( "val", ((Map)l.get(1)).get("key") );
payload = "{\n" +
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test/org/apache/solr/highlight/HighlighterMaxOffsetTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/highlight/HighlighterMaxOffsetTest.java b/solr/core/src/test/org/apache/solr/highlight/HighlighterMaxOffsetTest.java
index fb47f6e..5be67b9 100644
--- a/solr/core/src/test/org/apache/solr/highlight/HighlighterMaxOffsetTest.java
+++ b/solr/core/src/test/org/apache/solr/highlight/HighlighterMaxOffsetTest.java
@@ -101,7 +101,8 @@ public class HighlighterMaxOffsetTest extends SolrTestCaseJ4 {
private static void assertHighlighting(String field) throws Exception {
assertQ(req("q", "id:DOC1",
- "hl.q", "JPEG",
+ "df", "content",
+ "hl.q", "JPEG",
"indent", "true",
"hl", "true",
"hl.fl", field,
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test/org/apache/solr/rest/schema/TestDefaultSearchFieldResource.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/rest/schema/TestDefaultSearchFieldResource.java b/solr/core/src/test/org/apache/solr/rest/schema/TestDefaultSearchFieldResource.java
deleted file mode 100644
index 84ccd0a..0000000
--- a/solr/core/src/test/org/apache/solr/rest/schema/TestDefaultSearchFieldResource.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.solr.rest.schema;
-import org.apache.solr.rest.SolrRestletTestBase;
-import org.junit.Test;
-
-public class TestDefaultSearchFieldResource extends SolrRestletTestBase {
- @Test
- public void testGetDefaultSearchField() throws Exception {
- assertQ("/schema/defaultsearchfield?indent=on&wt=xml",
- "count(/response/str[@name='defaultSearchField']) = 1",
- "/response/str[@name='defaultSearchField'][.='text']");
- }
-}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test/org/apache/solr/rest/schema/TestSchemaResource.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/rest/schema/TestSchemaResource.java b/solr/core/src/test/org/apache/solr/rest/schema/TestSchemaResource.java
index 9fa75df..cc8cc33 100644
--- a/solr/core/src/test/org/apache/solr/rest/schema/TestSchemaResource.java
+++ b/solr/core/src/test/org/apache/solr/rest/schema/TestSchemaResource.java
@@ -32,9 +32,6 @@ public class TestSchemaResource extends SolrRestletTestBase {
"count(/response/lst[@name='schema']/str[@name='uniqueKey']) = 1",
"/response/lst[@name='schema']/str[@name='uniqueKey'][.='id']",
- "count(/response/lst[@name='schema']/str[@name='defaultSearchField']) = 1",
- "/response/lst[@name='schema']/str[@name='defaultSearchField'][.='text']",
-
"(/response/lst[@name='schema']/arr[@name='fieldTypes']/lst/str[@name='name'])[1] = 'HTMLstandardtok'",
"(/response/lst[@name='schema']/arr[@name='fieldTypes']/lst/str[@name='name'])[2] = 'HTMLwhitetok'",
"(/response/lst[@name='schema']/arr[@name='fieldTypes']/lst/str[@name='name'])[3] = 'boolean'",
@@ -111,8 +108,7 @@ public class TestSchemaResource extends SolrRestletTestBase {
"/schema/name=='test-rest'",
"/schema/version==1.6",
"/schema/uniqueKey=='id'",
- "/schema/defaultSearchField=='text'",
-
+
"/schema/fieldTypes/[0]/name=='HTMLstandardtok'",
"/schema/fieldTypes/[1]/name=='HTMLwhitetok'",
"/schema/fieldTypes/[2]/name=='boolean'",
@@ -151,7 +147,6 @@ public class TestSchemaResource extends SolrRestletTestBase {
"/schema/@name = 'test-rest'",
"/schema/@version = '1.6'",
"/schema/uniqueKey = 'id'",
- "/schema/defaultSearchField = 'text'",
"(/schema/fieldType)[1]/@name = 'HTMLstandardtok'",
"(/schema/fieldType)[2]/@name = 'HTMLwhitetok'",
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test/org/apache/solr/search/QueryEqualityTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/QueryEqualityTest.java b/solr/core/src/test/org/apache/solr/search/QueryEqualityTest.java
index 7745817..1ec4198 100644
--- a/solr/core/src/test/org/apache/solr/search/QueryEqualityTest.java
+++ b/solr/core/src/test/org/apache/solr/search/QueryEqualityTest.java
@@ -1011,7 +1011,7 @@ public class QueryEqualityTest extends SolrTestCaseJ4 {
*/
protected void assertQueryEquals(final String defType,
final String... inputs) throws Exception {
- SolrQueryRequest req = req();
+ SolrQueryRequest req = req(new String[] {"df", "text"});
try {
assertQueryEquals(defType, req, inputs);
} finally {
@@ -1173,4 +1173,9 @@ public class QueryEqualityTest extends SolrTestCaseJ4 {
req.close();
}
}
-}
\ No newline at end of file
+
+ // Override req to add df param
+ public static SolrQueryRequest req(String... q) {
+ return SolrTestCaseJ4.req(q, "df", "text");
+ }
+}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test/org/apache/solr/search/QueryParsingTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/QueryParsingTest.java b/solr/core/src/test/org/apache/solr/search/QueryParsingTest.java
index b703846..925f71b 100644
--- a/solr/core/src/test/org/apache/solr/search/QueryParsingTest.java
+++ b/solr/core/src/test/org/apache/solr/search/QueryParsingTest.java
@@ -40,8 +40,8 @@ public class QueryParsingTest extends SolrTestCaseJ4 {
*/
public void testQParserEmptyInput() throws Exception {
- SolrQueryRequest req = req();
-
+ SolrQueryRequest req = req("df", "text");
+
final String[] parsersTested = new String[] {
OldLuceneQParserPlugin.NAME,
LuceneQParserPlugin.NAME,
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e776cbe4/solr/core/src/test/org/apache/solr/search/TestExtendedDismaxParser.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/TestExtendedDismaxParser.java b/solr/core/src/test/org/apache/solr/search/TestExtendedDismaxParser.java
index 6a211d0..d416b22 100644
--- a/solr/core/src/test/org/apache/solr/search/TestExtendedDismaxParser.java
+++ b/solr/core/src/test/org/apache/solr/search/TestExtendedDismaxParser.java
@@ -1771,10 +1771,13 @@ public class TestExtendedDismaxParser extends SolrTestCaseJ4 {
public void testAutoGeneratePhraseQueries() throws Exception {
ModifiableSolrParams noSowParams = new ModifiableSolrParams();
+ noSowParams.add("df", "text");
ModifiableSolrParams sowFalseParams = new ModifiableSolrParams();
sowFalseParams.add("sow", "false");
+ sowFalseParams.add("df", "text");
ModifiableSolrParams sowTrueParams = new ModifiableSolrParams();
sowTrueParams.add("sow", "true");
+ sowTrueParams.add("df", "text");
// From synonyms.txt:
//
[22/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10274: Update
CHANGES.txt
Posted by tf...@apache.org.
SOLR-10274: Update 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/41ebeeaa
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/41ebeeaa
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/41ebeeaa
Branch: refs/heads/jira/solr-10233
Commit: 41ebeeaadcdf3e222719999c65dcea8712efb95d
Parents: a0fc943
Author: Joel Bernstein <jb...@apache.org>
Authored: Fri May 5 13:40:02 2017 -0400
Committer: Joel Bernstein <jb...@apache.org>
Committed: Fri May 5 13:40:02 2017 -0400
----------------------------------------------------------------------
solr/CHANGES.txt | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/41ebeeaa/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index c30cebe..213dd9f 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -215,6 +215,8 @@ New Features
* SOLR-10426: Add shuffle Streaming Expression (Joel Bernstein)
+* SOLR-10274: The search Streaming Expression should work in non-SolrCloud mode (Joel Bernstein)
+
Optimizations
----------------------
[45/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10625: Add
convolution Stream Evaluator
Posted by tf...@apache.org.
SOLR-10625: Add convolution Stream Evaluator
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/a3fe9f02
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/a3fe9f02
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/a3fe9f02
Branch: refs/heads/jira/solr-10233
Commit: a3fe9f0297292926b15f6faeb11ac863d4a82684
Parents: a04d9c1
Author: Joel Bernstein <jb...@apache.org>
Authored: Mon May 8 09:53:12 2017 -0400
Committer: Joel Bernstein <jb...@apache.org>
Committed: Mon May 8 09:53:53 2017 -0400
----------------------------------------------------------------------
.../org/apache/solr/handler/StreamHandler.java | 2 +
.../solrj/io/stream/ConvolutionEvaluator.java | 82 ++++++++++++++++++++
.../solrj/io/stream/StreamExpressionTest.java | 52 +++++++++++++
3 files changed, 136 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a3fe9f02/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/StreamHandler.java b/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
index 63e521c..a4ac559 100644
--- a/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
@@ -171,6 +171,8 @@ public class StreamHandler extends RequestHandlerBase implements SolrCoreAware,
.withFunctionName("predict", PredictEvaluator.class)
.withFunctionName("regress", RegressionEvaluator.class)
.withFunctionName("cov", CovarianceEvaluator.class)
+ .withFunctionName("conv", ConvolutionEvaluator.class)
+
// metrics
.withFunctionName("min", MinMetric.class)
.withFunctionName("max", MaxMetric.class)
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a3fe9f02/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ConvolutionEvaluator.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ConvolutionEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ConvolutionEvaluator.java
new file mode 100644
index 0000000..6d6e3e3
--- /dev/null
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ConvolutionEvaluator.java
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.client.solrj.io.stream;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.ArrayList;
+
+import org.apache.commons.math3.util.MathArrays;
+import org.apache.solr.client.solrj.io.Tuple;
+import org.apache.solr.client.solrj.io.eval.ComplexEvaluator;
+import org.apache.solr.client.solrj.io.eval.StreamEvaluator;
+import org.apache.solr.client.solrj.io.stream.expr.Explanation;
+import org.apache.solr.client.solrj.io.stream.expr.Explanation.ExpressionType;
+import org.apache.solr.client.solrj.io.stream.expr.Expressible;
+import org.apache.solr.client.solrj.io.stream.expr.StreamExpression;
+import org.apache.solr.client.solrj.io.stream.expr.StreamExpressionParameter;
+import org.apache.solr.client.solrj.io.stream.expr.StreamFactory;
+
+public class ConvolutionEvaluator extends ComplexEvaluator implements Expressible {
+
+ private static final long serialVersionUID = 1;
+
+ public ConvolutionEvaluator(StreamExpression expression, StreamFactory factory) throws IOException {
+ super(expression, factory);
+ }
+
+ public List<Number> evaluate(Tuple tuple) throws IOException {
+ StreamEvaluator colEval1 = subEvaluators.get(0);
+ StreamEvaluator colEval2 = subEvaluators.get(1);
+
+ List<Number> numbers1 = (List<Number>)colEval1.evaluate(tuple);
+ List<Number> numbers2 = (List<Number>)colEval2.evaluate(tuple);
+ double[] column1 = new double[numbers1.size()];
+ double[] column2 = new double[numbers2.size()];
+
+ for(int i=0; i<numbers1.size(); i++) {
+ column1[i] = numbers1.get(i).doubleValue();
+ }
+
+ for(int i=0; i<numbers2.size(); i++) {
+ column2[i] = numbers2.get(i).doubleValue();
+ }
+
+ double[] conArray = MathArrays.convolve(column1, column2);
+ List<Number> conList = new ArrayList();
+ for(double d :conArray) {
+ conList.add(d);
+ }
+
+ return conList;
+ }
+
+ @Override
+ public StreamExpressionParameter toExpression(StreamFactory factory) throws IOException {
+ StreamExpression expression = new StreamExpression(factory.getFunctionName(getClass()));
+ return expression;
+ }
+
+ @Override
+ public Explanation toExplanation(StreamFactory factory) throws IOException {
+ return new Explanation(nodeId.toString())
+ .withExpressionType(ExpressionType.EVALUATOR)
+ .withFunctionName(factory.getFunctionName(getClass()))
+ .withImplementingClass(getClass().getName())
+ .withExpression(toExpression(factory).toString());
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a3fe9f02/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
index 31d3171..f674236 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
@@ -5299,6 +5299,58 @@ public class StreamExpressionTest extends SolrCloudTestCase {
assertTrue(tuples.get(0).getDouble("cov").equals(-625.0D));
}
+ @Test
+ public void testConvolution() throws Exception {
+ UpdateRequest updateRequest = new UpdateRequest();
+
+ int i=0;
+ while(i<50) {
+ updateRequest.add(id, "id_"+(++i),"test_dt", getDateString("2016", "5", "1"), "price_f", "400.00");
+ }
+
+ while(i<100) {
+ updateRequest.add(id, "id_"+(++i),"test_dt", getDateString("2015", "5", "1"), "price_f", "300.0");
+ }
+
+ while(i<150) {
+ updateRequest.add(id, "id_"+(++i),"test_dt", getDateString("2014", "5", "1"), "price_f", "500.0");
+ }
+
+ while(i<250) {
+ updateRequest.add(id, "id_"+(++i),"test_dt", getDateString("2013", "5", "1"), "price_f", "100.00");
+ }
+
+ updateRequest.commit(cluster.getSolrClient(), COLLECTIONORALIAS);
+
+ String expr = "timeseries("+COLLECTIONORALIAS+", q=\"*:*\", start=\"2013-01-01T01:00:00.000Z\", " +
+ "end=\"2016-12-01T01:00:00.000Z\", " +
+ "gap=\"+1YEAR\", " +
+ "field=\"test_dt\", " +
+ "count(*), sum(price_f), max(price_f), min(price_f))";
+
+ String cexpr = "let(a="+expr+", b=select("+expr+",mult(2, count(*)) as nvalue), c=col(a, count(*)), d=col(b, nvalue), tuple(colc=c, cold=d, conv=conv(c,d)))";
+
+ ModifiableSolrParams paramsLoc = new ModifiableSolrParams();
+ paramsLoc.set("expr", cexpr);
+ paramsLoc.set("qt", "/stream");
+
+ String url = cluster.getJettySolrRunners().get(0).getBaseUrl().toString()+"/"+COLLECTIONORALIAS;
+ TupleStream solrStream = new SolrStream(url, paramsLoc);
+
+ StreamContext context = new StreamContext();
+ solrStream.setStreamContext(context);
+ List<Tuple> tuples = getTuples(solrStream);
+ assertTrue(tuples.size() == 1);
+ List<Number> convolution = (List<Number>)(tuples.get(0)).get("conv");
+ assertTrue(convolution.size() == 7);
+ assertTrue(convolution.get(0).equals(20000D));
+ assertTrue(convolution.get(1).equals(20000D));
+ assertTrue(convolution.get(2).equals(25000D));
+ assertTrue(convolution.get(3).equals(30000D));
+ assertTrue(convolution.get(4).equals(15000D));
+ assertTrue(convolution.get(5).equals(10000D));
+ assertTrue(convolution.get(6).equals(5000D));
+ }
@Test