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

Add support for ResourceLoaderAware tokenizerFactories in synonym filter factories

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.4, 4.0-ALPHA
    • 3.6, 4.0-ALPHA
    • Schema and Analysis
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: