Deleted content is not removed from Site Search indexes when
When deleting content using the CMS the content can still be found using the site search functionality.
A contentlet of the article structure is correctly indexed after it has been added, but once unpublished/removed its entry remains in the index (even after the indexer has run). This results in a 404 error if I follow the link from the search result page (or if I go directly).
Steps to reproduce:
- We create a contentlet and publish it.
- We go to the SiteSearch job scheduler and run a one off all host, for the specific index (language) and some exclude paths.
- We check logfile and see a message like: INFO sitesearch.ESSiteSearchAPI: writing from : sitesearch_20140922205121 url:System Host/url-title
- We go to the SiteSearch search tab and type a word from the title and the content is found.
- We go to the URL specified in the result and see the expected page.
- We unpublish the contentlet.
- We run a SiteSearch job with the same settings as before.
- We check the logfile and see no messages with the 'url-title' of the contentlet
- We go to the SiteSearch search tab and type a word from the title and the content is found.
- We go to the URL specified in the result and get a 404.
+1. Currently reproduced in demo.dotcms.com, running 3.0.1. @vianneychacon and I tested with Blog Content Types and, despite the content was unpublished at some point and the Site Search index was updated, it's still there and redirects to a 404 page once you click on the blog's link.
The hotfix for 2.5.7 is here:
https://github.com/dotCMS/support/tree/master/hotfixes/hotfix-GIT-6477_v2.5.7
I tried to apply the same code changes (https://github.com/dotCMS/support/commit/e8e7237d5bc5a21fb500d923da4e81c3aa493f2d) to 3.1 but the fix didn't work for html pages, I guess because the html pages being content now. This will need further research to fix it.
https://dotcms.mingle.thoughtworks.com/projects/dotcms/cards/145
Hotfix made for 2.5.7 was also applied for a client running 3.2.4. Tested locally running 3.2.4 + Postgres DB and works as expected. However, I don't see a commit for it on the EE repo.
EE PR: https://github.com/dotCMS/enterprise-2.x/pull/364 Core PR: https://github.com/dotCMS/core/pull/8924
We need to update the doc to reflect the expected behaviour when using incremental on Site Search(SS).
We support the cases when you Unpublish or/and Archive a piece of content. In this case the next time the SS (with incremental) runs will remove the piece of content from the index.
We don't support the case when a piece of content is completely Deleted from dotCMS. In this case we don't have a way to compare the old bundle with the updated content (because the deleted content won't show up in the updated list.)
Fixed, tested on master-3.5 // Postgres // FF
Updated Site Search doc (for changes, see Incremental, about half way down the page): http://auth.dotcms.com/docs/latest/site-search