Skip to content

Commit

Permalink
reuse DocValues iterators in SolrDocumentFetcher/udvas (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
magibney authored Sep 15, 2023
1 parent 9e094bd commit 9bb42b8
Show file tree
Hide file tree
Showing 2 changed files with 397 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ public void process(ResponseBuilder rb) throws IOException {

boolean opennedRealtimeSearcher = false;
BytesRefBuilder idBytes = new BytesRefBuilder();
Map<String, SolrDocumentFetcher.DVIterEntry> reuseDvIters = new HashMap<>();
for (String idStr : reqIds.allIds) {
fieldType.readableToIndexed(idStr, idBytes);
// if _route_ is passed, id is a child doc. TODO remove in SOLR-15064
Expand Down Expand Up @@ -348,7 +349,8 @@ public void process(ResponseBuilder rb) throws IOException {
searcherInfo.getSearcher().doc(docid, rsp.getReturnFields().getLuceneFieldNames());
SolrDocument doc = toSolrDoc(luceneDocument, core.getLatestSchema());
SolrDocumentFetcher docFetcher = searcherInfo.getSearcher().getDocFetcher();
docFetcher.decorateDocValueFields(doc, docid, docFetcher.getNonStoredDVs(true));
docFetcher.decorateDocValueFields(
doc, docid, docFetcher.getNonStoredDVs(true), reuseDvIters);
if (null != transformer) {
if (null == resultContext) {
// either first pass, or we've re-opened searcher - either way now we setContext
Expand Down Expand Up @@ -575,7 +577,7 @@ private static SolrDocument mergePartialDocWithFullDocFromIndex(
if (!doc.containsKey(VERSION_FIELD)) {
searcher
.getDocFetcher()
.decorateDocValueFields(doc, docid, Collections.singleton(VERSION_FIELD));
.decorateDocValueFields(doc, docid, Collections.singleton(VERSION_FIELD), null);
}

long docVersion = (long) doc.getFirstValue(VERSION_FIELD);
Expand Down
Loading

0 comments on commit 9bb42b8

Please sign in to comment.