Skip to content

Commit

Permalink
fix search bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jjandxa committed Oct 15, 2017
1 parent c116ac7 commit cc82f91
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Service/XunSearchService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) {
Expand Down

0 comments on commit cc82f91

Please sign in to comment.