You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "David Smiley (JIRA)" <ji...@apache.org> on 2014/03/16 05:55:12 UTC

[jira] [Updated] (SOLR-4374) Solr could not support numeric field name in return

     [ https://issues.apache.org/jira/browse/SOLR-4374?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Smiley updated SOLR-4374:
-------------------------------

    Fix Version/s:     (was: 4.7)
                   4.8

> Solr could not support numeric field name in return
> ---------------------------------------------------
>
>                 Key: SOLR-4374
>                 URL: https://issues.apache.org/jira/browse/SOLR-4374
>             Project: Solr
>          Issue Type: Bug
>          Components: search
>    Affects Versions: 4.0
>            Reporter: Qun Wang
>              Labels: field, name, numeric, search
>             Fix For: 4.8
>
>
> When using numeric field name in schema.xml, like {code:xml}<field name="1001" type="string"...>{code}, it could not be fetched the specific field name by parameter 'fl' from Solr.
> such as 'http://localhost:8983/solr/query?q=1001:test&fl=1001', the response would be like: '"docs""[{"1001":1001,...},...]'
> In org.apache.solr.search.ReturnFields.java, it seems this code limited field name defination could not be pure numbers:
> {code:title=org.apache.solr.search.ReturnFields.java|borderStyle=solid}
> // like getId, but also accepts dashes for legacy fields
>   String getFieldName(QueryParsing.StrParser sp) {
>     sp.eatws();
>     int id_start = sp.pos;
>     char ch;
>     if (sp.pos < sp.end && (ch = sp.val.charAt(sp.pos)) != '$' && Character.isJavaIdentifierStart(ch)) {
>       sp.pos++;
>       while (sp.pos < sp.end) {
>         ch = sp.val.charAt(sp.pos);
>         if (!Character.isJavaIdentifierPart(ch) && ch != '.' && ch != '-') {
>           break;
>         }
>         sp.pos++;
>       }
>       return sp.val.substring(id_start, sp.pos);
>     }
>     return null;
>   }
> {code}
> Could we replace or remove this check of Character.isJavaIdentifierStart(ch) for allowing numeric field name defination?



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

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