core icon indicating copy to clipboard operation
core copied to clipboard

Deleted tags keep showing after running ES query

Open shaydotcms opened this issue 8 years ago • 2 comments

When some content has a tag that eventually is deleted from Tags portlet, this deleted tag keeps showing in the search results when you run an ES query. In addition, when you go to Edit the same content that had the tag, you can see the tag is still showing unless you flush all caches from Maintenance portlet.

Expected Behavior

Once the tag is delete, ES should not display the tag in the search results. In addition, that deleted tag should not show up when you go to the Edit the content that had the tag previously.

Current Behavior

After the tag is deleted rom Tags portlet, this deleted tag keeps showing in the search results when you run an ES query. In addition, when you go to Edit the same content that had the tag, you can see the tag is still showing unless you flush all caches from Maintenance portlet.

Steps to Reproduce (for bugs)

  1. Login to dotcms
  2. Navigate to Dev Tools> ES Search
  3. Run the following query
{
       "query": {
          "query_string": {
             "query": "+contenttype:news"
          }
       },
       "aggs" : {
          "tag" : {
             "terms" : {
                "field": "tags",
                "size" : 20
             }
          }
       },
       "size":0
}
  1. You may see something like this:

image

  1. Choose one of the tags displayed in the list (i.e."debt") and delete it directly by going to Types & Tags> Tags portlet
  2. Run again the same ES query on step 3. You will see the tag is still showing in the list.
  3. In addition, if you look for those contents that had the tag before it was deleted, you can see that those contents still show the tag even when now it's been deleted, for example:
{
  "query": {
    "bool": {
      "must": [
        {
          "term": {
            "news.tags": "debt"
          }
        }
      ]
    }
  }
}
  • Search results: image

  • Content still shows deleted tag image

Your Environment

  • dotCMS version used: master branch / reproduced also in http://demo.dotcms.com
  • Database and version: Postgres 9.6.6
  • Operating System and version: Mac OS 10.10.5
  • Browser Name and version: Firefox v58.0
  • Application Server and version: Tomcat 8
  • Java Brand and version: Java 8

shaydotcms avatar Mar 06 '18 17:03 shaydotcms

Solved in https://github.com/dotCMS/core/issues/13872

nollymar avatar Mar 16 '18 19:03 nollymar

Passed QA. System is not showing deleted tags after running ES query. Tested on master branch / Postgres 9.6.6 / Mac OS 10.10.5 / Firefox v58.0 / Tomcat 8 / Java 8

shaydotcms avatar Mar 19 '18 15:03 shaydotcms