Lucene - Core
  1. Lucene - Core
  2. LUCENE-5219

Make SynonymFilterFactory format attribute pluggable

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.6, 6.0
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      It would be great to allow custom synonym formats to work with SynonymFilterFactory. There is already a comment in the code to make it pluggable.

      1. LUCENE-5219.patch
        21 kB
        Ryan Ernst
      2. LUCENE-5219.patch
        21 kB
        Ryan Ernst

        Activity

        Hide
        Ryan Ernst added a comment -

        Here is a patch which loads the value of the format attribute as a plugin if it doesn't match the existing shortcuts of "solr" or "wordnet".

        Show
        Ryan Ernst added a comment - Here is a patch which loads the value of the format attribute as a plugin if it doesn't match the existing shortcuts of "solr" or "wordnet".
        Hide
        Robert Muir added a comment -

        This patch looks great to me. Can you fix the javadocs for parse()?

        In this case its pretty obvious which exception happens for what, so its ok to remove the throws elements, or just add some short description (e.g. IOException if there was problem reading the file, ParseException if its syntactically incorrect, etc)

        FYI: You can check the javadocs by doing 'ant documentation-lint':

        -ecj-javadoc-lint-src:
         [ecj-lint] Compiling 365 source files
         [ecj-lint] ----------
         [ecj-lint] 1. ERROR in /home/rmuir/workspace/lucene-clean-trunk/lucene/analysis/common/src/java/org/apache/lucene/analysis/synonym/SynonymMap.java (at line 303)
         [ecj-lint] 	* @throws IOException
         [ecj-lint] 	          ^^^^^^^^^^^
         [ecj-lint] Javadoc: Description expected after this reference
         [ecj-lint] ----------
         [ecj-lint] 2. ERROR in /home/rmuir/workspace/lucene-clean-trunk/lucene/analysis/common/src/java/org/apache/lucene/analysis/synonym/SynonymMap.java (at line 304)
         [ecj-lint] 	* @throws ParseException
         [ecj-lint] 	          ^^^^^^^^^^^^^^
         [ecj-lint] Javadoc: Description expected after this reference
         [ecj-lint] ----------
         [ecj-lint] 2 problems (2 errors)
        
        Show
        Robert Muir added a comment - This patch looks great to me. Can you fix the javadocs for parse()? In this case its pretty obvious which exception happens for what, so its ok to remove the throws elements, or just add some short description (e.g. IOException if there was problem reading the file, ParseException if its syntactically incorrect, etc) FYI: You can check the javadocs by doing 'ant documentation-lint': -ecj-javadoc-lint-src: [ecj-lint] Compiling 365 source files [ecj-lint] ---------- [ecj-lint] 1. ERROR in /home/rmuir/workspace/lucene-clean-trunk/lucene/analysis/common/src/java/org/apache/lucene/analysis/synonym/SynonymMap.java (at line 303) [ecj-lint] * @throws IOException [ecj-lint] ^^^^^^^^^^^ [ecj-lint] Javadoc: Description expected after this reference [ecj-lint] ---------- [ecj-lint] 2. ERROR in /home/rmuir/workspace/lucene-clean-trunk/lucene/analysis/common/src/java/org/apache/lucene/analysis/synonym/SynonymMap.java (at line 304) [ecj-lint] * @throws ParseException [ecj-lint] ^^^^^^^^^^^^^^ [ecj-lint] Javadoc: Description expected after this reference [ecj-lint] ---------- [ecj-lint] 2 problems (2 errors)
        Hide
        Ryan Ernst added a comment -

        Sorry about that. The new patch passes documentation-lint.

        Show
        Ryan Ernst added a comment - Sorry about that. The new patch passes documentation-lint.
        Hide
        ASF subversion and git services added a comment -

        Commit 1524839 from Robert Muir in branch 'dev/trunk'
        [ https://svn.apache.org/r1524839 ]

        LUCENE-5219: Add support to SynonymFilterFactory for custom parsers

        Show
        ASF subversion and git services added a comment - Commit 1524839 from Robert Muir in branch 'dev/trunk' [ https://svn.apache.org/r1524839 ] LUCENE-5219 : Add support to SynonymFilterFactory for custom parsers
        Hide
        ASF subversion and git services added a comment -

        Commit 1524849 from Robert Muir in branch 'dev/branches/branch_4x'
        [ https://svn.apache.org/r1524849 ]

        LUCENE-5219: Add support to SynonymFilterFactory for custom parsers

        Show
        ASF subversion and git services added a comment - Commit 1524849 from Robert Muir in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1524849 ] LUCENE-5219 : Add support to SynonymFilterFactory for custom parsers
        Hide
        Robert Muir added a comment -

        Thanks Ryan!

        Show
        Robert Muir added a comment - Thanks Ryan!

          People

          • Assignee:
            Unassigned
            Reporter:
            Ryan Ernst
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development