From 9ae91ee187a89846c4c089e862c1eaaa44fb700d Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 29 Apr 2023 07:41:59 +0300 Subject: [PATCH] remove phrase search mask, allow sphinx macroses --- public/api.php | 4 ++-- public/search.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/public/api.php b/public/api.php index a40b89f..6954945 100644 --- a/public/api.php +++ b/public/api.php @@ -34,8 +34,8 @@ if (API_ENABLED) { $page = !empty($_GET['page']) ? Filter::url($_GET['page']) : 1; // Make search request - $sphinxResultsTotal = $sphinx->searchHostPagesTotal('"' . $query . '"'); - $sphinxResults = $sphinx->searchHostPages('"' . $query . '"', $page * API_SEARCH_PAGINATION_RESULTS_LIMIT - API_SEARCH_PAGINATION_RESULTS_LIMIT, API_SEARCH_PAGINATION_RESULTS_LIMIT, $sphinxResultsTotal); + $sphinxResultsTotal = $sphinx->searchHostPagesTotal($query); + $sphinxResults = $sphinx->searchHostPages($query, $page * API_SEARCH_PAGINATION_RESULTS_LIMIT - API_SEARCH_PAGINATION_RESULTS_LIMIT, API_SEARCH_PAGINATION_RESULTS_LIMIT, $sphinxResultsTotal); // Generate results $dbResults = []; diff --git a/public/search.php b/public/search.php index 9aa2026..20cdfd6 100644 --- a/public/search.php +++ b/public/search.php @@ -106,8 +106,8 @@ if (filter_var($q, FILTER_VALIDATE_URL) && preg_match(CRAWL_URL_REGEXP, $q)) { // Search request if (!empty($q)) { - $resultsTotal = $sphinx->searchHostPagesTotal('"' . $q . '"'); - $results = $sphinx->searchHostPages('"' . $q . '"', $p * WEBSITE_PAGINATION_SEARCH_RESULTS_LIMIT - WEBSITE_PAGINATION_SEARCH_RESULTS_LIMIT, WEBSITE_PAGINATION_SEARCH_RESULTS_LIMIT, $resultsTotal); + $resultsTotal = $sphinx->searchHostPagesTotal($q); + $results = $sphinx->searchHostPages($q, $p * WEBSITE_PAGINATION_SEARCH_RESULTS_LIMIT - WEBSITE_PAGINATION_SEARCH_RESULTS_LIMIT, WEBSITE_PAGINATION_SEARCH_RESULTS_LIMIT, $resultsTotal); } else {