Solr
  1. Solr
  2. SOLR-2663

Refactor FieldTypePluginLoader out of IndexSchema

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0-ALPHA
    • Component/s: None
    • Labels:
      None

      Description

      I have a use case where i'd like to be able to programmaticly "test" if a (single) arbitrary FieldType configuration is valid, but this is currently impossibly because the code to parse/init FieldTypes is buried deep inside IndexSchema.readSchema using anonymous inner-subclasses of AbstractPluginLoader.

      I'd like to refactor this out into a concrete public class. Regardless of my usecase, i think this is a good idea in general since it makes IndexSchema a lot easier to read/maintain and helps make it more obvious exactly what info is being used when initializing the FieldTypes+Analyzers

        Activity

        Hide
        Hoss Man added a comment -

        Committed revision 1148494.

        Show
        Hoss Man added a comment - Committed revision 1148494.
        Hide
        Robert Muir added a comment -

        Regardless of my usecase, i think this is a good idea in general since it makes IndexSchema a lot easier to read/maintain and helps make it more obvious exactly what info is being used when initializing the FieldTypes+Analyzers

        +1, I find it hard to navigate this class, I think it helps to split it up.

        Show
        Robert Muir added a comment - Regardless of my usecase, i think this is a good idea in general since it makes IndexSchema a lot easier to read/maintain and helps make it more obvious exactly what info is being used when initializing the FieldTypes+Analyzers +1, I find it hard to navigate this class, I think it helps to split it up.
        Hide
        Hoss Man added a comment -

        patch that refactors a big chunkc of IndexSchema.readSchema into a new public FieldTypePluginLoader.

        This patch also adds a new public getDefaultLuceneMatchVersion() to IndexSchema (which seems like it should have been added a while ago) and converts the existing private IndexSchema.readSimilarity method into a package protected static method since it's used both for hte global default and for per field similarity (i thought about making it public, but it wasn't entirely obvious that it's something we really want to advertise)

        Show
        Hoss Man added a comment - patch that refactors a big chunkc of IndexSchema.readSchema into a new public FieldTypePluginLoader. This patch also adds a new public getDefaultLuceneMatchVersion() to IndexSchema (which seems like it should have been added a while ago) and converts the existing private IndexSchema.readSimilarity method into a package protected static method since it's used both for hte global default and for per field similarity (i thought about making it public, but it wasn't entirely obvious that it's something we really want to advertise)

          People

          • Assignee:
            Hoss Man
            Reporter:
            Hoss Man
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development