Searching in Multilingual Website Topic is solved

General questions regarding the use of languages in Joomla! 3.x.

Moderators: infograf768, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Post Reply
yordan2018
Joomla! Apprentice
Joomla! Apprentice
Posts: 25
Joined: Thu Jan 04, 2018 11:44 am

Searching in Multilingual Website

Post by yordan2018 » Tue Sep 10, 2019 8:02 am

Hello,

I am using the standard search component (com_search) for a multilingual website.
Is it possible by searching to show results from all langages?

By default, the component is showing only results, restricted by language.

Thank you.

yordan2018
Joomla! Apprentice
Joomla! Apprentice
Posts: 25
Joined: Thu Jan 04, 2018 11:44 am

Re: Searching in Multilingual Website

Post by yordan2018 » Tue Sep 10, 2019 8:35 am

I think the problem can be solved by editing the file:
components/com_search/views/search/view.html.php
lines 99 – 102
// Limit search-word
$lang = JFactory::getLanguage();
$upper_limit = $lang->getUpperLimitSearchWord();
$lower_limit = $lang->getLowerLimitSearchWord();

But I am not sure how to edit "$lang = JFactory::getLanguage();"
Right now, it takes only the current language "getLanguage". What I need is to get all languages.
Any help please?

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18873
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: Searching in Multilingual Website

Post by infograf768 » Tue Sep 10, 2019 8:46 am

The filtering is done in the search plugins when multilingual is on
For Content (plg_search_content), quite a few occurrences of:

Code: Select all

					// Filter by language.
					if ($app->isClient('site') && JLanguageMultilang::isEnabled())
					{
						$subQuery->where('(f.language IS NULL OR f.language in (' . $db->quote($tag) . ',' . $db->quote('*') . '))');
					}
By curiosity, I tested taking off all occurrences and I get the correct results including a functioning url.
This would have to be done for all search plugins but the issue is that it would be overridden by a J update.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

yordan2018
Joomla! Apprentice
Joomla! Apprentice
Posts: 25
Joined: Thu Jan 04, 2018 11:44 am

Re: Searching in Multilingual Website

Post by yordan2018 » Tue Sep 10, 2019 9:11 am

infograf768 wrote:
Tue Sep 10, 2019 8:46 am
The filtering is done in the search plugins when multilingual is on
For Content (plg_search_content), quite a few occurrences of:

Code: Select all

					// Filter by language.
					if ($app->isClient('site') && JLanguageMultilang::isEnabled())
					{
						$subQuery->where('(f.language IS NULL OR f.language in (' . $db->quote($tag) . ',' . $db->quote('*') . '))');
					}
By curiosity, I tested taking off all occurrences and I get the correct results including a functioning url.
This would have to be done for all search plugins but the issue is that it would be overridden by a J update.
Thank you a lot, it works!


Post Reply

Return to “Language - Joomla! 3.x”