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

ManagedSynonymFilterFactory does not parse multi-term synonyms

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 6.4.2
    • 6.6, 7.0
    • Schema and Analysis
    • 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
          2 kB
          Jörg Rathlev
        2. SOLR-10264-test.patch
          4 kB
          Christine Poerschke
        3. SOLR-10264.patch
          6 kB
          Jörg Rathlev
        4. SOLR-10264.patch
          7 kB
          Christine Poerschke
        5. SOLR-10264.patch
          7 kB
          Christine Poerschke

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment