diff --git a/src/Service/XunSearchService.php b/src/Service/XunSearchService.php index 565dfa0..4eda8dd 100644 --- a/src/Service/XunSearchService.php +++ b/src/Service/XunSearchService.php @@ -106,7 +106,7 @@ static function convertDiscussion($query, $limit, $offset, $sort) { } - $tempDiscData = $search->search("title:".$query." ".$query); + $tempDiscData = $search->search("title:$query OR $query"); // 取消折叠 $search->setCollapse(null); @@ -116,8 +116,7 @@ static function convertDiscussion($query, $limit, $offset, $sort) { $search->setLimit(2, 0); $tempPostData = - $search->search("discId:\"".$item-> - getFields()["discId"]."\" title:".$query." ".$query); + $search->search("discId:\"$discId\" (title:$query OR $query)"); $tempData[$discId] = array("id" => $discId, "postIds" => array()); foreach ($tempPostData as $post) {