Skip to content

Instantly share code, notes, and snippets.

@nunomaduro
Created December 19, 2018 13:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nunomaduro/2de2a6f7628a6630d64373b33c45f760 to your computer and use it in GitHub Desktop.
Save nunomaduro/2de2a6f7628a6630d64373b33c45f760 to your computer and use it in GitHub Desktop.
Scout Extended Settings File
<?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.
|
| Supported: Null, Array
| Example: ["name", "ordered(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.
|
| Supported: Null, Array
| 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