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

Jason Gerlowski commented on SOLR-8110:
---------------------------------------

1.) Sounds like (aside from a few comments about the particular characters that 
the enforcement allows/denies) that no one's got a problem with the idea of 
enforcement on principle.  So I'll start in on the changes Hoss suggested in 
his initial comment.

2.) As for the characters allowed/denied by enforcement.  I lean towards 
re-using the character set already enforced for collection/shard/core creation: 
[a-zA-Z0-9_.].  I really think keeping consistency among the identifier rules 
is important, as people only need to learn one set of rules.  We _could_ lean 
on a set of identifier rules that people already know (i.e. Java identifiers), 
but I'd argue that (1) the special characters allowed by the current 
recommendations (_, .) are more generally useful than those allowed by Java 
identifiers (_, $), and (2) Java identifiers have a few edge cases that'd be a 
pain to deal with (reserved keywords, can't start with $, can't start with 
number, etc.).  Admittedly, these are rare cases, and I doubt they would be hit 
frequently, but it does seem like unnecessary complications to me.

But that's just my opinion.  Is there some value I'm missing to using the same 
identifier pattern as Java?  Very possible I'm just overlooking something.

In the meantime, I'll aim to use the current "recommendations", but I'll 
structure the patch in such a way that it'll be easier to change the 
allowed-char-set with a line or two.  That way this discussion doesn't have to 
block my work on this.

Thanks everyone for the input so far.

> Start enforcing field naming recomendations in next X.0 release?
> ----------------------------------------------------------------
>
>                 Key: SOLR-8110
>                 URL: https://issues.apache.org/jira/browse/SOLR-8110
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Hoss Man
>
> For a very long time now, Solr has made the following "recommendation" 
> regarding field naming conventions...
> bq. field names should consist of alphanumeric or underscore characters only 
> and not start with a digit.  This is not currently strictly enforced, but 
> other field names will not have first class support from all components and 
> back compatibility is not guaranteed.  ...
> I'm opening this issue to track discussion about if/how we should start 
> enforcing this as a rule instead (instead of just a "recommendation") in our 
> next/future X.0 (ie: major) release.
> The goals of doing so being:
> * simplify some existing code/apis that currently use hueristics to deal with 
> lists of field and produce strange errors when the huerstic fails (example: 
> ReturnFields.add)
> * reduce confusion/pain for new users who might start out unaware of the 
> recommended conventions and then only later encountering a situation where 
> their field names are not supported by some feature and get frustrated 
> because they have to change their schema, reindex, update index/query client 
> expectations, etc...



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