Skip to content

Commit

Permalink
Merge pull request #1647 from laws-africa/search-tweak
Browse files Browse the repository at this point in the history
search: boost title; don't double-index title as citation
  • Loading branch information
longhotsummer authored Dec 12, 2023
2 parents 2e3290f + f263564 commit c643f80
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions peachjam_search/documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,6 @@ def get_instances_from_related(self, related_instance):
def prepare_doc_type(self, instance):
return instance.get_doc_type_display()

def prepare_citation(self, instance):
# if there is no citation, fall back to the title so as not to penalise documents that don't have a citation
return instance.citation or instance.title

def prepare_case_number(self, instance):
if hasattr(instance, "case_numbers"):
return [c.get_case_number_string() for c in instance.case_numbers.all()]
Expand Down
2 changes: 1 addition & 1 deletion peachjam_search/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ class DocumentSearchViewSet(BaseDocumentViewSet):
}

search_fields = {
"title": {"boost": 6},
"title": {"boost": 8},
"title_expanded": {"boost": 4},
"authors": None,
"citation": {"boost": 4},
Expand Down

0 comments on commit c643f80

Please sign in to comment.