core icon indicating copy to clipboard operation
core copied to clipboard

Deleted content is not removed from Site Search indexes when

Open bravous opened this issue 12 years ago • 7 comments

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:

  1. We create a contentlet and publish it.
  2. We go to the SiteSearch job scheduler and run a one off all host, for the specific index (language) and some exclude paths.
  3. We check logfile and see a message like: INFO sitesearch.ESSiteSearchAPI: writing from : sitesearch_20140922205121 url:System Host/url-title
  4. We go to the SiteSearch search tab and type a word from the title and the content is found.
  5. We go to the URL specified in the result and see the expected page.
  6. We unpublish the contentlet.
  7. We run a SiteSearch job with the same settings as before.
  8. We check the logfile and see no messages with the 'url-title' of the contentlet
  9. We go to the SiteSearch search tab and type a word from the title and the content is found.
  10. We go to the URL specified in the result and get a 404.

bravous avatar Sep 30 '14 13:09 bravous

+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.

joseorsini avatar Jan 29 '15 15:01 joseorsini

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.

oarrietadotcms avatar Feb 10 '15 14:02 oarrietadotcms

https://dotcms.mingle.thoughtworks.com/projects/dotcms/cards/145

brentgriffin avatar Aug 24 '15 16:08 brentgriffin

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.

joseorsini avatar Apr 14 '16 18:04 joseorsini

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.)

oarrietadotcms avatar Apr 21 '16 17:04 oarrietadotcms

Fixed, tested on master-3.5 // Postgres // FF

bryanboza avatar Apr 25 '16 18:04 bryanboza

Updated Site Search doc (for changes, see Incremental, about half way down the page): http://auth.dotcms.com/docs/latest/site-search

john-thomas-dotcms avatar Jun 10 '16 21:06 john-thomas-dotcms