error while fetching new domain data

Help for integrating the Laravel package
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!
User avatar
mahammadareef
Posts: 54
Joined: 14 Oct 2022, 11:54

error while fetching new domain data

Post by mahammadareef » 08 Feb 2023, 14:56

laravel version 9.48.0 , Aimeos version 2022.10.4 and PHP version 8.1.3 (Win)


getting error while fetching keyword data from my newly created keyword domain

Code: Select all

$keywordItems = \Aimeos\Controller\Frontend::create( $context, 'keyword' )->uses( $domains )
		->compare( '>', 'keyword:relevance("' . str_replace( ['"', ','], ' ', $text ) . '")', 0 )
			->sort( '-sort:keyword:relevance("' . str_replace( ['"', ','], ' ', $text ) . '")' )
			->slice( 0, $size - count( $supItems ) )
			->search();
it giving me this error
/in/shop/suggest?f_search=hot
Invalid name "keyword:relevance()"

and explain me what is the use of supplier:relevance() function

Code: Select all

	$supItems = \Aimeos\Controller\Frontend::create( $context, 'supplier' )->uses( $domains )
			->compare( '>', 'supplier:relevance("' . str_replace( ['"', ','], ' ', $text ) . '")', 0 )
			->sort( '-sort:supplier:relevance("' . str_replace( ['"', ','], ' ', $text ) . '")' )
			->slice( 0, $size )
			->search();

User avatar
aimeos
Administrator
Posts: 7889
Joined: 01 Jan 1970, 00:00

Re: error while fetching new domain data

Post by aimeos » 10 Feb 2023, 08:09

You are using a non-existing search function. In the ai-catsuggest extension, the original search functions are defined here:
https://github.com/aimeos/ai-catsuggest ... hp#L12-L27

You don't have to put them in a decorator like in the ai-catsuggest extension. Instead, you can also add it to your new manager like done here:
https://github.com/aimeos/aimeos-core/b ... /MySQL.php
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply