Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-43128

simplify FTSLanguage

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 4.3.1
    • None
    • Internal Code
    • None
    • Fully Compatible
    • Dev Tools 2019-09-09, Dev Tools 2019-09-23, Dev Tools 2019-10-07
    • 90

    Description

      Currently each language makes a MONGO_INITIALIZER. This is not necessary. They can all use a single initializer. But beyond that, all languages are known in advance by fts_language.cpp so there's no need for an open registration idiom at all. This yields a massive reduction in initialization complexity for the FTSLanguage API.

      The differences between versions v1, v2, and v3 are very localized. This can be expressed through templates. This is easier now in C++17 with if constexpr and variable templates. Let's upgrade to that.

      remove test-only extern references:
      extern BasicFTSLanguage languagePorterV1;
      extern BasicFTSLanguage languageEnglishV2;
      extern BasicFTSLanguage languageFrenchV2;
      These are only used in tests, and they can use FTSLanguage::make like everyone else.

      Attachments

        Activity

          People

            billy.donahue@mongodb.com Billy Donahue
            billy.donahue@mongodb.com Billy Donahue
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: