Instantly share code, notes, and snippets.

Embed
What would you like to do?
Scout Extended Article Config
<?php
return [
/*
|--------------------------------------------------------------------------
| Searchable Attributes
|--------------------------------------------------------------------------
|
| Limits the scope of a search to the attributes listed in this setting. Defining
| specific attributes as searchable is critical for relevance because it gives
| you direct control over what information the search engine should look at.
|
| Example: ["name", "email", "unordered(city)"]
|
*/
'searchableAttributes' => ['subject', 'body', 'slug', 'author_name', 'author_email'],
/*
|--------------------------------------------------------------------------
| Custom Ranking
|--------------------------------------------------------------------------
|
| Custom Ranking is about leveraging business metrics to 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.
|
| Examples: ['desc(comments_count)', 'desc(views_count)']
|
*/
'customRanking' => ['asc(sales_count)', 'desc(views_count)', 'desc(created_at)'],
// ...
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment