[ 
https://issues.apache.org/jira/browse/SOLR-10304?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Smiley updated SOLR-10304:
--------------------------------
    Attachment: SOLR_10304_SolrDocumentFetcher.patch

Here's a patch.
Misc notes:
* SolrIndexSearcher now has getters for the SolrDocumentFetcher, for 
FieldInfos, and for the LeafContexts. The latter 2 were needed by SDF.
* Marked SolrPluginUtils.docListToSolrDocumentList deprecated. It's only called 
by ClusteringComponent, and I think the "ids" param aspect is a bit ugly and 
not worth supporting. If someone wants a similar method they can speak up and 
we can add a method to SolrDocumentFetcher.
* Removed convenience method readDocs and it's overloaded version. Nobody was 
calling them.  I looked around to see if, IMO, somewhere we *should* be calling 
them.  I think not as the method promotes holding all the given Lucene docs in 
memory at once rather than letting each caller grab the parts of them they 
want, potentially in a more streaming way.
* class DocsStreamer:
** The "dvFieldsToReturn" calculation was moved to a static method on this 
class. I considered moving it to SolrDocumentFetcher but opted not to for now; 
it's debatable.  ReturnFields might be the ideal target.  Annoyingly 
ReturnFields is an interface with just one implementation so I didn't do this; 
not to mention it might be a bit out of scope.
** Renamed static DocsStreamer.getDoc(doc) to  {{convertLuceneDocToSolrDoc}}.  
I considered moving it to SolrDocumentFetcher but it's not 100% clear it 
should.  Maybe?  If so maybe it could then be made non-static and joined with 
calling decorateDocValueFields; it's debatable.
* there are several methods in RealtimeGetComponent affected... it suggests to 
me future refactorings might merge/move some of this logic, perhaps with 
DocsStreamer.  I dunno.

> Refactor Document/Stored-field handling out of SolrIndexSearcher
> ----------------------------------------------------------------
>
>                 Key: SOLR-10304
>                 URL: https://issues.apache.org/jira/browse/SOLR-10304
>             Project: Solr
>          Issue Type: Task
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: David Smiley
>            Assignee: David Smiley
>         Attachments: SOLR_10304_SolrDocumentFetcher.patch
>
>
> SolrIndexSearcher is nearly 3 thousand lines of code.  A sizable part of it 
> pertains to Document handling, including various stored-field concerns and 
> docValue substitutions (docValueAsStored related).  There are already 
> comments marking the start and end of this part of SolrIndexSearcher, plus 
> there some fields and their initialization that are only in support of those 
> methods.  I propose that all of this go to a new companion class 
> {{SolrDocumentFetcher}}. SolrIndexSearcher can add a getter for it, and where 
> applicable existing callers can call to this instead.  "Override"'s will need 
> to stay of course.
> ( Originally proposed in SOLR-10286 )



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to