This is an automated email from the ASF dual-hosted git repository.
dsmiley pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/main by this push:
new 0cb23c7 SOLR-15427: Nested docs: [child limit=...] now defaults to -1
(#144)
0cb23c7 is described below
commit 0cb23c7c2805f7e5eaa6df2fdd112b5619ed4736
Author: David Smiley <[email protected]>
AuthorDate: Sat Nov 20 18:11:41 2021 -0500
SOLR-15427: Nested docs: [child limit=...] now defaults to -1 (#144)
And -1 is now understood to be unlimited.
---
solr/CHANGES.txt | 5 ++++-
.../transform/ChildDocTransformerFactory.java | 22 ++++++++++++----------
solr/solr-ref-guide/src/document-transformers.adoc | 4 ++--
3 files changed, 18 insertions(+), 13 deletions(-)
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 1a16b5d..27c3db8 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -176,6 +176,9 @@ when told to. The admin UI now tells it to. (Nazerke
Seidan, David Smiley)
* SOLR-15376: Accept "Long" values for
CollectionAdminRequest.CreateTimeRoutedAlias.setMaxFutureMs
to support durations greater than ~ 25 days. (Nahian-Al Hasan, Gus Heck,
Christine Poerschke)
+* SOLR-15427: Nested docs: [child limit=...] now defaults to -1 which is
interpreted as unlimited.
+ (David Smiley)
+
Build
---------------------
@@ -437,7 +440,7 @@ Bug Fixes
* SOLR-15635: Don't close hooks twice when SolrRequestInfo is cleared twice;
or /export with classic join
closed fromCore if provided (Mikhail Khludnev, David Smiley)
-
+
* SOLR-15795: Fix REPLACENODE to not use source node when choosing a target
node for new replicas (Houston Putman)
* SOLR-15804: Admin UI once again can show files in the Core/Collection ->
Files screen. Fixed regression from 8.11.0 (Karl Stoney, janhoy)
diff --git
a/solr/core/src/java/org/apache/solr/response/transform/ChildDocTransformerFactory.java
b/solr/core/src/java/org/apache/solr/response/transform/ChildDocTransformerFactory.java
index 95902e2..54ba1d4 100644
---
a/solr/core/src/java/org/apache/solr/response/transform/ChildDocTransformerFactory.java
+++
b/solr/core/src/java/org/apache/solr/response/transform/ChildDocTransformerFactory.java
@@ -16,6 +16,8 @@
*/
package org.apache.solr.response.transform;
+import static org.apache.solr.schema.IndexSchema.NEST_PATH_FIELD_NAME;
+
import java.io.IOException;
import java.io.UncheckedIOException;
@@ -38,8 +40,6 @@ import org.apache.solr.search.SolrCache;
import org.apache.solr.search.SolrReturnFields;
import org.apache.solr.search.SyntaxError;
-import static org.apache.solr.schema.IndexSchema.NEST_PATH_FIELD_NAME;
-
/**
* Attaches all descendants (child documents) to each parent document.
*
@@ -49,7 +49,7 @@ import static
org.apache.solr.schema.IndexSchema.NEST_PATH_FIELD_NAME;
*
* Optionally you can provide a "childFilter" param to filter out which child
documents should be returned and a
* "limit" param which provides an option to specify the number of child
documents
- * to be returned per parent document. By default it's set to 10.
+ * to be returned per parent document.
*
* Examples -
* [child parentFilter="fieldName:fieldValue"]
@@ -95,11 +95,6 @@ public class ChildDocTransformerFactory extends
TransformerFactory {
String parentFilterStr = params.get( "parentFilter" );
BitSetProducer parentsFilter;
- // TODO reuse
org.apache.solr.search.join.BlockJoinParentQParser.getCachedFilter (uses a
cache)
- // TODO shouldn't we try to use the Solr filter cache, and then ideally
implement
- // BitSetProducer over that?
- // DocSet parentDocSet = req.getSearcher().getDocSet(parentFilterQuery);
- // then return BitSetProducer with custom BitSet impl accessing the docSet
if (parentFilterStr == null) {
parentsFilter = !buildHierarchy ? null : getCachedBitSetProducer(req,
rootFilter);
} else {
@@ -137,7 +132,10 @@ public class ChildDocTransformerFactory extends
TransformerFactory {
childSolrReturnFields = new SolrReturnFields(req);
}
- int limit = params.getInt( "limit", 10 );
+ int limit = params.getInt("limit", -1);
+ if (limit == -1) {
+ limit = Integer.MAX_VALUE;
+ }
return new ChildDocTransformer(field, parentsFilter, childDocSet,
childSolrReturnFields,
buildHierarchy, limit, req.getSchema().getUniqueKeyField().getName());
@@ -175,7 +173,11 @@ public class ChildDocTransformerFactory extends
TransformerFactory {
+ " +(" + remaining + ")";
}
- public static BitSetProducer getCachedBitSetProducer(final SolrQueryRequest
request, Query query) {
+ private static BitSetProducer getCachedBitSetProducer(final SolrQueryRequest
request, Query query) {
+ // TODO shouldn't we try to use the Solr filter cache, and then ideally
implement
+ // BitSetProducer over that?
+ // DocSet parentDocSet = req.getSearcher().getDocSet(parentFilterQuery);
+ // then return BitSetProducer with custom BitSet impl accessing the docSet
@SuppressWarnings("unchecked")
SolrCache<Query, BitSetProducer> parentCache =
request.getSearcher().getCache(CACHE_NAME);
// lazily retrieve from solr cache
diff --git a/solr/solr-ref-guide/src/document-transformers.adoc
b/solr/solr-ref-guide/src/document-transformers.adoc
index b53185f..8aa005d 100644
--- a/solr/solr-ref-guide/src/document-transformers.adoc
+++ b/solr/solr-ref-guide/src/document-transformers.adoc
@@ -153,10 +153,10 @@ This can be particularly useful when you have multiple
levels of hierarchical do
+
[%autowidth,frame=none]
|===
-|Optional |Default: `10`
+|Optional |Default: `-1`
|===
+
-The maximum number of child documents to be returned per parent document.
+The maximum number of child documents to be returned underneath the document
being augmented. The default is `-1` which means unlimited.
`fl`::
+