Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ public void writeSolrDocument(String name, SolrDocument doc, ReturnFields return
indent();
}
writeKey("_childDocuments_", true);
writeArrayOpener(doc.getChildDocumentCount());
List<SolrDocument> childDocs = doc.getChildDocuments();
writeArrayOpener(childDocs.size());
for (int i = 0; i < childDocs.size(); i++) {
writeSolrDocument(null, childDocs.get(i), null, i);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ public void writeSolrDocument(String name, SolrDocument doc, ReturnFields return
indent();
}
writeKey("_childDocuments_", true);
writeArrayOpener(doc.getChildDocumentCount());
List<SolrDocument> childDocs = doc.getChildDocuments();
writeArrayOpener(childDocs.size());
for (int i = 0; i < childDocs.size(); i++) {
writeSolrDocument(null, childDocs.get(i), null, i);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public static void setupCluster() throws Exception {
matchingChild = chVals.iterator().next();
}
}
maxDocs += parent.getChildDocumentCount() + 1;
maxDocs += (parent.hasChildDocuments() ? parent.getChildDocuments().size() : 0) + 1;
docs.add(parent);
}
// don't add parents in increasing uniqueKey order
Expand Down
7 changes: 0 additions & 7 deletions solr/solrj/src/java/org/apache/solr/common/SolrDocument.java
Original file line number Diff line number Diff line change
Expand Up @@ -482,11 +482,4 @@ public boolean hasChildDocuments() {
boolean isEmpty = (_childDocuments == null || _childDocuments.isEmpty());
return !isEmpty;
}

@Override
@Deprecated
public int getChildDocumentCount() {
if (_childDocuments == null) return 0;
return _childDocuments.size();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,4 @@ public abstract class SolrDocumentBase<T, K> implements Map<String, T>, Serializ

/** Has <em>anonymous</em> children? */
public abstract boolean hasChildDocuments();

/** The <em>anonymous</em> child document count. */
@Deprecated
public abstract int getChildDocumentCount();
}
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,4 @@ public boolean hasChildDocuments() {
boolean isEmpty = (_childDocuments == null || _childDocuments.isEmpty());
return !isEmpty;
}

@Override
@Deprecated
public int getChildDocumentCount() {
return hasChildDocuments() ? _childDocuments.size() : 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void testQueryAndStreamResponse() throws Exception {
QueryResponse response = client.query(query);
assertEquals(1, response.getResults().size());
SolrDocument parentDoc = response.getResults().get(0);
assertEquals(1, parentDoc.getChildDocumentCount());
assertEquals(1, parentDoc.getChildDocuments().size());

// test streaming
final List<SolrDocument> docs = new ArrayList<>();
Expand All @@ -97,6 +97,6 @@ public void streamDocListInfo(long numFound, long start, Float maxScore) {}

assertEquals(1, docs.size());
parentDoc = docs.get(0);
assertEquals(1, parentDoc.getChildDocumentCount());
assertEquals(1, parentDoc.getChildDocuments().size());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void testQueryAndStreamResponse() throws Exception {
QueryResponse response = client.query(query);
assertEquals(1, response.getResults().size());
SolrDocument parentDoc = response.getResults().get(0);
assertEquals(1, parentDoc.getChildDocumentCount());
assertEquals(1, parentDoc.getChildDocuments().size());

// test streaming
final List<SolrDocument> docs = new ArrayList<>();
Expand All @@ -96,6 +96,6 @@ public void streamDocListInfo(long numFound, long start, Float maxScore) {}

assertEquals(1, docs.size());
parentDoc = docs.get(0);
assertEquals(1, parentDoc.getChildDocumentCount());
assertEquals(1, parentDoc.getChildDocuments().size());
}
}