Skip to content

Conversation

@pixelhexe
Copy link

Pull Request for Issue #44549 .

Summary of Changes

Add option to finder plugin "Smart Search - Content" for excluding search for author's name in article field "created by".

finder-new-option

Testing Instructions

You'll need some articles written by an author and in one or several articles insert the author's name as normal content (article text). Add a finder / smart search into your site as you would generally do. For example add a menu item with menu item type "Search" without special filters or advanced features. Don't forget to index your content in backend in the search component.

After the changes of this pull request you'll have an additional option in the finder plugin content "Include articles 'created by' (author's name)?" with default value "yes". Everything remains as it is if this option is not changed.

For testing purposes switch the new option to "no" and save it. Then you'll need to clear your search index and reindex content.

In frontend, search for the author's name which you included in the article text of one or more articles.

Actual result BEFORE applying this Pull Request

The search results will show all articles created by this author.

Users are confused because they don't know how these search results come about - unless the site is configured so that the authors are always visible in the articles, which is often not the case.
They would expect only those articles to be listed where the author's name appears in the normal article text.

Expected result AFTER applying this Pull Request

The search results will only show those articles in which the author's name is included in the article content text.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@jsubri
Copy link
Contributor

jsubri commented Nov 30, 2024

I have tested this item ✅ successfully on be0a12b

Tested on top of 5.2.2.
With the xml default="1" we are having the current behaviour, with the plugin set to "No" the Article's Author are no longer displayed.
Nice fix.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44554.

@Hackwar
Copy link
Member

Hackwar commented Dec 1, 2024

The way you implemented this, this definitely is a new feature and needs to go into 5.3. I'm going to discuss this in the CMS maintenance team if we expect the existing option for the taxonomy to also remove this from the search index. In that case this might be considered a bug and can be fixed in 5.2. In any case I'd like to see this handled for all things we are adding to the index (author, category, tags) and for all core finder plugins.

@Hackwar
Copy link
Member

Hackwar commented Jan 16, 2025

I'm sorry, but I will have to handle this as a new feature and as I said, I would need more than just one "random" part of the article to be able to be switched off. I'm moving this to 5.3 for now and will switch the label to feature instead. Please change it as I described above.

@Hackwar Hackwar added Feature and removed bug labels Jan 16, 2025
@Hackwar Hackwar changed the base branch from 5.2-dev to 5.3-dev January 16, 2025 08:23
@QuyTon QuyTon added the Updates Requested Indicates that this pull request needs an update from the author and should not be tested. label Feb 5, 2025
@shrutidhole123
Copy link

I have tested this item 🔴 unsuccessfully on be0a12b


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44554.

@komalm
Copy link

komalm commented Feb 22, 2025

I have tested this item ✅ successfully on be0a12b

Expected Result: Only articles that mention "Author A" within the content should appear in the search results. Articles authored by "Author A" but without their name in the content should be excluded.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44554.

@ghost
Copy link

ghost commented Feb 22, 2025

@shrutidhole123 Can you please always provide the reasons for a unsuccessfully test so developer can investigate?

@crommie
Copy link

crommie commented Feb 22, 2025

I have tested this item ✅ successfully on be0a12b

Works as described


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44554.

@ceus1984
Copy link

I have tested this item ✅ successfully on be0a12b

the code does what is expected. But what is the sense of it? If I search for an author I would expect that it appears also if not being mentioned in the test of the article.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44554.

@brianteeman
Copy link
Contributor

I have tested this item 🔴 unsuccessfully on be0a12b

This is incomplete.

Users are confused because they don't know how these search results come about - unless the site is configured so that the authors are always visible in the articles, which is often not the case.
They would expect only those articles to be listed where the author's name appears in the normal article text.

If, and its a big if, you think its necessary to exclude the created_by from the search then you also need to exclude created_by_alias otherwise the same "problem" is still present


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44554.

@HLeithner HLeithner changed the base branch from 5.3-dev to 6.0-dev March 4, 2025 17:18
@HLeithner
Copy link
Member

