Get search result for all languages
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
- ahmed31916
- Advanced
- Posts: 148
- Joined: 14 Apr 2022, 12:15
Get search result for all languages
Hello,
How to get a result of all languages (not just current langaue)?
Does, adding the star solve the problem?
How to get a result of all languages (not just current langaue)?
Code: Select all
$search->make( 'index.text:name', [app()->getLocale()] )
Code: Select all
$search->make( 'index.text:name', ['*'] )
Re: Get search result for all languages
Searching for product texts independent of a language is not available when using the index manager because the language ID is used here and it's mandatory:
https://github.com/aimeos/aimeos-core/b ... hp#L59-L66
You can overwrite the class and remove from "index.text:relevance" (MySQL example):
https://github.com/aimeos/aimeos-core/b ... hp#L59-L66
You can overwrite the class and remove from "index.text:relevance" (MySQL example):
Code: Select all
public function getSearchAttributes( bool $withsub = true ) : array
{
$level = \Aimeos\MShop\Locale\Manager\Base::SITE_ALL;
$level = $this->context()->config()->get( 'mshop/index/manager/sitemode', $level );
$expr = $this->siteString( 'mindte."siteid"', $level );
$list = parent::getSearchAttributes( $withsub );
$list['index.text:relevance']['internalcode'] = $this->siteString( 'mindte."siteid"', $level ) . ' AND MATCH( mindte."content" ) AGAINST( $2 IN BOOLEAN MODE )';
return $list;
}
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star