Feature No Code Attached Yet
avatar pixelhexe
pixelhexe
27 Apr 2023

Steps to reproduce the issue

  1. You'll need some articles in your system to reproduce the issue. If not yet done, write some articles in your backend.
  2. Run the smart search indexer.
  3. Create a menu item with item type "Search".
  4. In frontend search for your user name (name of the author of the articles).

Expected result

Search in frontend should only give results of articles (if plugin "smart search - content" is activated as an example) in which the name of the author is in the title or text of the article.

Actual result

Search in frontend shows all articles which are written by this user/author.

Deselecting the Authors in Content Maps of Smart Search (in backend) does not help.

System information (as much as possible)

Joomla! 4.3.0
(but it is an old issue)
PHP 8.1

Additional comments

A few years old but seems not to be solved yet, see:

Core hack (not advisable of course) is to comment out some rows in this file
plugins\finder\content\src\Extension\Content.php
(earlier than J 4.3.0 it was in the file plugins\finder\content\content.php):

=> function index(Result $item)

$item->metaauthor = $item->metadata->get('author');
$item->addInstruction(Indexer::META_CONTEXT, 'metaauthor');
$item->addInstruction(Indexer::META_CONTEXT, 'author');
$item->addInstruction(Indexer::META_CONTEXT, 'created_by_alias');

// Add the author taxonomy data.
        if (!empty($item->author) || !empty($item->created_by_alias)) {
            $item->addTaxonomy('Author', !empty($item->created_by_alias) ? $item->created_by_alias : $item->author, $item->state);
        }

Then start the indexer and you are good => search in frontend will give the expected results, without searching for the name of the person who had written the article.
Probably it would be similar in the other smart search plugins, not only in content search.

An additional option in search menu item would be very helpful: exclude "created by"/"created by alias" from search results.

avatar pixelhexe pixelhexe - open - 27 Apr 2023
avatar joomla-cms-bot joomla-cms-bot - change - 27 Apr 2023
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 27 Apr 2023
avatar richard67 richard67 - change - 27 Apr 2023
Labels Added: ?
avatar richard67 richard67 - labeled - 27 Apr 2023
avatar Hackwar Hackwar - change - 8 May 2023
Status New Closed
Closed_Date 0000-00-00 00:00:00 2023-05-08 07:14:10
Closed_By Hackwar
Labels Added: Feature
Removed: ?
avatar Hackwar
Hackwar - comment - 8 May 2023

Here is a PR for that, waiting to be tested for 1.5 years.
#36867
Related as well: #39961
Related as well: #39751

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

avatar Hackwar Hackwar - close - 8 May 2023

Add a Comment

Login with GitHub to post a comment