This pull request has been automatically rebased to 6.0-dev.

@HLeithner HLeithner changed the title Exclude search results 'created_by' [6.0] Exclude search results 'created_by' Mar 4, 2025
@rdeutz rdeutz removed the PR-5.3-dev label Mar 5, 2025
@pixelhexe
Copy link
Author

Sorry, I missed the conversation here the last weeks. Thanks for testing, everybody!

@brianteeman

I have tested this item 🔴 unsuccessfully on be0a12bThis is incomplete.

Users are confused because they don't know how these search results come about - unless the site is configured so that the authors are always visible in the articles, which is often not the case.
They would expect only those articles to be listed where the author's name appears in the normal article text.

If, and its a big if, you think its necessary to exclude the created_by from the search then you also need to exclude created_by_alias otherwise the same "problem" is still present
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44554.

No, I don't think that it is necessary to exclude the created_by from the search, but it would be quite useful to offer the possibility. Please note that the fix does not change the search as it is, but it offers the possibility to hugely improve search results for some websites. Because in some cases you just don't want to search by the author's name (the name could also be a common word) and find all articles which he or she has written regardless of the article content itself.

As for created_by_alias, my fix seems not to affect it, because - strange enough! - this field in DB table #__content is always empty in all of my joomla sites! What's going on here? Is this field needed at all in core?

@brianteeman
Copy link
Contributor

As for created_by_alias, my fix seems not to affect it, because - strange enough! - this field in DB table #__content is always empty in all of my joomla sites! What's going on here? Is this field needed at all in core?

This field is used if you are putting a name here
image

@pixelhexe
Copy link
Author

As for created_by_alias, my fix seems not to affect it, because - strange enough! - this field in DB table #__content is always empty in all of my joomla sites! What's going on here? Is this field needed at all in core?

This field is used if you are putting a name here image

Thanks for the clarification, but usually the users already have names in the created_by field, don't they?
Nevertheless, I'm happy to adapt my fix (which I still have to do for J 6.0 anyway) so that the created_by_alias field would also be excluded if you switch the search for created_by to NO in the plugin, as shown in my first screenshot.
I wouldn't introduce a second radio button for this, as that would only confuse most users who don't even know that there is a difference between ‘Created By’ and ‘Created by Alias’.

@brianteeman
Copy link
Contributor

Thanks for the clarification, but usually the users already have names in the created_by field, don't they?

Think of a webmaster creating an article for the CEO. It should say the author is the CEO not the webmaster. That is what the field is used for.

My point is that if you want to exclude created_by from the search then you would also want to exclude created_by_alias

Personally I think its a daft feature request but if its to be done then it should be done properly

@pixelhexe
Copy link
Author

Thanks for the clarification, but usually the users already have names in the created_by field, don't they?

Think of a webmaster creating an article for the CEO. It should say the author is the CEO not the webmaster. That is what the field is used for.

Thank you, I got it now. It just never occured on my Joomla websites, but this might be useful for other sites.

My point is that if you want to exclude created_by from the search then you would also want to exclude created_by_alias

Yes, thank you for the hint. I will do so in a few days (by just moving one line of code).

Personally I think its a daft feature request but if its to be done then it should be done properly

Totally agree (with the second part of your comment ;)

@pixelhexe
Copy link
Author

I updated my pull request to include also the field of 'created by alias' - thanks once again to @brianteeman for the valuable advice.
I will be happy if this small feature of the finder plugin finds its way into Joomla 6.

@QuyTon QuyTon removed the Updates Requested Indicates that this pull request needs an update from the author and should not be tested. label May 12, 2025
@HLeithner HLeithner changed the base branch from 6.0-dev to 6.1-dev August 31, 2025 11:57
@HLeithner
Copy link
Member

This pull request has been automatically rebased to 6.1-dev.

@HLeithner HLeithner changed the title [6.0] Exclude search results 'created_by' [6.1] Exclude search results 'created_by' Aug 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.