Skip to content

Commit

Permalink
add search title
Browse files Browse the repository at this point in the history
  • Loading branch information
jjandxa committed Oct 15, 2017
1 parent 3b5b823 commit ec605fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@ typings/

js/forum/node_modules
js/forum/package-lock.json
.idea/
5 changes: 3 additions & 2 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($query);
$tempDiscData = $search->search("title:".$query." ".$query);

// 取消折叠
$search->setCollapse(null);
Expand All @@ -116,7 +116,8 @@ static function convertDiscussion($query, $limit, $offset, $sort) {

$search->setLimit(2, 0);
$tempPostData =
$search->search("discId:\"".$item->getFields()["discId"]."\" ".$query);
$search->search("discId:\"".$item->
getFields()["discId"]."\" title:".$query." ".$query);
$tempData[$discId] = array("id" => $discId, "postIds" => array());

foreach ($tempPostData as $post) {
Expand Down

0 comments on commit ec605fe

Please sign in to comment.