How can I use in customRanking of scout-extended enum field?

20 Views Asked by At

On laravel site with algolia/scout-extended I have next description in config file on customRanking:

/* |-------------------------------------------------------------------------- | Custom Ranking |-------------------------------------------------------------------------- | | Custom Ranking is about leveraging business metrics to effectively rank search | results - it's crucial for any successful search experience. Make sure that | only "numeric" attributes are used, such as the number of sales or views. | | Supported: Null, Array | Examples: ['desc(comments_count)', 'desc(views_count)'] | */

'customRanking' => ['desc(completed_at)', 'desc(created_at)'],

I need to use for field with enum field which use integer values actually:

enum('1','2','3','4','5')

Can I use this enum field for customRanking and which condition must be used ? I prefer not to change type of the field, as I have data on the app...

"algolia/scout-extended": "^3.0",
"laravel/framework": "^10.34.2",

Thanks in advance!

0

There are 0 best solutions below