Skip to content

Commit

Permalink
reuse DocValues iterators in SolrDocumentFetcher/udvas (#144)
Browse files Browse the repository at this point in the history
(cherry picked from commit 9bb42b8)
  • Loading branch information
magibney committed Sep 15, 2023
1 parent b7af3d0 commit b4b637b
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 @@ -239,6 +239,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 @@ -349,7 +350,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 @@ -576,7 +578,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 b4b637b

Please sign in to comment.