Page 1 of 1

Searching in Multilingual Website

Posted: Tue Sep 10, 2019 8:02 am
by yordan2018
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.

Re: Searching in Multilingual Website

Posted: Tue Sep 10, 2019 8:35 am
by yordan2018
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?

Re: Searching in Multilingual Website

Posted: Tue Sep 10, 2019 8:46 am
by infograf768
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.

Re: Searching in Multilingual Website

Posted: Tue Sep 10, 2019 9:11 am
by yordan2018
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!