Searching a word with underscores in Smart Search doesn't search for the exact phrase

General questions relating to Joomla! 4.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Post Reply
simbian
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Thu Apr 07, 2011 8:42 am

Searching a word with underscores in Smart Search doesn't search for the exact phrase

Post by simbian » Mon Feb 06, 2023 8:51 am

Hello, before upgrading to latest Joomla 4.x stable i was using com_search component in Joomla 3.10.x and for example if i search for the word MAN_1_4_1 it exactly gives me the results for the whole word.
In Joomla 4.x i switched to Smart Search component and if i search for the same word it gives me results for MAN and 1 and 4 and 1. How i can search for the exact phrase?

Thanks in advice.

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 42516
Joined: Sat Apr 05, 2008 9:58 pm

Re: Searching a word with underscores in Smart Search doesn't search for the exact phrase

Post by Webdongle » Mon Feb 06, 2023 10:11 am

Have you tried putting the phrase in double quotes?
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

simbian
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Thu Apr 07, 2011 8:42 am

Re: Searching a word with underscores in Smart Search doesn't search for the exact phrase

Post by simbian » Mon Feb 06, 2023 10:32 am

Yes but it says no results found for "man_1_4_1", because seems it search for the word man 1 4 1 so not considering the underscores.

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 42516
Joined: Sat Apr 05, 2008 9:58 pm

Re: Searching a word with underscores in Smart Search doesn't search for the exact phrase

Post by Webdongle » Mon Feb 06, 2023 12:41 pm

Just done a test
* Created Test Article with text ... man_1_4_1
* Created Test Article 2 with text ... man
* Created Menu item for smart search

Tested with and without search filter created in Smart search

Results using search box
smart search 01.JPG
Results using search from menu item (also auto adds to search box)
smart search 02.JPG
Both only show one result not the result for the test 2 that had the word 'man'
You do not have the required permissions to view the files attached to this post.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

simbian
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Thu Apr 07, 2011 8:42 am

Re: Searching a word with underscores in Smart Search doesn't search for the exact phrase

Post by simbian » Mon Feb 06, 2023 2:28 pm

I expected that searching the term with double quotes will show me the results containing MAN_1_4_1 and not giving no results found.
It is possible to achieve that?
If i search without double quotes it search for MAN and 1 and 4 and 1.
Maybe the _ is a special char and not considered by the smart search?

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 42516
Joined: Sat Apr 05, 2008 9:58 pm

Re: Searching a word with underscores in Smart Search doesn't search for the exact phrase

Post by Webdongle » Mon Feb 06, 2023 5:23 pm

simbian wrote:
Mon Feb 06, 2023 2:28 pm
...
If i search without double quotes it search for MAN and 1 and 4 and 1.
Maybe the _ is a special char and not considered by the smart search?
boolean logic it has to contain all three of the words man_1_4_1 but not necessarily in the same order
It does appear to ignore the underscore. Also appears not to use exact phrase.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".


Post Reply

Return to “General Questions/New to Joomla! 4.x”