[
https://issues.apache.org/jira/browse/SOLR-13024?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16704054#comment-16704054
]
Yonik Seeley commented on SOLR-13024:
-------------------------------------
The change from LUCENE-7407:
{code}
git show f7aa200d40
./solr/core/src/java/org/apache/solr/response/transform/ValueSourceAugmenter.java
commit f7aa200d406dbd05a35d6116198302d90b92cb29
Author: Mike McCandless <[email protected]>
Date: Wed Sep 21 09:41:41 2016 -0400
LUCENE-7407: switch doc values usage to an iterator API, based on
DocIdSetIterator, instead of random acces, freeing codecs for future
diff --git
a/solr/core/src/java/org/apache/solr/response/transform/ValueSourceAugmenter.java
b/solr/core/src/java/org/apache/solr/response
index 9edf826e2c..c37dd80bfb 100644
---
a/solr/core/src/java/org/apache/solr/response/transform/ValueSourceAugmenter.java
+++
b/solr/core/src/java/org/apache/solr/response/transform/ValueSourceAugmenter.java
@@ -65,7 +65,6 @@ public class ValueSourceAugmenter extends DocTransformer
try {
searcher = context.getSearcher();
readerContexts = searcher.getIndexReader().leaves();
- docValuesArr = new FunctionValues[readerContexts.size()];
fcontext = ValueSource.newContext(searcher);
this.valueSource.createWeight(fcontext, searcher);
} catch (IOException e) {
@@ -76,7 +75,6 @@ public class ValueSourceAugmenter extends DocTransformer
Map fcontext;
SolrIndexSearcher searcher;
List<LeafReaderContext> readerContexts;
- FunctionValues docValuesArr[];
@Override
public void transform(SolrDocument doc, int docid, float score) {
@@ -87,11 +85,7 @@ public class ValueSourceAugmenter extends DocTransformer
// TODO: calculate this stuff just once across diff functions
int idx = ReaderUtil.subIndex(docid, readerContexts);
LeafReaderContext rcontext = readerContexts.get(idx);
- FunctionValues values = docValuesArr[idx];
- if (values == null) {
- docValuesArr[idx] = values = valueSource.getValues(fcontext, rcontext);
- }
-
+ FunctionValues values = valueSource.getValues(fcontext, rcontext);
int localId = docid - rcontext.docBase;
setValue(doc,values.objectVal(localId));
{code}
> ValueSourceAugmenter
> ---------------------
>
> Key: SOLR-13024
> URL: https://issues.apache.org/jira/browse/SOLR-13024
> Project: Solr
> Issue Type: Improvement
> Security Level: Public(Default Security Level. Issues are Public)
> Components: search
> Affects Versions: 7.0
> Reporter: Yonik Seeley
> Priority: Major
>
> The cutover to iterators in LUCENE-7407 caused ValueSourceAugmenter (which
> handles functions in the "fl" param along side other fields) resulted in
> FunctionValues being re-retrieved for every document.
> Caching could cut that in half, but we should really retrieve a window at a
> time in order for best performance.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]