You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Frank Greguska <fg...@gmail.com> on 2015/11/17 17:39:44 UTC

Why can a dynamic field ONLY start or end with '*' but not both?

Hello,

Prior to the implementation of SOLR-3251
<https://issues.apache.org/jira/browse/SOLR-4503>, it seems it was possible
to create dynamic fields using multiple 'glob' characters.

e.g. <dynamicField name="*Idx*" type="int" indexed="true" stored="true"/>

Since this commit
<https://github.com/apache/lucene-solr/commit/5cbf7f54c38924c19f9cdc347c729abfd7b17076#diff-ca2b07d8a1eaf45cdb5e73eba102ba38R423>,
a constraint has been added that the name of a dynamic field must either
start or end with '*', but not both. Was this decision discussed anywhere?
It's causing a schema of mine to break after upgrading and I'm just curious
if there was a technical reason for implementing this constraint.

Thank you,

Frank

P.S. I've asked a related question
<http://stackoverflow.com/q/33747996/953327> on StackOverflow.

Re: Why can a dynamic field ONLY start or end with '*' but not both?

Posted by Erick Erickson <er...@gmail.com>.
Starting and ending globs were never officially supported, at
least as far back as 3.6. They were never programmatically
enforced either apparently.

This is from the 3.6 schema.xml:

 <!-- Dynamic field definitions.  If a field name is not found, dynamicFields
        will be used if the name matches any of the patterns.
        RESTRICTION: the glob-like pattern in the name attribute must have
        a "*" only at the start or the end....
  -->

So  it was not really discussed that I know about relative to the JIRAs you
mentioned, more like you were using a feature that just happened to work
despite explicitly being unsupported.

Best,
Erick



On Tue, Nov 17, 2015 at 8:39 AM, Frank Greguska <fg...@gmail.com> wrote:
> Hello,
>
> Prior to the implementation of SOLR-3251
> <https://issues.apache.org/jira/browse/SOLR-4503>, it seems it was possible
> to create dynamic fields using multiple 'glob' characters.
>
> e.g. <dynamicField name="*Idx*" type="int" indexed="true" stored="true"/>
>
> Since this commit
> <https://github.com/apache/lucene-solr/commit/5cbf7f54c38924c19f9cdc347c729abfd7b17076#diff-ca2b07d8a1eaf45cdb5e73eba102ba38R423>,
> a constraint has been added that the name of a dynamic field must either
> start or end with '*', but not both. Was this decision discussed anywhere?
> It's causing a schema of mine to break after upgrading and I'm just curious
> if there was a technical reason for implementing this constraint.
>
> Thank you,
>
> Frank
>
> P.S. I've asked a related question
> <http://stackoverflow.com/q/33747996/953327> on StackOverflow.