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

Demian Katz commented on SOLR-3191:
-----------------------------------

I just took a look at test coverage for this patch, and it appears that there 
are a couple of areas where more tests are needed:

1.) I'm not sure what public static String getFieldName(QueryParsing.StrParser 
sp) is for, but it's not covered at all.

2.) None of the logic related to collectingLiteral seems to be getting tested. 
I tried adjusting the test class to include a field list containing a function 
and a literal:

  @Test
  public void testFunctionAndLiteralInFieldList() {
        ReturnFields rf = new SolrReturnFields(req("fl", 
"ordOfId:{!func}ord(id),literal:1234"));
        assertTrue(rf.wantsField("ordOfId"));
        assertTrue(rf.wantsField("literal"));
        assertFalse(rf.wantsField("xxx"));
        assertFalse(rf.wantsAllFields());
  }

Unfortunately, while this test passes, it does not appear to affect the 
coverage as I had expected.

3.) For a little low-hanging-fruit coverage improvement, I added this to 
testFunkyFieldNames, since the method was not covered at all:

assertEquals("[#foo_s, id]", rf.getRequestedFieldNames().toString());

I'm not sure if that's actually valuable.

Apologies if any of these comments seem ill-informed; this is my first foray 
into the Solr code. However, we'd really like to see this patch committed to 
master, and I'm told that good patch test coverage helps things move along, so 
I thought I'd take a stab at it. I hope this is of some use! Please let me know 
if I can be of further assistance.

> 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, 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.3.4#6332)

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

Reply via email to