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

Managed synonym lists do not include the original term in the expand

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

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.5
    • Fix Version/s: 5.5.1
    • Component/s: Schema and Analysis
    • Labels:
      None

      Description

      Spinoff from discussion in solr-user list http://find.searchhub.org/document/8dfce8a277de0f2a

      The managed synonyms filter does not behave the same way as the original synonym filter when a list is added. The original synonyms filter with default expand=true produces the following map when parsing a line:

      Input:

        a, b, c
      

      Becomes:

        a => a, b, c
        b => a, b, c
        c => a, b, c
      

      But the managed filter excludes the original term in the mapping, so an input ["a", "b", "c"] becomes:

        a => b, c
        b => a, c
        c => a, b
      

      This can also be seen in TestManagedSynonymFilterFactory.java where it is tested explicitly, while the tests for the file based synonymfilter expect an all-way expand including the original term.

      This causes a query for "a" to not match documents with the term "a", but only those with term "b" or "c".

      The offending line in ManagedSynonymFilterFactory is this

      188:   treeTerms.remove(origTerm);
      

        Attachments

        Issue Links

          Activity

            People

            • Assignee:
              janhoy Jan Høydahl
              Reporter:
              janhoy Jan Høydahl

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment