Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-9083

Remove deprecated <types> and <fields> from schemas

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.1, 7.0
    • Component/s: None
    • Labels:
      None

      Description

      We've deprecated these for quite some time, they should be removed from our files. I noticed that we still have them hanging around. And it's cloudy/foggy/rainy this morning so...

      Getting the proper indentation will mean reformatting these, but there will be no functional changes.

      1. SOLR-9083.patch
        1.60 MB
        Erick Erickson

        Activity

        Hide
        yseeley@gmail.com Yonik Seeley added a comment -

        Having it hang around in at least one file isn't a bad idea to make sure it still works though
        I know those tags were deprecated, but IMO, we've been a little too free in little arbitrary changes and then subsequent removals... and it costs a lot more pain for people upgrading (and costs us almost nothing to retain back compat support).

        Show
        yseeley@gmail.com Yonik Seeley added a comment - Having it hang around in at least one file isn't a bad idea to make sure it still works though I know those tags were deprecated, but IMO, we've been a little too free in little arbitrary changes and then subsequent removals... and it costs a lot more pain for people upgrading (and costs us almost nothing to retain back compat support).
        Hide
        erickerickson Erick Erickson added a comment -

        Good point. I'll do that and leave a warning in that file that it's left in for this reason so people won't copy it around arbitrarily.

        I made my first pass and I'm about to test. One file that I'm not sure of so am leaving alone is uima-fields.xml. It's a fragment of a schema with just the <fields> tag and some <field> child nodes, so it's not proper XML if the <fields> tag is removed. Plus I have no idea how it's really used, I can find no reference to it in the code base at all, even grepping on *.

        Show
        erickerickson Erick Erickson added a comment - Good point. I'll do that and leave a warning in that file that it's left in for this reason so people won't copy it around arbitrarily. I made my first pass and I'm about to test. One file that I'm not sure of so am leaving alone is uima-fields.xml. It's a fragment of a schema with just the <fields> tag and some <field> child nodes, so it's not proper XML if the <fields> tag is removed. Plus I have no idea how it's really used, I can find no reference to it in the code base at all, even grepping on *.
        Hide
        erickerickson Erick Erickson added a comment - - edited

        Hmmm, what about
        <defaultSearchField> and <solrQueryParser defaultOperator="..."/>? They've been deprecated since 3.6 so I'd guess the same argument applies. So I guess I'll remove them from most of the schema files but leave them in a couple.

        Hmm, not sure about this, let me look a bit more. Unlike removing the <fields> and <types> tags, if the code still looks at these it'd change behavior to no good purpose.

        Nope, not going here. The code still looks at these and uses them, albeit with a warning in managed_schema that it's overridden by 'df' in solrconfig.xml. So taking these out would be A Bad Thing.

        Show
        erickerickson Erick Erickson added a comment - - edited Hmmm, what about <defaultSearchField> and <solrQueryParser defaultOperator="..."/>? They've been deprecated since 3.6 so I'd guess the same argument applies. So I guess I'll remove them from most of the schema files but leave them in a couple. Hmm, not sure about this, let me look a bit more. Unlike removing the <fields> and <types> tags, if the code still looks at these it'd change behavior to no good purpose. Nope, not going here. The code still looks at these and uses them, albeit with a warning in managed_schema that it's overridden by 'df' in solrconfig.xml. So taking these out would be A Bad Thing.
        Hide
        janhoy Jan Høydahl added a comment -

        I started this work in SOLR-7041 but there are tons of tests that need re-writing, so I never got to finish it...

        Show
        janhoy Jan Høydahl added a comment - I started this work in SOLR-7041 but there are tons of tests that need re-writing, so I never got to finish it...
        Hide
        erickerickson Erick Erickson added a comment -

        Yeah, it's a pain so I'm avoiding this part, I'll just remove the <types> and <fields> tags and call it good for now.

        Problem with the other two is that we'd be changing behavior. The defaultSearchField and solrQueryParser tags are still read in the schema and still do something in the absence of , for instance, the "df" default param in solrconfig.xml. We'd really have to error out if we found this to insure that people weren't surprised I think... and that's a discussion for another JIRA (7041 as you indicated)...

        Show
        erickerickson Erick Erickson added a comment - Yeah, it's a pain so I'm avoiding this part, I'll just remove the <types> and <fields> tags and call it good for now. Problem with the other two is that we'd be changing behavior . The defaultSearchField and solrQueryParser tags are still read in the schema and still do something in the absence of , for instance, the "df" default param in solrconfig.xml. We'd really have to error out if we found this to insure that people weren't surprised I think... and that's a discussion for another JIRA (7041 as you indicated)...
        Hide
        erickerickson Erick Erickson added a comment -

        Final patch with CHANGES.txt

        Show
        erickerickson Erick Erickson added a comment - Final patch with CHANGES.txt
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 5341918a0c626afb29343c42d651911f19b084a2 in lucene-solr's branch refs/heads/master from Erick Erickson
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=5341918 ]

        SOLR-9083: Remove deprecated <types> and <fields> from schemas

        Show
        jira-bot ASF subversion and git services added a comment - Commit 5341918a0c626afb29343c42d651911f19b084a2 in lucene-solr's branch refs/heads/master from Erick Erickson [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=5341918 ] SOLR-9083 : Remove deprecated <types> and <fields> from schemas
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 03a06bb3aa79838f257b465198a546ec16591a02 in lucene-solr's branch refs/heads/branch_6x from Erick Erickson
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=03a06bb ]

        SOLR-9083: Remove deprecated <types> and <fields> from schemas
        (cherry picked from commit 5341918)

        Show
        jira-bot ASF subversion and git services added a comment - Commit 03a06bb3aa79838f257b465198a546ec16591a02 in lucene-solr's branch refs/heads/branch_6x from Erick Erickson [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=03a06bb ] SOLR-9083 : Remove deprecated <types> and <fields> from schemas (cherry picked from commit 5341918)

          People

          • Assignee:
            erickerickson Erick Erickson
            Reporter:
            erickerickson Erick Erickson
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development