Skip to content

Commit

Permalink
apps/contrib: hide unpublished and password protected pages from sear…
Browse files Browse the repository at this point in the history
…ch results

fixes #851, #877
  • Loading branch information
goapunk authored and philli-m committed Nov 2, 2023
1 parent 02e3ddf commit 3f9bf2d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/contrib/elasticsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ def _get_results_from_hits(self, hits):
break

for obj in self.query_compiler.queryset.filter(pk__in=pks):
if not obj.live or obj.get_view_restrictions().exists():
continue
results[str(obj.pk)] = obj

if self._score_field:
Expand Down
3 changes: 3 additions & 0 deletions changelog/_1113.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Changed

- Pages which are not published or password protected are excluded from the search results (#851, #877)

0 comments on commit 3f9bf2d

Please sign in to comment.