No Code Attached Yet bug
avatar nzyeehaa
nzyeehaa
9 Aug 2023

while I have a number of issues with smart search and the old search is not working on my upgraded site...
I have made a clean install of J4.1 to test the smart search / finder operation.

smart search includes _archived_ content by default.

filters were unable to remove archived pages

on my clean install I added a page called...

  • published art which was published
  • unpublished art which was unpublished
  • archived art which was archived
  • trashed art which was trashed

and did a search for art - finder displays ...

  • published art
  • archived art

I don't want archived pages showing up in my search results...
to stop this "feature" from happening...
open administrator\components\com_finder\src\Indexer\Adapter.php
navigate to the bottom of the page - (line 901 on my file) and look for "case 2: " then comment it out like this...

// Published ~and archived items only~ should return a published state
case 1:
// case 2:
return 1;

go to administrator panel > components > smart search > index and press the "index" button at the top

search should omit them from search results. (Your mileage may vary - you may need to delete the index and do a re-index)

Be aware - future updates may break these changes, so until they are included in the core, you may need to redo this process every time you update Joomla.

Hope it helps someone.

(explanation...
case -2 is trashed
case 0 is unpublished
case 1 is published
case 2 is archived)

Originally posted by @nzyeehaa in #37754 (comment)

avatar nzyeehaa nzyeehaa - open - 9 Aug 2023
avatar joomla-cms-bot joomla-cms-bot - change - 9 Aug 2023
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 9 Aug 2023
avatar Hackwar
Hackwar - comment - 11 Aug 2023

Please update to Joomla 4.3, rebuild the index and check again. A lot of issues like these were fixed between 4.1 and 4.3

avatar Hackwar Hackwar - change - 11 Aug 2023
Labels Added: Information Required bug
avatar Hackwar Hackwar - labeled - 11 Aug 2023
avatar Hackwar Hackwar - labeled - 11 Aug 2023
avatar nzyeehaa
nzyeehaa - comment - 12 Aug 2023

@Hackwar I first reported this some time ago, but it is still happening in 4.3.3 so have manually updated files as listed above

avatar Quy Quy - change - 15 Aug 2023
Labels Removed: Information Required
avatar Quy Quy - unlabeled - 15 Aug 2023
avatar Hackwar Hackwar - change - 28 Aug 2023
Status New Closed
Closed_Date 0000-00-00 00:00:00 2023-08-28 21:42:58
Closed_By Hackwar
avatar Hackwar Hackwar - close - 28 Aug 2023
avatar Hackwar
Hackwar - comment - 28 Aug 2023

I have been thinking about this a lot and I was about to refuse this feature. However, I then saw that we had an option for this in com_search, so I've written a PR to add this into 5.0. Please test PR #41504

Since we have a PR, I'm closing this issue.

avatar nzyeehaa
nzyeehaa - comment - 30 Aug 2023

@Hackwar thanks and good work...

for the indecision...
Joomlas native workflow hides archived pages.
in the front end,
a page marked archived does not show in a blog/list layout (tested with fresh install/cassiopeia)
a page marked archived does not show on the homepage (tested with fresh install/cassiopeia)

if you specifically enter the articles url it will show - but this may be due to a current routing issue

in the backend,
search for an archived article and it will not show up
archived pages are hidden unless you specifically filter for archived

Add a Comment

Login with GitHub to post a comment