Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-14601

Using [child] and [subquery] DocTransformer / FieldList

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 8.5.2, main (9.0)
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Docker Container 8.5.2 from Docker Hub
      Already existing in 9.0.0

      Description

      If you are using in the fl parameter something like that and luceneMatchVersion is higher or equals then 8.0.0 :

      fl=*,[child],customer:[subquery] or
      fl=*,customer:[subquery],[child]

      It ends Up in any case in the following error (BadRequest) inside the SubQueryAugmenterFactory:

      // code placeholder
      
      if (conflictMap.containsKey(field)) {
       throw new SolrException(ErrorCode.BAD_REQUEST,"[subquery] name "+field+" is uplicated");
      } else {
       conflictMap.put(field, true);
      }
      
      

      It looks like that the following Snippet in ChildDocTransformerFactory(8.5.2 and 9.0.0) already have added that field to the context.

      // code placeholder 8.5.2
      
      String childReturnFields = params.get("fl");
      SolrReturnFields childSolrReturnFields;
      if(childReturnFields != null) {
        childSolrReturnFields = new SolrReturnFields(childReturnFields, req);
      } else if(req.getSchema().getDefaultLuceneMatchVersion().major < 8) {
        // ensure backwards for versions prior to SOLR 8
        childSolrReturnFields = new SolrReturnFields();
      } else {
        childSolrReturnFields = new SolrReturnFields(req);
      }
      
      
      // code placeholder master 9.0.0
      
      String childReturnFields = params.get("fl");
      SolrReturnFields childSolrReturnFields;
      if (childReturnFields != null) {
        childSolrReturnFields = new SolrReturnFields(childReturnFields, req);
      } else {
        childSolrReturnFields = new SolrReturnFields(req);
      }
      
      

      It looks like childReturnFields includes also the customer:[subquery], eventually is a good idea to remove fields from other AugmenterFactories like [shard] or [subquery] from the childReturnFields variable

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Thomas Taroni Thomas Taroni
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: