Showing
2 changed files
with
2 additions
and
1 deletions
| ... | @@ -154,6 +154,7 @@ class SearchService | ... | @@ -154,6 +154,7 @@ class SearchService |
| 154 | // Handle normal search terms | 154 | // Handle normal search terms |
| 155 | if (count($terms['search']) > 0) { | 155 | if (count($terms['search']) > 0) { |
| 156 | $subQuery = $this->db->table('search_terms')->select('entity_id', 'entity_type', \DB::raw('SUM(score) as score')); | 156 | $subQuery = $this->db->table('search_terms')->select('entity_id', 'entity_type', \DB::raw('SUM(score) as score')); |
| 157 | + $subQuery->where('entity_type', '=', 'BookStack\\' . ucfirst($entityType)); | ||
| 157 | $subQuery->where(function(Builder $query) use ($terms) { | 158 | $subQuery->where(function(Builder $query) use ($terms) { |
| 158 | foreach ($terms['search'] as $inputTerm) { | 159 | foreach ($terms['search'] as $inputTerm) { |
| 159 | $query->orWhere('term', 'like', $inputTerm .'%'); | 160 | $query->orWhere('term', 'like', $inputTerm .'%'); | ... | ... |
-
Please register or sign in to post a comment