Update (fixes)
This commit is contained in:
@@ -28,7 +28,7 @@ public function searchResults(Request $request, $query)
|
||||
|
||||
$breadcrumbs = collect([
|
||||
['name' => 'Home', 'url' => route('front.home')],
|
||||
['name' => 'News Bites', 'url' => route('front.search.results',['query' => $query])],
|
||||
['name' => 'News Bites', 'url' => route('front.all')],
|
||||
['name' => $query, 'url' => null],
|
||||
]);
|
||||
|
||||
@@ -42,7 +42,7 @@ public function searchResults(Request $request, $query)
|
||||
|
||||
$rss_posts = RssPost::with('category')
|
||||
->where('status', 'published')
|
||||
->whereRaw("to_tsvector('english', title || ' ' || bites || ' ' || body) @@ plainto_tsquery('english', ?)", [trim(preg_replace('/\s+/', ' ', $query))])
|
||||
->whereRaw("to_tsvector('english', title || ' ' || bites || ' ' || keyword_list) @@ plainto_tsquery('english', ?)", [trim(preg_replace('/\s+/', ' ', $query))])
|
||||
->where('published_at', '<=', now())
|
||||
->orderBy('published_at', 'desc')
|
||||
->cursorPaginate(60);
|
||||
|
||||
@@ -106,9 +106,7 @@ public static function handle(int $rss_post_id)
|
||||
$rss_post->category_id = $category->id;
|
||||
}
|
||||
|
||||
$post_body = $rss_post->body;
|
||||
$post_body .= implode($words_to_add_in_body);
|
||||
$rss_post->body = $post_body;
|
||||
$rss_post->keyword_list = implode(",", $words_to_add_in_body);
|
||||
|
||||
$rss_post->status = 'published';
|
||||
$rss_post->save();
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
* @property string|null $entities
|
||||
* @property string|null $metadata
|
||||
* @property string|null $bites
|
||||
* @property string|null $keyword_list
|
||||
* @property string|null $impact
|
||||
* @property string $impact_level
|
||||
* @property Carbon $published_at
|
||||
@@ -56,6 +57,7 @@ class RssPost extends Model
|
||||
'entities',
|
||||
'metadata',
|
||||
'bites',
|
||||
'keyword_list',
|
||||
'impact',
|
||||
'impact_level',
|
||||
'published_at',
|
||||
|
||||
Reference in New Issue
Block a user