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

Jan Høydahl commented on SOLR-3191:
-----------------------------------

I think by definition a field name cannot start with "-" since even the Lucene 
query syntax must support the alternative NOT syntax {{-inStock:true}}. I 
therefore think we should borrow this syntax over here, just as we are doing 
for dismax {{uf}} in SOLR-3026. It should be easy enough to parse.

Examples:
{noformat}
q=foo&fl=-title           # All fields except title (include * is implicit)
q=foo&fl=-title,-body     # All fields except title and body
q=foo&fl=-*_s             # All fields except those matching *_s pattern
q=foo&fl=foo,-bar         # Would be the same as saying only &fl=foo, since an 
explicit field resets the list
q=foo&fl=-bar,foo         # same as above. Order not important?
q=foo&fl=-foo,foo         # same as above. Probably all the exclude fields 
should be parsed last and override positive?
q=foo&fl=*,-title         # same as only -title as * is implicit include when 
only exclude fields listed?
q=foo&fl=-*               # Hmm, makes no sense, if you're not returning 
anything you should ask for rows=0 ??
q=foo&fl=*z,-*xyz         # Include all fields ending in "z" except those 
ending in "xyz", negative rule applied last
{noformat}

                
> 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
>
> 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



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

Reply via email to