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

Kuntal Ganguly commented on SOLR-3191:
--------------------------------------

I modify the code to support inbuilt alias transformer as well as custom 
transformer:

Modify the method:

 /**
   * Logic to handle Custom as well as inbuilt Doc Transformer.
   * 
   */

  void onTransformer(final StringBuilder expressionBuffer, final 
SolrQueryRequest request, final DocTransformers augmenters)
      throws SyntaxError {
          if(expressionBuffer!=null){
           String fl_Content=expressionBuffer.toString();
                if(fl_Content.contains("[") && fl_Content.contains("]")){
                                                
                        if(fl_Content.indexOf("[")==0){
                                 //Logic to Parse Custom Transformers
                                
                                  final Map<String,String> augmenterCustomArgs 
= new HashMap<String,String>();
                                  
QueryParsing.parseLocalParams(expressionBuffer.toString(), 0, 
augmenterCustomArgs, request.getParams(), "[", CLOSE_BRACKET);
                                  final String augmenterCustomName = 
augmenterCustomArgs.remove("type");
                                  final String 
customDisp='['+augmenterCustomName+']';
                                  final TransformerFactory customFactory = 
request.getCore().getTransformerFactory(augmenterCustomName);
                              if( customFactory != null ) {
                              MapSolrParams augmenterCustomParams = new 
MapSolrParams( augmenterCustomArgs );
                              augmenters.addTransformer( 
customFactory.create(customDisp, augmenterCustomParams, request) );
                                
                        }
                        }else if(fl_Content.indexOf("[")>0 && 
fl_Content.contains(":[")){
                                //Logic to Parse In_Built Transformers
                                
                            final String alias = 
getExpressionAlias(expressionBuffer);
                            final String transfomerExpression = 
getExpressionValue(expressionBuffer);
                            final Map<String,String> augmenterArgs = new 
HashMap<String,String>();
                            QueryParsing.parseLocalParams(transfomerExpression, 
0, augmenterArgs, request.getParams(), "[", CLOSE_BRACKET);
                            final String augmenterName = 
augmenterArgs.remove("type");
                            final String aliasThatWillBeUsed = (alias != null) 
? alias : OPEN_BRACKET + augmenterName + CLOSE_BRACKET;
                            final TransformerFactory factory = 
request.getCore().getTransformerFactory(augmenterName);
                            if (factory != null) {
                            
augmenters.addTransformer(factory.create(aliasThatWillBeUsed, new 
MapSolrParams(augmenterArgs), request));
                            onInclusionLiteralExpression(expressionBuffer, 
augmenters, false, false);   
                                                
                                                }
                                        }

                                }

                        }
                }



> field exclusion from fl
> -----------------------
>
>                 Key: SOLR-3191
>                 URL: https://issues.apache.org/jira/browse/SOLR-3191
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Luca Cavanna
>            Priority: Minor
>         Attachments: SOLR-3191.patch, SOLR-3191.patch
>
>
> I think it would be useful to add a way to exclude field from the Solr 
> response. If I have for example 100 stored fields and I want to return all of 
> them but one, it would be handy to list just the field I want to exclude 
> instead of the 99 fields for inclusion through fl.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

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

Reply via email to