Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-116255

[CCR] Newly created synonym sets or changes to existing synonym sets aren't added to the company index

    Details

      Description

      Reindexing after creating/editing the synonym set resolves this issue.
      The steps below are for master with Elasticsearch 7. They may vary depending on the branch/Elasticsearch version.

      Steps:

      1. Setup a bundle with two Elasticsearch clusters for CCR
        1. ant -f build-test-elasticsearch7.xml start-elasticsearch -Dremote.elasticsearch.clusters.enabled=true
      2. In portal, add a second Elasticsearch connection and enable CCR
      3. Connect the two Elasticsearch clusters and create follower indices
        1. ant -f build-test-elasticsearch7.xml create-follower-indices
      4. Create two Web Content titled "Apple" and "Banana"
      5. Create a new synonym set containing the keywords "apple" and "banana"
      6. Search for "apple"

      Expected results:
      Expected both "Apple" and "Banana" to be returned as search results

      Actual results:
      Only "Apple" is returned as a search result

      From checking the company index in the leader ES cluster, it appears the synonym set wasn't added to the index.

      If a keyword is added to an existing synonym set, then that keyword isn't added to the index as well.

      tim@tim:~/portal/master$ curl -X GET "localhost:9200/liferay-20098/_settings?pretty"
      {
        "liferay-20098" : {
          "settings" : {
            "index" : {
              "mapping" : {
                "total_fields" : {
                  "limit" : "7500"
                }
              },
              "number_of_shards" : "1",
              "auto_expand_replicas" : "0-all",
              "provided_name" : "liferay-20098",
              "creation_date" : "1593212063880",
              "analysis" : {
                "filter" : {
                  "english_stemmer" : {
                    "type" : "stemmer",
                    "language" : "english"
                  },
                  "english_stop" : {
                    "type" : "stop",
                    "stopwords" : "_english_"
                  },
                  "liferay_filter_synonym_es" : {
                    "type" : "synonym_graph",
                    "lenient" : "true",
                    "synonyms" : [ ]
                  },
                  "spanish_stemmer" : {
                    "type" : "stemmer",
                    "language" : "light_spanish"
                  },
                  "spanish_stop" : {
                    "type" : "stop",
                    "stopwords" : "_spanish_"
                  },
                  "english_possessive_stemmer" : {
                    "type" : "stemmer",
                    "language" : "possessive_english"
                  },
                  "liferay_filter_synonym_en" : {
                    "type" : "synonym_graph",
                    "lenient" : "true",
                    "synonyms" : [ ]
                  }
                },
                "analyzer" : {
                  "liferay_analyzer_en" : {
                    "filter" : [
                      "english_possessive_stemmer",
                      "lowercase",
                      "liferay_filter_synonym_en",
                      "english_stop",
                      "english_stemmer"
                    ],
                    "tokenizer" : "standard"
                  },
                  "keyword_lowercase" : {
                    "filter" : "lowercase",
                    "tokenizer" : "keyword"
                  },
                  "liferay_analyzer_es" : {
                    "filter" : [
                      "lowercase",
                      "spanish_stop",
                      "liferay_filter_synonym_es",
                      "spanish_stemmer"
                    ],
                    "tokenizer" : "standard"
                  }
                }
              },
              "number_of_replicas" : "0",
              "uuid" : "jeXrDUTMRDycMYCVCBWPLQ",
              "version" : {
                "created" : "7070099"
              }
            }
          }
        }
      }
      

      Reproduced on:
      Tomcat 9.0.33 + MySQL 5.7
      Portal master GIT ID: 3eb0efa20b5075c92f71d7dc276f8842cf8686f0
      Portal 7.2.x GIT ID: 66bbfa74f0f9f826db901860acaf894cffe24260
      Elasticsearch 7.7.0

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              timothy.pak Timothy Pak
              Reporter:
              timothy.pak Timothy Pak
              Participants of an Issue:
              Recent user:
              Jason Pince
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                49 weeks, 1 day ago

                  Packages

                  Version Package
                  7.2.10 DXP FP8
                  7.2.10.2 DXP SP3
                  7.2.X
                  7.3.4 CE GA5
                  7.3.10 DXP GA1
                  Master