How to extend search functionality ?

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
dheeraj
Posts: 26
Joined: 02 Jan 2021, 08:47

How to extend search functionality ?

Post by dheeraj » 29 Jan 2021, 10:17

Laravel : 8.12
Aimeos : 2020.10
PHP Version : 7.4.13
Environment : Windows


First of all your support forum is great.
Now let's talk about my problem.

I tried to search products items in the frontend site and noticed that search keywords are matched against the product name only. I want to extend this functionality so that if user searches a product, the search keyword should be matched against product name as well as product categories and also searching parent categories should also include product from child categories as well in the search results.
I am also thinking of adding product tagging feature, so that search keywords are also matched against those tags and products with the matched tags are included in the search results.

Kindly guide me how to implement these in the aimeos? :roll:

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

Re: How to extend search functionality ?

Post by aimeos » 01 Feb 2021, 08:33

The full text search uses the product name and the product description but not the category name. For that, you have to extend the indexer and add the category name here:
https://github.com/aimeos/aimeos-core/b ... #L757-L786
The product item contains the categories the product is attached to if

Code: Select all

[
	// ...
	'catalog' => ['text']
is added in the configuration:
https://github.com/aimeos/aimeos-core/b ... #L575-L580

Products of subcategories can be included using:
https://aimeos.org/docs/latest/config/c ... ts/#levels
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply