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

Add support for ResourceLoaderAware tokenizerFactories in synonym filter factories

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.4, 4.0-ALPHA
    • Fix Version/s: 3.6, 4.0-ALPHA
    • Component/s: Schema and Analysis
    • Labels:
      None

      Description

      The optional custom tokenizerFactory in SlowSynonymFilterFactory and FSTSynonymFilterFactory might require the ResourceLoader information. Thus inform(ResourceLoader) should be called if the specified tokenizerFactory is an instance of ResourceLoaderAware.

      private static TokenizerFactory loadTokenizerFactory(ResourceLoader loader, String cname, Map<String, String> args) {
        TokenizerFactory tokFactory = (TokenizerFactory) loader.newInstance(cname);
        tokFactory.init(args);
        if (tokFactory instanceof ResourceLoaderAware) {
          ((ResourceLoaderAware) tokFactory).inform(loader);
        }
        return tokFactory;
      }
      

        Attachments

        1. SOLR-2909.patch
          2 kB
          Koji Sekiguchi

          Activity

            People

            • Assignee:
              koji Koji Sekiguchi
              Reporter:
              klonik_t Tom Klonikowski
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: