From c4e65e18c4d2dbd19c0d6c41b76991818bab1c12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Kv=C3=A1=C4=8Dek?= Date: Tue, 15 Mar 2016 13:57:40 +0100 Subject: [PATCH] FEATURE: add parent class for all search engines --- app/Handlers/Search/Content.php | 15 +++++++-------- app/Handlers/Search/Search.php | 26 ++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 8 deletions(-) create mode 100644 app/Handlers/Search/Search.php diff --git a/app/Handlers/Search/Content.php b/app/Handlers/Search/Content.php index 48e30681..1dd3b364 100644 --- a/app/Handlers/Search/Content.php +++ b/app/Handlers/Search/Content.php @@ -1,10 +1,9 @@ tokenize($term); return ContentModel::where('content', 'LIKE', $token) - ->orWhere('meta_description', 'LIKE', $token) - ->orWhere('meta_keywords', 'LIKE', $token) - ->orWhere('title', 'LIKE', $token) - ->orWhere('url', 'LIKE', $token) - ->get(); + ->orWhere('meta_description', 'LIKE', $token) + ->orWhere('meta_keywords', 'LIKE', $token) + ->orWhere('title', 'LIKE', $token) + ->orWhere('url', 'LIKE', $token) + ->get(); } public function getId() diff --git a/app/Handlers/Search/Search.php b/app/Handlers/Search/Search.php new file mode 100644 index 00000000..ada51c7d --- /dev/null +++ b/app/Handlers/Search/Search.php @@ -0,0 +1,26 @@ +