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

Thomas Taroni edited comment on SOLR-14601 at 6/27/20, 8:34 PM:
----------------------------------------------------------------

Have checked that, it looks not that this is working.
 child has only three allowed parameters: parentFilter,childFilter and limit.

Have now investigated the Problem a bit more deeper. It's some kind of 
recursion.

In ChildDocTransformerFactory the variable childReturnFields also includes the 
other augmenter queries like customer:[subquery] because it picks the full "fl" 
parameter. It calls then the SolrReturnFields with that. Inside the 
SolrReturnFields its adding all the Augementers in a for loop for all the 
fiels. It means if [child] is processed the customer:[subquery] is also 
processed. If then the customer:[subquery] will be processed by the 
SubQueryAugmenterFactory the field customer:[subquery] is already there. This 
ends up then in the "is duplicate" Exception.

 

In my Opinion the ChildDocTransformerFactory should not process things like 
[subquery] or [shard] or the SubQueryAugmenterFactory should not check that for 
duplicates.
 I dont really now the exactly reason why in ChildDocTransformerFactory the 
full "fl" is processed and not only the "[child]" fields.

 

Have forked the Project to: [https://github.com/phoenix-systems/lucene-solr] 
and done a short hack, that solves for us the Problem.

Commit: 
[https://github.com/phoenix-systems/lucene-solr/commit/5ce0461ae5da6cf226f435d7e8837132fb045c9d]

But i think the better Solution is to change the ChildDocTransformerFactory.


was (Author: thomas taroni):
Have checked that, it looks not that this is working.
child has only three allowed parameters: parentFilter,childFilter and limit.

Have now investigated the Problem a bit more deeper. It's some kind of 
recursion.

In ChildDocTransformerFactory the variable childReturnFields also includes the 
other augmenter queries like customer:[subquery] because it picks the full "fl" 
parameter. It calls then the SolrReturnFields with that. Inside the 
SolrReturnFields its adding all the Augementers in a for loop for all the 
fiels. It means if [child] is processed the customer:[subquery] is also 
processed. If then the customer:[subquery] will be processed by the 
SubQueryAugmenterFactory the field customer:[subquery] is already there. This 
ends up then in the "is duplicate" Exception.

 

In my Opinion the ChildDocTransformerFactory should not process things like 
[subquery] or [shard] or the SubQueryAugmenterFactory should not check that for 
duplicates.
I dont really now the exactly reason why in ChildDocTransformerFactory the full 
"fl" is processed and not only the "[child]" fields.

 

Have simpli forked the Project to: 
[https://github.com/phoenix-systems/lucene-solr] and done a short hack, that 
solves for us the Problem.

Commit: 
[https://github.com/phoenix-systems/lucene-solr/commit/5ce0461ae5da6cf226f435d7e8837132fb045c9d]

But i think the better Solution is to change the ChildDocTransformerFactory.

> Using [child] and [subquery] DocTransformer / FieldList
> -------------------------------------------------------
>
>                 Key: SOLR-14601
>                 URL: https://issues.apache.org/jira/browse/SOLR-14601
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: SearchComponents - other
>    Affects Versions: master (9.0), 8.5.2
>         Environment: Docker Container 8.5.2 from Docker Hub
> Already existing in 9.0.0
>            Reporter: Thomas Taroni
>            Priority: Major
>
> 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:java}
> // code placeholder
> if (conflictMap.containsKey(field)) {
>  throw new SolrException(ErrorCode.BAD_REQUEST,"[subquery] name "+field+" is 
> uplicated");
> } else {
>  conflictMap.put(field, true);
> }
> {code}
> 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:java}
> // 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}
> {code:java}
> // 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);
> }
> {code}
> 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
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to