dsmiley commented on code in PR #5298:
URL: https://github.com/apache/solr/pull/5298#discussion_r4728645717
##########
changelog/unreleased/SOLR-18608-glob-rtg-prefetch.yml:
##########
@@ -0,0 +1,7 @@
+title: Honor glob field selection in real-time get and lazy document prefetch
Review Comment:
```suggestion
title: >
Optimize stored document fetch in RTG and in standard search's "pre-fetch"
when globs are present.
```
##########
solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java:
##########
Review Comment:
BasicFunctionalityTest is one of Solr's longest test suites; the line count
is over a thousand. It has no real scope. I don't recommend adding to it
unless what's being tested *really* fits well there in particular. WDYT of
finding a new home for what you added?
##########
solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java:
##########
@@ -346,10 +352,21 @@ public void process(ResponseBuilder rb) throws
IOException {
if (docid < 0) continue;
- SolrDocumentFetcher docFetcher =
searcherInfo.getSearcher().getDocFetcher();
- Document luceneDocument =
- docFetcher.doc(docid, rsp.getReturnFields().getLuceneFieldNames());
- SolrDocument doc = toSolrDoc(luceneDocument,
searcherInfo.getSearcher().getSchema());
+ SolrIndexSearcher searcher = searcherInfo.getSearcher();
+ @SuppressWarnings("ReferenceEquality") // cache key is the searcher
instance
+ final boolean searcherChanged = docFetcher == null || searcher !=
fieldSelectionSearcher;
+ if (searcherChanged) {
+ fieldSelectionSearcher = searcher;
+ docFetcher = searcher.getDocFetcher();
+ storedFields =
+ useLegacyStoredFields
Review Comment:
The useLegacyStoredFields maps to basically
transformer.requiresFullDocumentForRTG() and the latter is accessible on the
returnFields. ReturnFields is passed to the SolrDocFetcher, so shouldn't that
matter be invoked there?
##########
solr/core/src/java/org/apache/solr/response/transform/DocTransformer.java:
##########
@@ -116,6 +116,15 @@ public String[] getExtraRequestFields() {
return null;
}
+ /**
+ * Whether index-backed RealTime Get should retain its legacy document
loading and conversion for
+ * this transformer, because its stored-field dependencies cannot be
determined in advance. Prefer
+ * declaring dependencies with {@link #getExtraRequestFields()} where
possible.
+ */
+ public boolean requiresFullDocumentForRTG() {
+ return false;
+ }
+
Review Comment:
I don't love this addition -- it has a use-case specific purpose. It's not
clear why this is needed now in this PR but not previously.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]