Skip to content

Commit

Permalink
search: Increase the weight of the title in the results of a search.
Browse files Browse the repository at this point in the history
  • Loading branch information
psaiz committed Feb 28, 2024
1 parent 1e558d2 commit 4da5372
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cernopendata/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,10 @@ def _query_parser_and(qstr=None):
"""Parser that uses the Q() with AND from search engine dsl."""
if qstr:
_query = dsl.Q(
"query_string", query=qstr.replace("/", "\\/"), default_operator="AND"
"query_string",
query=qstr.replace("/", "\\/"),
default_operator="AND",
fields=["title.tokens^2", "*"],
)
else:
_query = dsl.Q()
Expand Down

0 comments on commit 4da5372

Please sign in to comment.