[ 
https://issues.apache.org/jira/browse/SOLR-8858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15364864#comment-15364864
 ] 

ASF GitHub Bot commented on SOLR-8858:
--------------------------------------

Github user maedhroz commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/47#discussion_r69787760
  
    --- Diff: solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java 
---
    @@ -766,12 +766,16 @@ public Document doc(int i, Set<String> fields) throws 
IOException {
         }
     
         final DirectoryReader reader = getIndexReader();
    -    if (!enableLazyFieldLoading || fields == null) {
    -      d = reader.document(i);
    +    if (fields != null) {
    +      if (enableLazyFieldLoading) {
    +        final SetNonLazyFieldSelector visitor = new 
SetNonLazyFieldSelector(fields, reader, i);
    +        reader.document(i, visitor);
    +        d = visitor.doc;
    +      } else {
    +        d = reader.document(i, fields);
    --- End diff --
    
    Right. I *think* I addressed that in the last commit, since only full 
documents are cached now. The problem is that the overhead of doing this might 
be unacceptable.


> SolrIndexSearcher#doc() Completely Ignores Field Filters Unless Lazy Field 
> Loading is Enabled
> ---------------------------------------------------------------------------------------------
>
>                 Key: SOLR-8858
>                 URL: https://issues.apache.org/jira/browse/SOLR-8858
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 4.6, 4.10, 5.5
>            Reporter: Caleb Rackliffe
>              Labels: easyfix
>
> If {{enableLazyFieldLoading=false}}, a perfectly valid fields filter will be 
> ignored, and we'll create a {{DocumentStoredFieldVisitor}} without it.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to