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

ManagedSynonymFilterFactory does not parse multi-term synonyms

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 6.4.2
    • Fix Version/s: 6.6, 7.0
    • Component/s: Schema and Analysis
    • Security Level: Public (Default Security Level. Issues are Public)
    • Labels:
      None

      Description

      The parser that the ManagedSynonymFilterFactory uses to parse the JSON resource into a synonym map does not parse multi-term synonyms in the expected way.

      If the synonym

      {"foo bar":"baz"}

      is added to the managed resource, the expected behavior is that the multi-term synonym "foo bar" will be mapped to the synonym "baz".

      In the analyze method of SynonymMap.Parser, multiple origin terms are concatenated with a separating SynonymMap.WORD_SEPARATOR, but the analyze method is not used by the parser in the ManagedSynonymFilterFactory.

      As a workaround, multi-term synonyms can be uploaded separated by a null character, i.e., uploading

      {"foo\u0000bar":"baz"}

      works.

        Attachments

        1. SOLR-10264.patch
          7 kB
          Christine Poerschke
        2. SOLR-10264.patch
          7 kB
          Christine Poerschke
        3. SOLR-10264.patch
          6 kB
          Jörg Rathlev
        4. SOLR-10264.patch
          2 kB
          Jörg Rathlev
        5. SOLR-10264-test.patch
          4 kB
          Christine Poerschke

          Issue Links

            Activity

              People

              • Assignee:
                cpoerschke Christine Poerschke
                Reporter:
                joergr Jörg Rathlev
              • Votes:
                2 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: