algolia/algoliasearch-client-php

Can I set Searchable attributes and Ranking and sorting with laravel/scout programmatically?

PetroGromovo opened this issue · 1 comments

At https://laravel.com/docs/10.x/scout#configuring-searchable-data
plugin laravel/scout used to add algolia support and reading some manuals
I found that I need to set Searchable attributes and Ranking and sorting only on algolia side ?
Can I set then "on fly" when I import my data with command ?

scout:import App\Models\Model"

?

I remember that I used such functionality, but with other package https://github.com/algolia/scout-extended.

Has laravel/scout such functionality ? This plugin seems preferable, as it is official laravel plugin...

Here https://laravel.com/docs/10.x/scout#customizing-engine-searches
I found search method parameters and second options parameter is very interesting, but I do not need any of geo_distance, location parameters. Please give a reference to full possible option parameters as I need “Searchable attributes” and “Ranking and sorting” parameters...

"laravel/framework": "^10.34.2",
"algolia/algoliasearch-client-php": "^3.4",

Thanks in advance!

Hey there! The scout extended package is built on top of the official Laravel plugin, meaning Scout Extended exists alongside Laravel Scout. It should be safe to use both packages at the same time and leverage the import command as you mentioned to set searchable attributes etc..

For any Laravel Scout questions and feature requests, please refer to their documentation or repository.