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

Yonik Seeley commented on SOLR-3207:
------------------------------------

bq. Regarding the trailing characters, do you mean we shouldn't use 
isJavaIdentifierPart anymore but something else?

That was just a shortcut... looking again, it's pretty open (maybe more open 
than we want?) esp since unicode changes over time.  Anyway, 
isJavaIdentifierPart doesn't include "-" or "."  If people do need another 
separator type character, we could allow "$" too (just not as the first char, 
since that's taken by variable dereferencing).

bq. That's even more restrictive than my patch since I've used the existing 
rules applied while parsing the fl parameter (ReturnFields class).

Allowing '-' in the "fl" was just to resolve that "regression" for people who 
already used fieldnames like that and are upgrading.
If we want to start validating field names strictly, then we should bump the 
schema version number (and should skip validating when the version number is 
less than that).

                
> Add field name validation
> -------------------------
>
>                 Key: SOLR-3207
>                 URL: https://issues.apache.org/jira/browse/SOLR-3207
>             Project: Solr
>          Issue Type: Improvement
>    Affects Versions: 4.0
>            Reporter: Luca Cavanna
>             Fix For: 4.0
>
>         Attachments: SOLR-3207.patch
>
>
> Given the SOLR-2444 updated fl syntax and the SOLR-2719 regression, it would 
> be useful to add some kind of validation regarding the field names you can 
> use on Solr.
> The objective would be adding consistency, allowing only field names that you 
> can then use within fl, sorting etc.
> The rules, taken from the actual StrParser behaviour, seem to be the 
> following: 
> - same used for java identifiers (Character#isJavaIdentifierPart), plus the 
> use of trailing '.' and '-'
> - for the first character the rule is Character#isJavaIdentifierStart minus 
> '$' (The dash can't be used as first character (SOLR-3191) for example)

--
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