diff --git a/cl/search/api_serializers.py b/cl/search/api_serializers.py index 1f9cbb7d75..c4ccb4fec0 100644 --- a/cl/search/api_serializers.py +++ b/cl/search/api_serializers.py @@ -432,6 +432,7 @@ class Meta: "procedural_history", "panel_names", "sha1", + "combined_fields", ) @@ -606,6 +607,7 @@ class Meta: "cluster_child", "date_created", "timestamp", + "combined_fields", ) diff --git a/cl/search/documents.py b/cl/search/documents.py index d7b18f9472..c78ca59824 100644 --- a/cl/search/documents.py +++ b/cl/search/documents.py @@ -1279,6 +1279,7 @@ class OpinionBaseDocument(Document): docketNumber = fields.TextField( analyzer="text_en_splitting_cl", term_vector="with_positions_offsets", + copy_to="combined_fields", fields={ "exact": fields.TextField( analyzer="english_exact", @@ -1290,6 +1291,7 @@ class OpinionBaseDocument(Document): ) caseName = fields.TextField( analyzer="text_en_splitting_cl", + copy_to="combined_fields", term_vector="with_positions_offsets", fields={ "exact": fields.TextField( @@ -1302,6 +1304,7 @@ class OpinionBaseDocument(Document): ) caseNameFull = fields.TextField( analyzer="text_en_splitting_cl", + copy_to="combined_fields", fields={ "exact": fields.TextField( analyzer="english_exact", @@ -1317,6 +1320,7 @@ class OpinionBaseDocument(Document): court_id = fields.TextField( analyzer="text_en_splitting_cl", search_analyzer="search_analyzer", + copy_to="combined_fields", fields={ "exact": fields.TextField( analyzer="english_exact", @@ -1327,6 +1331,7 @@ class OpinionBaseDocument(Document): ) court = fields.TextField( analyzer="text_en_splitting_cl", + copy_to="combined_fields", fields={ "exact": fields.TextField( analyzer="english_exact", @@ -1343,6 +1348,7 @@ class OpinionBaseDocument(Document): ) judge = fields.TextField( analyzer="text_en_splitting_cl", + copy_to="combined_fields", fields={ "exact": fields.TextField( analyzer="english_exact", @@ -1360,6 +1366,7 @@ class OpinionBaseDocument(Document): ) attorney = fields.TextField( analyzer="text_en_splitting_cl", + copy_to="combined_fields", fields={ "exact": fields.TextField( analyzer="english_exact", @@ -1370,6 +1377,7 @@ class OpinionBaseDocument(Document): ) suitNature = fields.TextField( analyzer="text_en_splitting_cl", + copy_to="combined_fields", term_vector="with_positions_offsets", fields={ "exact": fields.TextField( @@ -1384,6 +1392,7 @@ class OpinionBaseDocument(Document): fields.TextField( analyzer="text_en_splitting_cl", term_vector="with_positions_offsets", + copy_to="combined_fields", fields={ "exact": fields.TextField( analyzer="english_exact", @@ -1399,6 +1408,7 @@ class OpinionBaseDocument(Document): status = fields.TextField( analyzer="text_en_splitting_cl", search_analyzer="search_analyzer", + copy_to="combined_fields", fields={ "exact": fields.TextField( analyzer="english_exact", @@ -1409,6 +1419,7 @@ class OpinionBaseDocument(Document): ) procedural_history = fields.TextField( analyzer="text_en_splitting_cl", + copy_to="combined_fields", fields={ "exact": fields.TextField( analyzer="english_exact", @@ -1419,6 +1430,7 @@ class OpinionBaseDocument(Document): ) posture = fields.TextField( analyzer="text_en_splitting_cl", + copy_to="combined_fields", fields={ "exact": fields.TextField( analyzer="english_exact", @@ -1429,6 +1441,7 @@ class OpinionBaseDocument(Document): ) syllabus = fields.TextField( analyzer="text_en_splitting_cl", + copy_to="combined_fields", fields={ "exact": fields.TextField( analyzer="english_exact", @@ -1596,6 +1609,7 @@ class OpinionDocument(OpinionBaseDocument): text = fields.TextField( analyzer="text_en_splitting_cl", term_vector="with_positions_offsets", + copy_to="combined_fields", fields={ "exact": fields.TextField( analyzer="english_exact", @@ -1612,6 +1626,11 @@ class OpinionDocument(OpinionBaseDocument): joined_by_ids = fields.ListField( fields.IntegerField(multi=True), ) + combined_fields = fields.TextField( + analyzer="english_exact", + search_analyzer="search_analyzer_exact", + term_vector="yes", + ) class Django: model = Opinion