From 82e1287f06a7bad4ae2a9c01992c5c2271078973 Mon Sep 17 00:00:00 2001 From: Wyatt Pearsall Date: Tue, 2 Jun 2026 12:03:52 -0700 Subject: [PATCH] Remove consumer_consent_provided and consumer_disputed deprecated fields --- complaint_search/defaults.py | 8 +- complaint_search/es_builders.py | 11 - complaint_search/serializer.py | 12 - .../expected_results/break_point_data.json | 97 ++--- .../search_agg_exclude__valid.json | 36 +- .../search_no_highlight__valid.json | 34 -- .../search_no_param__valid.json | 34 -- .../search_with_company__valid.json | 54 +-- ...earch_with_company_agg_exclude__valid.json | 54 +-- ...h_with_company_public_response__valid.json | 52 --- ...arch_with_company_received_max__valid.json | 50 --- ...arch_with_company_received_min__valid.json | 50 --- .../search_with_company_response__valid.json | 52 --- ...with_consumer_consent_provided__valid.json | 355 ------------------ .../search_with_date_received_max__valid.json | 50 --- .../search_with_date_received_min__valid.json | 50 --- .../search_with_format_csv__valid.json | 6 +- .../search_with_format_json__valid.json | 2 - .../search_with_frm__valid.json | 32 -- .../search_with_has_narrative__valid.json | 50 --- .../search_with_issue__valid.json | 94 ----- .../search_with_not_company__valid.json | 50 --- .../search_with_not_issue__valid.json | 58 --- .../search_with_not_product__valid.json | 94 ----- .../search_with_product__valid.json | 94 ----- .../search_with_search_term_field_all.json | 34 -- .../search_with_search_term_match__valid.json | 34 -- ...earch_with_search_term_qsq_and__valid.json | 34 -- ...earch_with_search_term_qsq_not__valid.json | 34 -- ...search_with_search_term_qsq_or__valid.json | 34 -- ...search_with_search_term_qsq_to__valid.json | 34 -- .../search_with_size__valid.json | 34 -- .../search_with_size_corrected__valid.json | 32 -- .../search_with_sort__valid.json | 32 -- .../search_with_state__valid.json | 54 --- .../search_with_submitted_via__valid.json | 50 --- .../search_with_tags__valid.json | 52 --- .../search_with_timely__valid.json | 52 --- .../search_with_two_not__valid.json | 92 ----- .../search_with_zip_code__valid.json | 54 --- ...arch_with_zip_code_agg_exclude__valid.json | 56 +-- .../expected_results/states_agg__valid.json | 4 +- .../states_date_filters__valid.json | 4 +- .../trends_filter__valid.json | 4 +- .../trends_sub_lens_product__valid.json | 4 +- complaint_search/tests/test_es_interface.py | 6 - complaint_search/tests/test_views_search.py | 30 -- complaint_search/views.py | 2 - swagger-config.yaml | 38 -- 49 files changed, 48 insertions(+), 2235 deletions(-) delete mode 100644 complaint_search/tests/expected_results/search_with_consumer_consent_provided__valid.json diff --git a/complaint_search/defaults.py b/complaint_search/defaults.py index adf12385..366ab05f 100644 --- a/complaint_search/defaults.py +++ b/complaint_search/defaults.py @@ -47,8 +47,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -72,7 +70,7 @@ CSV_ORDERED_HEADERS = OrderedDict( [ - ("date_received_formatted", "Date received"), + ("date_received", "Date received"), ("product", "Product"), ("sub_product", "Sub-product"), ("issue", "Issue"), @@ -83,12 +81,10 @@ ("state", "State"), ("zip_code", "ZIP code"), ("tags", "Tags"), - ("consumer_consent_provided", "Consumer consent provided?"), ("submitted_via", "Submitted via"), - ("date_sent_to_company_formatted", "Date sent to company"), + ("date_sent_to_company", "Date sent to company"), ("company_response", "Company response to consumer"), ("timely", "Timely response?"), - ("consumer_disputed", "Consumer disputed?"), ("complaint_id", "Complaint ID"), ] ) diff --git a/complaint_search/es_builders.py b/complaint_search/es_builders.py index b8b6468e..1920750a 100644 --- a/complaint_search/es_builders.py +++ b/complaint_search/es_builders.py @@ -63,8 +63,6 @@ class BaseBuilder(object): "company", "company_public_response", "company_response", - "consumer_consent_provided", - "consumer_disputed", "has_narrative", "issue", "product", @@ -79,8 +77,6 @@ class BaseBuilder(object): _OPTIONAL_FILTERS_PARAM_TO_ES_MAP = { "company_public_response": "company_public_response.raw", "company": "company.raw", - "consumer_consent_provided": "consumer_consent_provided.raw", - "consumer_disputed": "consumer_disputed.raw", "issue": "issue.raw", "product": "product.raw", "sub_issue": "sub_issue.raw", @@ -277,11 +273,6 @@ def _build_source(self): source = list(SOURCE_FIELDS) if self.params.get("format") in EXPORT_FORMATS: source.remove("has_narrative") - if self.params.get("format") == "csv": - source.remove("date_received") - source.remove("date_sent_to_company") - source.append("date_received_formatted") - source.append("date_sent_to_company_formatted") return source def build(self): @@ -326,8 +317,6 @@ class AggregationBuilder(BaseBuilder): "company", "company_public_response", "company_response", - "consumer_consent_provided", - "consumer_disputed", "has_narrative", "issue", "product", diff --git a/complaint_search/serializer.py b/complaint_search/serializer.py index 255ad926..88707619 100644 --- a/complaint_search/serializer.py +++ b/complaint_search/serializer.py @@ -81,18 +81,12 @@ class SearchInputSerializer(serializers.Serializer): timely = serializers.ListField( child=serializers.CharField(max_length=200), required=False ) - consumer_disputed = serializers.ListField( - child=serializers.CharField(max_length=200), required=False - ) company_response = serializers.ListField( child=serializers.CharField(max_length=200), required=False ) company_public_response = serializers.ListField( child=serializers.CharField(max_length=200), required=False ) - consumer_consent_provided = serializers.ListField( - child=serializers.CharField(max_length=200), required=False - ) has_narrative = serializers.ListField( child=serializers.CharField(max_length=200), required=False ) @@ -116,12 +110,6 @@ class SearchInputSerializer(serializers.Serializer): not_company_response = serializers.ListField( child=serializers.CharField(max_length=200), required=False ) - not_consumer_consent_provided = serializers.ListField( - child=serializers.CharField(max_length=200), required=False - ) - not_consumer_disputed = serializers.ListField( - child=serializers.CharField(max_length=200), required=False - ) not_issue = serializers.ListField( child=serializers.CharField(max_length=200), required=False ) diff --git a/complaint_search/tests/expected_results/break_point_data.json b/complaint_search/tests/expected_results/break_point_data.json index c1637950..df4627a8 100644 --- a/complaint_search/tests/expected_results/break_point_data.json +++ b/complaint_search/tests/expected_results/break_point_data.json @@ -11,23 +11,21 @@ "date_sent_to_company" : "2018-06-22T12:00:00-05:00", "issue" : "Trouble during payment process", ":updated_at" : 1623901977, - "date_received_formatted" : "06/22/18", + "date_received" : "06/22/18", "sub_product" : "Reverse mortgage", "zip_code" : "207XX", "tags" : "Servicemember", "has_narrative" : false, "complaint_id" : "2943267", - "date_sent_to_company_formatted" : "06/22/18", + "date_sent_to_company" : "06/22/18", "timely" : "Yes", - "consumer_consent_provided" : "Consent provided", "company_response" : "Closed with explanation", "date_indexed" : "2021-06-17T12:00:00-05:00", "submitted_via" : "Web", - "date_indexed_formatted" : "06/17/21", + "date_indexed" : "06/17/21", "company" : "Peer Advisors, LLC", "date_received" : "2018-06-22T12:00:00-05:00", "state" : "MD", - "consumer_disputed" : "N/A", "company_public_response" : null, "sub_issue" : null }, @@ -47,23 +45,21 @@ "date_sent_to_company" : "2018-05-02T12:00:00-05:00", "issue" : "Applying for a mortgage or refinancing an existing mortgage", ":updated_at" : 1623901977, - "date_received_formatted" : "05/02/18", + "date_received" : "05/02/18", "sub_product" : "Reverse mortgage", "zip_code" : "631XX", "tags" : "Older American", "has_narrative" : true, "complaint_id" : "2894151", - "date_sent_to_company_formatted" : "05/02/18", + "date_sent_to_company" : "05/02/18", "timely" : "Yes", - "consumer_consent_provided" : "Consent provided", "company_response" : "Closed with explanation", "date_indexed" : "2021-06-17T12:00:00-05:00", "submitted_via" : "Web", - "date_indexed_formatted" : "06/17/21", + "date_indexed" : "06/17/21", "company" : "WELLS FARGO & COMPANY", "date_received" : "2018-05-02T12:00:00-05:00", "state" : "MO", - "consumer_disputed" : "N/A", "company_public_response" : null, "sub_issue" : null }, @@ -83,23 +79,21 @@ "date_sent_to_company" : "2018-04-17T12:00:00-05:00", "issue" : "Trouble during payment process", ":updated_at" : 1623901977, - "date_received_formatted" : "04/17/18", + "date_received" : "04/17/18", "sub_product" : "Reverse mortgage", "zip_code" : "234XX", "tags" : null, "has_narrative" : true, "complaint_id" : "2878375", - "date_sent_to_company_formatted" : "04/17/18", + "date_sent_to_company" : "04/17/18", "timely" : "Yes", - "consumer_consent_provided" : "Consent provided", "company_response" : "Closed with explanation", "date_indexed" : "2021-06-17T12:00:00-05:00", "submitted_via" : "Web", - "date_indexed_formatted" : "06/17/21", + "date_indexed" : "06/17/21", "company" : "NATIONSTAR MORTGAGE", "date_received" : "2018-04-17T12:00:00-05:00", "state" : "VA", - "consumer_disputed" : "N/A", "company_public_response" : null, "sub_issue" : null }, @@ -119,23 +113,21 @@ "date_sent_to_company" : "2018-04-11T12:00:00-05:00", "issue" : "Struggling to pay mortgage", ":updated_at" : 1623901977, - "date_received_formatted" : "04/11/18", + "date_received" : "04/11/18", "sub_product" : "Reverse mortgage", "zip_code" : "84094", "tags" : "Older American, Servicemember", "has_narrative" : true, "complaint_id" : "2871943", - "date_sent_to_company_formatted" : "04/11/18", + "date_sent_to_company" : "04/11/18", "timely" : "Yes", - "consumer_consent_provided" : "Consent provided", "company_response" : "Closed with explanation", "date_indexed" : "2021-06-17T12:00:00-05:00", "submitted_via" : "Web", - "date_indexed_formatted" : "06/17/21", + "date_indexed" : "06/17/21", "company" : "Ocwen Financial Corporation", "date_received" : "2018-04-11T12:00:00-05:00", "state" : "UT", - "consumer_disputed" : "N/A", "company_public_response" : null, "sub_issue" : null }, @@ -155,23 +147,21 @@ "date_sent_to_company" : "2018-01-20T12:00:00-05:00", "issue" : "Struggling to pay mortgage", ":updated_at" : 1623901977, - "date_received_formatted" : "01/20/18", + "date_received" : "01/20/18", "sub_product" : "Reverse mortgage", "zip_code" : "773XX", "tags" : "Older American", "has_narrative" : true, "complaint_id" : "2787975", - "date_sent_to_company_formatted" : "01/20/18", + "date_sent_to_company" : "01/20/18", "timely" : "Yes", - "consumer_consent_provided" : "Consent provided", "company_response" : "Closed with explanation", "date_indexed" : "2021-06-17T12:00:00-05:00", "submitted_via" : "Web", - "date_indexed_formatted" : "06/17/21", + "date_indexed" : "06/17/21", "company" : "NATIONSTAR MORTGAGE", "date_received" : "2018-01-20T12:00:00-05:00", "state" : "TX", - "consumer_disputed" : "N/A", "company_public_response" : null, "sub_issue" : null }, @@ -191,23 +181,21 @@ "date_sent_to_company" : "2018-05-26T12:00:00-05:00", "issue" : "Trouble during payment process", ":updated_at" : 1623901977, - "date_received_formatted" : "01/18/18", + "date_received" : "01/18/18", "sub_product" : "Reverse mortgage", "zip_code" : "751XX", "tags" : null, "has_narrative" : true, "complaint_id" : "2786687", - "date_sent_to_company_formatted" : "05/26/18", + "date_sent_to_company" : "05/26/18", "timely" : "Yes", - "consumer_consent_provided" : "Consent provided", "company_response" : "Closed with explanation", "date_indexed" : "2021-06-17T12:00:00-05:00", "submitted_via" : "Web", - "date_indexed_formatted" : "06/17/21", + "date_indexed" : "06/17/21", "company" : "NATIONSTAR MORTGAGE", "date_received" : "2018-01-18T12:00:00-05:00", "state" : "TX", - "consumer_disputed" : "N/A", "company_public_response" : null, "sub_issue" : null }, @@ -227,23 +215,21 @@ "date_sent_to_company" : "2017-12-20T12:00:00-05:00", "issue" : "Struggling to pay mortgage", ":updated_at" : 1623901977, - "date_received_formatted" : "12/20/17", + "date_received" : "12/20/17", "sub_product" : "Reverse mortgage", "zip_code" : "441XX", "tags" : "Older American", "has_narrative" : true, "complaint_id" : "2761238", - "date_sent_to_company_formatted" : "12/20/17", + "date_sent_to_company" : "12/20/17", "timely" : "Yes", - "consumer_consent_provided" : "Consent provided", "company_response" : "Closed with explanation", "date_indexed" : "2021-06-17T12:00:00-05:00", "submitted_via" : "Web", - "date_indexed_formatted" : "06/17/21", + "date_indexed" : "06/17/21", "company" : "AMERICAN ADVISORS GROUP", "date_received" : "2017-12-20T12:00:00-05:00", "state" : "OH", - "consumer_disputed" : "N/A", "company_public_response" : "Company believes it acted appropriately as authorized by contract or law", "sub_issue" : null }, @@ -263,24 +249,21 @@ "date_sent_to_company" : "2017-12-15T12:00:00-05:00", "issue" : "Closing on a mortgage", ":updated_at" : 1623901977, - "date_received_formatted" : "12/15/17", + "date_received" : "12/15/17", "sub_product" : "Reverse mortgage", "zip_code" : null, "tags" : "Older American", "has_narrative" : false, "complaint_id" : "2756527", - "date_sent_to_company_formatted" : "12/15/17", + "date_sent_to_company" : "12/15/17", "timely" : "Yes", - "consumer_consent_provided" : "Consent provided", "company_response" : "Closed with explanation", "date_indexed" : "2021-06-17T12:00:00-05:00", "submitted_via" : "Web", - "date_indexed_formatted" : "06/17/21", + "date_indexed" : "06/17/21", "company" : "WELLS FARGO & COMPANY", "date_received" : "2017-12-15T12:00:00-05:00", "state" : "CA", - "consumer_disputed" : "N/A", - "company_public_response" : "Company has responded to the consumer and the CFPB and chooses not to provide a public response", "sub_issue" : null }, "sort" : [ @@ -299,23 +282,21 @@ "date_sent_to_company" : "2017-12-06T12:00:00-05:00", "issue" : "Struggling to pay mortgage", ":updated_at" : 1623901977, - "date_received_formatted" : "11/28/17", + "date_received" : "11/28/17", "sub_product" : "Reverse mortgage", "zip_code" : "750XX", "tags" : null, "has_narrative" : false, "complaint_id" : "2739854", - "date_sent_to_company_formatted" : "12/06/17", + "date_sent_to_company" : "12/06/17", "timely" : "Yes", - "consumer_consent_provided" : "Consent provided", "company_response" : "Closed with explanation", "date_indexed" : "2021-06-17T12:00:00-05:00", "submitted_via" : "Web", - "date_indexed_formatted" : "06/17/21", + "date_indexed" : "06/17/21", "company" : "REVERSE MORTGAGE SOLUTIONS, INC.", "date_received" : "2017-11-28T12:00:00-05:00", "state" : "TX", - "consumer_disputed" : "N/A", "company_public_response" : null, "sub_issue" : null }, @@ -335,23 +316,21 @@ "date_sent_to_company" : "2017-11-16T12:00:00-05:00", "issue" : "Closing on a mortgage", ":updated_at" : 1623901977, - "date_received_formatted" : "11/10/17", + "date_received" : "11/10/17", "sub_product" : "Reverse mortgage", "zip_code" : "321XX", "tags" : "Older American", "has_narrative" : false, "complaint_id" : "2726371", - "date_sent_to_company_formatted" : "11/16/17", + "date_sent_to_company" : "11/16/17", "timely" : "Yes", - "consumer_consent_provided" : "Consent provided", "company_response" : "Closed with explanation", "date_indexed" : "2021-06-17T12:00:00-05:00", "submitted_via" : "Web", - "date_indexed_formatted" : "06/17/21", + "date_indexed" : "06/17/21", "company" : "REVERSE MORTGAGE INVESTMENT TR", "date_received" : "2017-11-10T12:00:00-05:00", "state" : "FL", - "consumer_disputed" : "N/A", "company_public_response" : null, "sub_issue" : null }, @@ -371,23 +350,21 @@ "date_sent_to_company" : "2017-10-18T12:00:00-05:00", "issue" : "Struggling to pay mortgage", ":updated_at" : 1623901977, - "date_received_formatted" : "10/18/17", + "date_received" : "10/18/17", "sub_product" : "Reverse mortgage", "zip_code" : "125XX", "tags" : "Older American", "has_narrative" : false, "complaint_id" : "2706073", - "date_sent_to_company_formatted" : "10/18/17", + "date_sent_to_company" : "10/18/17", "timely" : "Yes", - "consumer_consent_provided" : "Consent provided", "company_response" : "Closed with explanation", "date_indexed" : "2021-06-17T12:00:00-05:00", "submitted_via" : "Web", - "date_indexed_formatted" : "06/17/21", + "date_indexed" : "06/17/21", "company" : "NATIONSTAR MORTGAGE", "date_received" : "2017-10-18T12:00:00-05:00", "state" : "NY", - "consumer_disputed" : "N/A", "company_public_response" : null, "sub_issue" : null }, @@ -407,23 +384,21 @@ "date_sent_to_company" : "2017-08-23T12:00:00-05:00", "issue" : "Trouble during payment process", ":updated_at" : 1623901977, - "date_received_formatted" : "08/23/17", + "date_received" : "08/23/17", "sub_product" : "Reverse mortgage", "zip_code" : null, "tags" : null, "has_narrative" : false, "complaint_id" : "2647905", - "date_sent_to_company_formatted" : "08/23/17", + "date_sent_to_company" : "08/23/17", "timely" : "Yes", - "consumer_consent_provided" : "Consent provided", "company_response" : "Closed with explanation", "date_indexed" : "2021-06-17T12:00:00-05:00", "submitted_via" : "Web", - "date_indexed_formatted" : "06/17/21", + "date_indexed" : "06/17/21", "company" : "AMERICAN ADVISORS GROUP", "date_received" : "2017-08-23T12:00:00-05:00", "state" : "KY", - "consumer_disputed" : "N/A", "company_public_response" : null, "sub_issue" : null }, diff --git a/complaint_search/tests/expected_results/search_agg_exclude__valid.json b/complaint_search/tests/expected_results/search_agg_exclude__valid.json index eed2441a..391184a6 100644 --- a/complaint_search/tests/expected_results/search_agg_exclude__valid.json +++ b/complaint_search/tests/expected_results/search_agg_exclude__valid.json @@ -7,8 +7,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -95,38 +93,6 @@ } } }, - "consumer_consent_provided": { - "aggs": { - "consumer_consent_provided": { - "terms": { - "field": "consumer_consent_provided.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [], - "must_not": [] - } - } - }, - "consumer_disputed": { - "aggs": { - "consumer_disputed": { - "terms": { - "field": "consumer_disputed.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [], - "must_not": [] - } - } - }, "has_narrative": { "aggs": { "has_narrative": { @@ -256,4 +222,4 @@ } } } -} \ No newline at end of file +} diff --git a/complaint_search/tests/expected_results/search_no_highlight__valid.json b/complaint_search/tests/expected_results/search_no_highlight__valid.json index a86364e1..61e3f429 100644 --- a/complaint_search/tests/expected_results/search_no_highlight__valid.json +++ b/complaint_search/tests/expected_results/search_no_highlight__valid.json @@ -7,8 +7,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -87,38 +85,6 @@ } } }, - "consumer_consent_provided": { - "aggs": { - "consumer_consent_provided": { - "terms": { - "field": "consumer_consent_provided.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [], - "must_not": [] - } - } - }, - "consumer_disputed": { - "aggs": { - "consumer_disputed": { - "terms": { - "field": "consumer_disputed.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [], - "must_not": [] - } - } - }, "has_narrative": { "aggs": { "has_narrative": { diff --git a/complaint_search/tests/expected_results/search_no_param__valid.json b/complaint_search/tests/expected_results/search_no_param__valid.json index b49b6fc0..391184a6 100644 --- a/complaint_search/tests/expected_results/search_no_param__valid.json +++ b/complaint_search/tests/expected_results/search_no_param__valid.json @@ -7,8 +7,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -95,38 +93,6 @@ } } }, - "consumer_consent_provided": { - "aggs": { - "consumer_consent_provided": { - "terms": { - "field": "consumer_consent_provided.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [], - "must_not": [] - } - } - }, - "consumer_disputed": { - "aggs": { - "consumer_disputed": { - "terms": { - "field": "consumer_disputed.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [], - "must_not": [] - } - } - }, "has_narrative": { "aggs": { "has_narrative": { diff --git a/complaint_search/tests/expected_results/search_with_company__valid.json b/complaint_search/tests/expected_results/search_with_company__valid.json index 861af536..548fe3e9 100644 --- a/complaint_search/tests/expected_results/search_with_company__valid.json +++ b/complaint_search/tests/expected_results/search_with_company__valid.json @@ -7,8 +7,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -122,56 +120,6 @@ } } }, - "consumer_consent_provided": { - "aggs": { - "consumer_consent_provided": { - "terms": { - "field": "consumer_consent_provided.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "terms": { - "company.raw": [ - "Bank 1", - "Second Bank" - ] - } - } - ], - "must_not": [] - } - } - }, - "consumer_disputed": { - "aggs": { - "consumer_disputed": { - "terms": { - "field": "consumer_disputed.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "terms": { - "company.raw": [ - "Bank 1", - "Second Bank" - ] - } - } - ], - "must_not": [] - } - } - }, "has_narrative": { "aggs": { "has_narrative": { @@ -364,4 +312,4 @@ } } } -} \ No newline at end of file +} diff --git a/complaint_search/tests/expected_results/search_with_company_agg_exclude__valid.json b/complaint_search/tests/expected_results/search_with_company_agg_exclude__valid.json index 9e6cc310..cfe215ae 100644 --- a/complaint_search/tests/expected_results/search_with_company_agg_exclude__valid.json +++ b/complaint_search/tests/expected_results/search_with_company_agg_exclude__valid.json @@ -7,8 +7,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -122,56 +120,6 @@ } } }, - "consumer_consent_provided": { - "aggs": { - "consumer_consent_provided": { - "terms": { - "field": "consumer_consent_provided.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "terms": { - "company.raw": [ - "Bank 1", - "Second Bank" - ] - } - } - ], - "must_not": [] - } - } - }, - "consumer_disputed": { - "aggs": { - "consumer_disputed": { - "terms": { - "field": "consumer_disputed.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "terms": { - "company.raw": [ - "Bank 1", - "Second Bank" - ] - } - } - ], - "must_not": [] - } - } - }, "has_narrative": { "aggs": { "has_narrative": { @@ -389,4 +337,4 @@ } } } -} \ No newline at end of file +} diff --git a/complaint_search/tests/expected_results/search_with_company_public_response__valid.json b/complaint_search/tests/expected_results/search_with_company_public_response__valid.json index 038effb8..d7037b81 100644 --- a/complaint_search/tests/expected_results/search_with_company_public_response__valid.json +++ b/complaint_search/tests/expected_results/search_with_company_public_response__valid.json @@ -7,8 +7,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -122,56 +120,6 @@ } } }, - "consumer_consent_provided": { - "aggs": { - "consumer_consent_provided": { - "terms": { - "field": "consumer_consent_provided.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "terms": { - "company_public_response.raw": [ - "Company chooses not to provide a public response", - "Company believes it acted appropriately as authorized by contract or law" - ] - } - } - ], - "must_not": [] - } - } - }, - "consumer_disputed": { - "aggs": { - "consumer_disputed": { - "terms": { - "field": "consumer_disputed.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "terms": { - "company_public_response.raw": [ - "Company chooses not to provide a public response", - "Company believes it acted appropriately as authorized by contract or law" - ] - } - } - ], - "must_not": [] - } - } - }, "has_narrative": { "aggs": { "has_narrative": { diff --git a/complaint_search/tests/expected_results/search_with_company_received_max__valid.json b/complaint_search/tests/expected_results/search_with_company_received_max__valid.json index 26889124..d78fb3bf 100644 --- a/complaint_search/tests/expected_results/search_with_company_received_max__valid.json +++ b/complaint_search/tests/expected_results/search_with_company_received_max__valid.json @@ -7,8 +7,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -127,54 +125,6 @@ } } }, - "consumer_consent_provided": { - "aggs": { - "consumer_consent_provided": { - "terms": { - "field": "consumer_consent_provided.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "range": { - "date_sent_to_company": { - "to": "2017-04-14" - } - } - } - ], - "must_not": [] - } - } - }, - "consumer_disputed": { - "aggs": { - "consumer_disputed": { - "terms": { - "field": "consumer_disputed.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "range": { - "date_sent_to_company": { - "to": "2017-04-14" - } - } - } - ], - "must_not": [] - } - } - }, "has_narrative": { "aggs": { "has_narrative": { diff --git a/complaint_search/tests/expected_results/search_with_company_received_min__valid.json b/complaint_search/tests/expected_results/search_with_company_received_min__valid.json index f45750c8..c70c67eb 100644 --- a/complaint_search/tests/expected_results/search_with_company_received_min__valid.json +++ b/complaint_search/tests/expected_results/search_with_company_received_min__valid.json @@ -7,8 +7,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -127,54 +125,6 @@ } } }, - "consumer_consent_provided": { - "aggs": { - "consumer_consent_provided": { - "terms": { - "field": "consumer_consent_provided.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "range": { - "date_sent_to_company": { - "from": "2014-04-14" - } - } - } - ], - "must_not": [] - } - } - }, - "consumer_disputed": { - "aggs": { - "consumer_disputed": { - "terms": { - "field": "consumer_disputed.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "range": { - "date_sent_to_company": { - "from": "2014-04-14" - } - } - } - ], - "must_not": [] - } - } - }, "has_narrative": { "aggs": { "has_narrative": { diff --git a/complaint_search/tests/expected_results/search_with_company_response__valid.json b/complaint_search/tests/expected_results/search_with_company_response__valid.json index f8e79d3d..14311958 100644 --- a/complaint_search/tests/expected_results/search_with_company_response__valid.json +++ b/complaint_search/tests/expected_results/search_with_company_response__valid.json @@ -7,8 +7,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -122,56 +120,6 @@ } } }, - "consumer_consent_provided": { - "aggs": { - "consumer_consent_provided": { - "terms": { - "field": "consumer_consent_provided.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "terms": { - "company_response": [ - "Closed", - "Closed with non-monetary relief" - ] - } - } - ], - "must_not": [] - } - } - }, - "consumer_disputed": { - "aggs": { - "consumer_disputed": { - "terms": { - "field": "consumer_disputed.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "terms": { - "company_response": [ - "Closed", - "Closed with non-monetary relief" - ] - } - } - ], - "must_not": [] - } - } - }, "has_narrative": { "aggs": { "has_narrative": { diff --git a/complaint_search/tests/expected_results/search_with_consumer_consent_provided__valid.json b/complaint_search/tests/expected_results/search_with_consumer_consent_provided__valid.json deleted file mode 100644 index 2d816ed6..00000000 --- a/complaint_search/tests/expected_results/search_with_consumer_consent_provided__valid.json +++ /dev/null @@ -1,355 +0,0 @@ -{ - "size": 25, - "track_total_hits": true, - "_source": [ - "company", - "company_public_response", - "company_response", - "complaint_id", - "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", - "date_received", - "date_sent_to_company", - "has_narrative", - "issue", - "product", - "state", - "submitted_via", - "sub_issue", - "sub_product", - "tags", - "timely", - "zip_code" - ], - "highlight": { - "require_field_match": false, - "number_of_fragments": 1, - "fragment_size": 500, - "fields": { - "complaint_what_happened": {} - } - }, - "sort": [ - { - "_score": { - "order": "desc" - } - }, - { - "_id": "desc" - } - ], - "post_filter": { - "bool": { - "must": [ - { - "terms": { - "consumer_consent_provided.raw": [ - "Consent provided" - ] - } - } - ], - "must_not": [] - } - }, - "aggs": { - "company": { - "aggs": { - "company": { - "terms": { - "size": 6500, - "field": "company.raw" - } - } - }, - "filter": { - "bool": { - "must": [ - { - "terms": { - "consumer_consent_provided.raw": [ - "Consent provided" - ] - } - } - ], - "must_not": [] - } - } - }, - "company_public_response": { - "aggs": { - "company_public_response": { - "terms": { - "field": "company_public_response.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "terms": { - "consumer_consent_provided.raw": [ - "Consent provided" - ] - } - } - ], - "must_not": [] - } - } - }, - "company_response": { - "aggs": { - "company_response": { - "terms": { - "field": "company_response", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "terms": { - "consumer_consent_provided.raw": [ - "Consent provided" - ] - } - } - ], - "must_not": [] - } - } - }, - "consumer_consent_provided": { - "aggs": { - "consumer_consent_provided": { - "terms": { - "field": "consumer_consent_provided.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [], - "must_not": [] - } - } - }, - "consumer_disputed": { - "aggs": { - "consumer_disputed": { - "terms": { - "field": "consumer_disputed.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "terms": { - "consumer_consent_provided.raw": [ - "Consent provided" - ] - } - } - ], - "must_not": [] - } - } - }, - "has_narrative": { - "aggs": { - "has_narrative": { - "terms": { - "field": "has_narrative", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "terms": { - "consumer_consent_provided.raw": [ - "Consent provided" - ] - } - } - ], - "must_not": [] - } - } - }, - "issue": { - "aggs": { - "issue": { - "terms": { - "size": 200, - "field": "issue.raw" - }, - "aggs": { - "sub_issue.raw": { - "terms": { - "field": "sub_issue.raw", - "size": 250 - } - } - } - } - }, - "filter": { - "bool": { - "must": [ - { - "terms": { - "consumer_consent_provided.raw": [ - "Consent provided" - ] - } - } - ], - "must_not": [] - } - } - }, - "product": { - "aggs": { - "product": { - "terms": { - "field": "product.raw", - "size": 30 - }, - "aggs": { - "sub_product.raw": { - "terms": { - "field": "sub_product.raw", - "size": 90 - } - } - } - } - }, - "filter": { - "bool": { - "must": [ - { - "terms": { - "consumer_consent_provided.raw": [ - "Consent provided" - ] - } - } - ], - "must_not": [] - } - } - }, - "state": { - "aggs": { - "state": { - "terms": { - "field": "state", - "size": 100 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "terms": { - "consumer_consent_provided.raw": [ - "Consent provided" - ] - } - } - ], - "must_not": [] - } - } - }, - "submitted_via": { - "aggs": { - "submitted_via": { - "terms": { - "field": "submitted_via", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "terms": { - "consumer_consent_provided.raw": [ - "Consent provided" - ] - } - } - ], - "must_not": [] - } - } - }, - "tags": { - "aggs": { - "tags": { - "terms": { - "field": "tags", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "terms": { - "consumer_consent_provided.raw": [ - "Consent provided" - ] - } - } - ], - "must_not": [] - } - } - }, - "timely": { - "aggs": { - "timely": { - "terms": { - "field": "timely", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "terms": { - "consumer_consent_provided.raw": [ - "Consent provided" - ] - } - } - ], - "must_not": [] - } - } - } - } -} diff --git a/complaint_search/tests/expected_results/search_with_date_received_max__valid.json b/complaint_search/tests/expected_results/search_with_date_received_max__valid.json index 70fbc9f7..7b75cc53 100644 --- a/complaint_search/tests/expected_results/search_with_date_received_max__valid.json +++ b/complaint_search/tests/expected_results/search_with_date_received_max__valid.json @@ -7,8 +7,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -127,54 +125,6 @@ } } }, - "consumer_consent_provided": { - "aggs": { - "consumer_consent_provided": { - "terms": { - "field": "consumer_consent_provided.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "range": { - "date_received": { - "to": "2017-04-14" - } - } - } - ], - "must_not": [] - } - } - }, - "consumer_disputed": { - "aggs": { - "consumer_disputed": { - "terms": { - "field": "consumer_disputed.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "range": { - "date_received": { - "to": "2017-04-14" - } - } - } - ], - "must_not": [] - } - } - }, "has_narrative": { "aggs": { "has_narrative": { diff --git a/complaint_search/tests/expected_results/search_with_date_received_min__valid.json b/complaint_search/tests/expected_results/search_with_date_received_min__valid.json index d92502bd..e7ed9090 100644 --- a/complaint_search/tests/expected_results/search_with_date_received_min__valid.json +++ b/complaint_search/tests/expected_results/search_with_date_received_min__valid.json @@ -7,8 +7,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -127,54 +125,6 @@ } } }, - "consumer_consent_provided": { - "aggs": { - "consumer_consent_provided": { - "terms": { - "field": "consumer_consent_provided.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "range": { - "date_received": { - "from": "2014-04-14" - } - } - } - ], - "must_not": [] - } - } - }, - "consumer_disputed": { - "aggs": { - "consumer_disputed": { - "terms": { - "field": "consumer_disputed.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "range": { - "date_received": { - "from": "2014-04-14" - } - } - } - ], - "must_not": [] - } - } - }, "has_narrative": { "aggs": { "has_narrative": { diff --git a/complaint_search/tests/expected_results/search_with_format_csv__valid.json b/complaint_search/tests/expected_results/search_with_format_csv__valid.json index 9c82c6d5..48512e97 100644 --- a/complaint_search/tests/expected_results/search_with_format_csv__valid.json +++ b/complaint_search/tests/expected_results/search_with_format_csv__valid.json @@ -6,8 +6,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "issue", "product", "state", @@ -17,8 +15,8 @@ "tags", "timely", "zip_code", - "date_received_formatted", - "date_sent_to_company_formatted" + "date_received", + "date_sent_to_company" ], "query": { "query_string": { diff --git a/complaint_search/tests/expected_results/search_with_format_json__valid.json b/complaint_search/tests/expected_results/search_with_format_json__valid.json index dbdb2b39..fd5b8eea 100644 --- a/complaint_search/tests/expected_results/search_with_format_json__valid.json +++ b/complaint_search/tests/expected_results/search_with_format_json__valid.json @@ -6,8 +6,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "issue", diff --git a/complaint_search/tests/expected_results/search_with_frm__valid.json b/complaint_search/tests/expected_results/search_with_frm__valid.json index 5d25915e..07045e34 100644 --- a/complaint_search/tests/expected_results/search_with_frm__valid.json +++ b/complaint_search/tests/expected_results/search_with_frm__valid.json @@ -7,8 +7,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -90,36 +88,6 @@ } } }, - "consumer_consent_provided": { - "aggs": { - "consumer_consent_provided": { - "terms": { - "field": "consumer_consent_provided.raw" - } - } - }, - "filter": { - "bool": { - "must": [], - "must_not": [] - } - } - }, - "consumer_disputed": { - "aggs": { - "consumer_disputed": { - "terms": { - "field": "consumer_disputed.raw" - } - } - }, - "filter": { - "bool": { - "must": [], - "must_not": [] - } - } - }, "has_narrative": { "aggs": { "has_narrative": { diff --git a/complaint_search/tests/expected_results/search_with_has_narrative__valid.json b/complaint_search/tests/expected_results/search_with_has_narrative__valid.json index 2bbef407..71a72f63 100644 --- a/complaint_search/tests/expected_results/search_with_has_narrative__valid.json +++ b/complaint_search/tests/expected_results/search_with_has_narrative__valid.json @@ -7,8 +7,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -127,54 +125,6 @@ } } }, - "consumer_consent_provided": { - "aggs": { - "consumer_consent_provided": { - "terms": { - "field": "consumer_consent_provided.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "terms": { - "has_narrative": [ - "true" - ] - } - } - ], - "must_not": [] - } - } - }, - "consumer_disputed": { - "aggs": { - "consumer_disputed": { - "terms": { - "field": "consumer_disputed.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "terms": { - "has_narrative": [ - "true" - ] - } - } - ], - "must_not": [] - } - } - }, "has_narrative": { "aggs": { "has_narrative": { diff --git a/complaint_search/tests/expected_results/search_with_issue__valid.json b/complaint_search/tests/expected_results/search_with_issue__valid.json index b90a61a9..a3a48753 100644 --- a/complaint_search/tests/expected_results/search_with_issue__valid.json +++ b/complaint_search/tests/expected_results/search_with_issue__valid.json @@ -7,8 +7,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -215,98 +213,6 @@ } } }, - "consumer_consent_provided": { - "aggs": { - "consumer_consent_provided": { - "terms": { - "field": "consumer_consent_provided.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "bool": { - "should": [ - { - "bool": { - "must": [ - { - "term": { - "issue.raw": "Communication tactics" - } - }, - { - "terms": { - "sub_issue.raw": [ - "Frequent or repeated calls" - ] - } - } - ] - } - }, - { - "term": { - "issue.raw": "Loan servicing, payments, escrow account" - } - } - ] - } - } - ], - "must_not": [] - } - } - }, - "consumer_disputed": { - "aggs": { - "consumer_disputed": { - "terms": { - "field": "consumer_disputed.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "bool": { - "should": [ - { - "bool": { - "must": [ - { - "term": { - "issue.raw": "Communication tactics" - } - }, - { - "terms": { - "sub_issue.raw": [ - "Frequent or repeated calls" - ] - } - } - ] - } - }, - { - "term": { - "issue.raw": "Loan servicing, payments, escrow account" - } - } - ] - } - } - ], - "must_not": [] - } - } - }, "has_narrative": { "aggs": { "has_narrative": { diff --git a/complaint_search/tests/expected_results/search_with_not_company__valid.json b/complaint_search/tests/expected_results/search_with_not_company__valid.json index d98c7609..55156a8b 100644 --- a/complaint_search/tests/expected_results/search_with_not_company__valid.json +++ b/complaint_search/tests/expected_results/search_with_not_company__valid.json @@ -7,8 +7,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -127,54 +125,6 @@ } } }, - "consumer_consent_provided": { - "aggs": { - "consumer_consent_provided": { - "terms": { - "field": "consumer_consent_provided.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [], - "must_not": [ - { - "terms": { - "company.raw": [ - "EQUIFAX, INC." - ] - } - } - ] - } - } - }, - "consumer_disputed": { - "aggs": { - "consumer_disputed": { - "terms": { - "field": "consumer_disputed.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [], - "must_not": [ - { - "terms": { - "company.raw": [ - "EQUIFAX, INC." - ] - } - } - ] - } - } - }, "has_narrative": { "aggs": { "has_narrative": { diff --git a/complaint_search/tests/expected_results/search_with_not_issue__valid.json b/complaint_search/tests/expected_results/search_with_not_issue__valid.json index f7f17eaf..107acbd7 100644 --- a/complaint_search/tests/expected_results/search_with_not_issue__valid.json +++ b/complaint_search/tests/expected_results/search_with_not_issue__valid.json @@ -7,8 +7,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -143,62 +141,6 @@ } } }, - "consumer_consent_provided": { - "aggs": { - "consumer_consent_provided": { - "terms": { - "field": "consumer_consent_provided.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [], - "must_not": [ - { - "bool": { - "should": [ - { - "term": { - "issue.raw": "Incorrect information on your report" - } - } - ] - } - } - ] - } - } - }, - "consumer_disputed": { - "aggs": { - "consumer_disputed": { - "terms": { - "field": "consumer_disputed.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [], - "must_not": [ - { - "bool": { - "should": [ - { - "term": { - "issue.raw": "Incorrect information on your report" - } - } - ] - } - } - ] - } - } - }, "has_narrative": { "aggs": { "has_narrative": { diff --git a/complaint_search/tests/expected_results/search_with_not_product__valid.json b/complaint_search/tests/expected_results/search_with_not_product__valid.json index a7d4ad53..fd0273b7 100644 --- a/complaint_search/tests/expected_results/search_with_not_product__valid.json +++ b/complaint_search/tests/expected_results/search_with_not_product__valid.json @@ -7,8 +7,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -215,98 +213,6 @@ } } }, - "consumer_consent_provided": { - "aggs": { - "consumer_consent_provided": { - "terms": { - "field": "consumer_consent_provided.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [], - "must_not": [ - { - "bool": { - "should": [ - { - "term": { - "product.raw": "Credit reporting, credit repair services, or other personal consumer reports" - } - }, - { - "bool": { - "must": [ - { - "term": { - "product.raw": "Mortgage" - } - }, - { - "terms": { - "sub_product.raw": [ - "FHA mortgage" - ] - } - } - ] - } - } - ] - } - } - ] - } - } - }, - "consumer_disputed": { - "aggs": { - "consumer_disputed": { - "terms": { - "field": "consumer_disputed.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [], - "must_not": [ - { - "bool": { - "should": [ - { - "term": { - "product.raw": "Credit reporting, credit repair services, or other personal consumer reports" - } - }, - { - "bool": { - "must": [ - { - "term": { - "product.raw": "Mortgage" - } - }, - { - "terms": { - "sub_product.raw": [ - "FHA mortgage" - ] - } - } - ] - } - } - ] - } - } - ] - } - } - }, "has_narrative": { "aggs": { "has_narrative": { diff --git a/complaint_search/tests/expected_results/search_with_product__valid.json b/complaint_search/tests/expected_results/search_with_product__valid.json index 6273b26b..9a7f7cd7 100644 --- a/complaint_search/tests/expected_results/search_with_product__valid.json +++ b/complaint_search/tests/expected_results/search_with_product__valid.json @@ -7,8 +7,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -215,98 +213,6 @@ } } }, - "consumer_consent_provided": { - "aggs": { - "consumer_consent_provided": { - "terms": { - "field": "consumer_consent_provided.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "bool": { - "should": [ - { - "term": { - "product.raw": "Payday loan" - } - }, - { - "bool": { - "must": [ - { - "term": { - "product.raw": "Mortgage" - } - }, - { - "terms": { - "sub_product.raw": [ - "FHA mortgage" - ] - } - } - ] - } - } - ] - } - } - ], - "must_not": [] - } - } - }, - "consumer_disputed": { - "aggs": { - "consumer_disputed": { - "terms": { - "field": "consumer_disputed.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "bool": { - "should": [ - { - "term": { - "product.raw": "Payday loan" - } - }, - { - "bool": { - "must": [ - { - "term": { - "product.raw": "Mortgage" - } - }, - { - "terms": { - "sub_product.raw": [ - "FHA mortgage" - ] - } - } - ] - } - } - ] - } - } - ], - "must_not": [] - } - } - }, "has_narrative": { "aggs": { "has_narrative": { diff --git a/complaint_search/tests/expected_results/search_with_search_term_field_all.json b/complaint_search/tests/expected_results/search_with_search_term_field_all.json index 15ec6548..50b49ea3 100644 --- a/complaint_search/tests/expected_results/search_with_search_term_field_all.json +++ b/complaint_search/tests/expected_results/search_with_search_term_field_all.json @@ -7,8 +7,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -102,38 +100,6 @@ } } }, - "consumer_consent_provided": { - "aggs": { - "consumer_consent_provided": { - "terms": { - "field": "consumer_consent_provided.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [], - "must_not": [] - } - } - }, - "consumer_disputed": { - "aggs": { - "consumer_disputed": { - "terms": { - "field": "consumer_disputed.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [], - "must_not": [] - } - } - }, "has_narrative": { "aggs": { "has_narrative": { diff --git a/complaint_search/tests/expected_results/search_with_search_term_match__valid.json b/complaint_search/tests/expected_results/search_with_search_term_match__valid.json index c7556a35..44a0a593 100644 --- a/complaint_search/tests/expected_results/search_with_search_term_match__valid.json +++ b/complaint_search/tests/expected_results/search_with_search_term_match__valid.json @@ -7,8 +7,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -103,38 +101,6 @@ } } }, - "consumer_consent_provided": { - "aggs": { - "consumer_consent_provided": { - "terms": { - "field": "consumer_consent_provided.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [], - "must_not": [] - } - } - }, - "consumer_disputed": { - "aggs": { - "consumer_disputed": { - "terms": { - "field": "consumer_disputed.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [], - "must_not": [] - } - } - }, "has_narrative": { "aggs": { "has_narrative": { diff --git a/complaint_search/tests/expected_results/search_with_search_term_qsq_and__valid.json b/complaint_search/tests/expected_results/search_with_search_term_qsq_and__valid.json index 8a77f129..be4b3cef 100644 --- a/complaint_search/tests/expected_results/search_with_search_term_qsq_and__valid.json +++ b/complaint_search/tests/expected_results/search_with_search_term_qsq_and__valid.json @@ -7,8 +7,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -101,38 +99,6 @@ } } }, - "consumer_consent_provided": { - "aggs": { - "consumer_consent_provided": { - "terms": { - "field": "consumer_consent_provided.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [], - "must_not": [] - } - } - }, - "consumer_disputed": { - "aggs": { - "consumer_disputed": { - "terms": { - "field": "consumer_disputed.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [], - "must_not": [] - } - } - }, "has_narrative": { "aggs": { "has_narrative": { diff --git a/complaint_search/tests/expected_results/search_with_search_term_qsq_not__valid.json b/complaint_search/tests/expected_results/search_with_search_term_qsq_not__valid.json index b53b4958..9b04bfc3 100644 --- a/complaint_search/tests/expected_results/search_with_search_term_qsq_not__valid.json +++ b/complaint_search/tests/expected_results/search_with_search_term_qsq_not__valid.json @@ -7,8 +7,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -101,38 +99,6 @@ } } }, - "consumer_consent_provided": { - "aggs": { - "consumer_consent_provided": { - "terms": { - "field": "consumer_consent_provided.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [], - "must_not": [] - } - } - }, - "consumer_disputed": { - "aggs": { - "consumer_disputed": { - "terms": { - "field": "consumer_disputed.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [], - "must_not": [] - } - } - }, "has_narrative": { "aggs": { "has_narrative": { diff --git a/complaint_search/tests/expected_results/search_with_search_term_qsq_or__valid.json b/complaint_search/tests/expected_results/search_with_search_term_qsq_or__valid.json index bb3ccaf5..7426dd50 100644 --- a/complaint_search/tests/expected_results/search_with_search_term_qsq_or__valid.json +++ b/complaint_search/tests/expected_results/search_with_search_term_qsq_or__valid.json @@ -7,8 +7,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -101,38 +99,6 @@ } } }, - "consumer_consent_provided": { - "aggs": { - "consumer_consent_provided": { - "terms": { - "field": "consumer_consent_provided.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [], - "must_not": [] - } - } - }, - "consumer_disputed": { - "aggs": { - "consumer_disputed": { - "terms": { - "field": "consumer_disputed.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [], - "must_not": [] - } - } - }, "has_narrative": { "aggs": { "has_narrative": { diff --git a/complaint_search/tests/expected_results/search_with_search_term_qsq_to__valid.json b/complaint_search/tests/expected_results/search_with_search_term_qsq_to__valid.json index 01ebab9b..86448d03 100644 --- a/complaint_search/tests/expected_results/search_with_search_term_qsq_to__valid.json +++ b/complaint_search/tests/expected_results/search_with_search_term_qsq_to__valid.json @@ -7,8 +7,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -101,38 +99,6 @@ } } }, - "consumer_consent_provided": { - "aggs": { - "consumer_consent_provided": { - "terms": { - "field": "consumer_consent_provided.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [], - "must_not": [] - } - } - }, - "consumer_disputed": { - "aggs": { - "consumer_disputed": { - "terms": { - "field": "consumer_disputed.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [], - "must_not": [] - } - } - }, "has_narrative": { "aggs": { "has_narrative": { diff --git a/complaint_search/tests/expected_results/search_with_size__valid.json b/complaint_search/tests/expected_results/search_with_size__valid.json index 23706f13..59005ae7 100644 --- a/complaint_search/tests/expected_results/search_with_size__valid.json +++ b/complaint_search/tests/expected_results/search_with_size__valid.json @@ -7,8 +7,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -95,38 +93,6 @@ } } }, - "consumer_consent_provided": { - "aggs": { - "consumer_consent_provided": { - "terms": { - "field": "consumer_consent_provided.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [], - "must_not": [] - } - } - }, - "consumer_disputed": { - "aggs": { - "consumer_disputed": { - "terms": { - "field": "consumer_disputed.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [], - "must_not": [] - } - } - }, "has_narrative": { "aggs": { "has_narrative": { diff --git a/complaint_search/tests/expected_results/search_with_size_corrected__valid.json b/complaint_search/tests/expected_results/search_with_size_corrected__valid.json index a0a0c2b8..8cd40e65 100644 --- a/complaint_search/tests/expected_results/search_with_size_corrected__valid.json +++ b/complaint_search/tests/expected_results/search_with_size_corrected__valid.json @@ -7,8 +7,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -87,36 +85,6 @@ } } }, - "consumer_consent_provided": { - "aggs": { - "consumer_consent_provided": { - "terms": { - "field": "consumer_consent_provided.raw" - } - } - }, - "filter": { - "bool": { - "must": [], - "must_not": [] - } - } - }, - "consumer_disputed": { - "aggs": { - "consumer_disputed": { - "terms": { - "field": "consumer_disputed.raw" - } - } - }, - "filter": { - "bool": { - "must": [], - "must_not": [] - } - } - }, "has_narrative": { "aggs": { "has_narrative": { diff --git a/complaint_search/tests/expected_results/search_with_sort__valid.json b/complaint_search/tests/expected_results/search_with_sort__valid.json index 8b90b1f0..9a7a254e 100644 --- a/complaint_search/tests/expected_results/search_with_sort__valid.json +++ b/complaint_search/tests/expected_results/search_with_sort__valid.json @@ -7,8 +7,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -87,36 +85,6 @@ } } }, - "consumer_consent_provided": { - "aggs": { - "consumer_consent_provided": { - "terms": { - "field": "consumer_consent_provided.raw" - } - } - }, - "filter": { - "bool": { - "must": [], - "must_not": [] - } - } - }, - "consumer_disputed": { - "aggs": { - "consumer_disputed": { - "terms": { - "field": "consumer_disputed.raw" - } - } - }, - "filter": { - "bool": { - "must": [], - "must_not": [] - } - } - }, "has_narrative": { "aggs": { "has_narrative": { diff --git a/complaint_search/tests/expected_results/search_with_state__valid.json b/complaint_search/tests/expected_results/search_with_state__valid.json index 49e26bb3..dd629f00 100644 --- a/complaint_search/tests/expected_results/search_with_state__valid.json +++ b/complaint_search/tests/expected_results/search_with_state__valid.json @@ -7,8 +7,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -135,58 +133,6 @@ } } }, - "consumer_consent_provided": { - "aggs": { - "consumer_consent_provided": { - "terms": { - "field": "consumer_consent_provided.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "terms": { - "state": [ - "CA", - "VA", - "OR" - ] - } - } - ], - "must_not": [] - } - } - }, - "consumer_disputed": { - "aggs": { - "consumer_disputed": { - "terms": { - "field": "consumer_disputed.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "terms": { - "state": [ - "CA", - "VA", - "OR" - ] - } - } - ], - "must_not": [] - } - } - }, "has_narrative": { "aggs": { "has_narrative": { diff --git a/complaint_search/tests/expected_results/search_with_submitted_via__valid.json b/complaint_search/tests/expected_results/search_with_submitted_via__valid.json index db8bc8f8..e08b9638 100644 --- a/complaint_search/tests/expected_results/search_with_submitted_via__valid.json +++ b/complaint_search/tests/expected_results/search_with_submitted_via__valid.json @@ -7,8 +7,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -127,54 +125,6 @@ } } }, - "consumer_consent_provided": { - "aggs": { - "consumer_consent_provided": { - "terms": { - "field": "consumer_consent_provided.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "terms": { - "submitted_via": [ - "Web" - ] - } - } - ], - "must_not": [] - } - } - }, - "consumer_disputed": { - "aggs": { - "consumer_disputed": { - "terms": { - "field": "consumer_disputed.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "terms": { - "submitted_via": [ - "Web" - ] - } - } - ], - "must_not": [] - } - } - }, "has_narrative": { "aggs": { "has_narrative": { diff --git a/complaint_search/tests/expected_results/search_with_tags__valid.json b/complaint_search/tests/expected_results/search_with_tags__valid.json index 1c81c133..fe1d512c 100644 --- a/complaint_search/tests/expected_results/search_with_tags__valid.json +++ b/complaint_search/tests/expected_results/search_with_tags__valid.json @@ -7,8 +7,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -131,56 +129,6 @@ } } }, - "consumer_consent_provided": { - "aggs": { - "consumer_consent_provided": { - "terms": { - "field": "consumer_consent_provided.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "terms": { - "tags": [ - "Older American", - "Servicemember" - ] - } - } - ], - "must_not": [] - } - } - }, - "consumer_disputed": { - "aggs": { - "consumer_disputed": { - "terms": { - "field": "consumer_disputed.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "terms": { - "tags": [ - "Older American", - "Servicemember" - ] - } - } - ], - "must_not": [] - } - } - }, "has_narrative": { "aggs": { "has_narrative": { diff --git a/complaint_search/tests/expected_results/search_with_timely__valid.json b/complaint_search/tests/expected_results/search_with_timely__valid.json index 3aadfcab..b3afdab4 100644 --- a/complaint_search/tests/expected_results/search_with_timely__valid.json +++ b/complaint_search/tests/expected_results/search_with_timely__valid.json @@ -7,8 +7,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -131,56 +129,6 @@ } } }, - "consumer_consent_provided": { - "aggs": { - "consumer_consent_provided": { - "terms": { - "field": "consumer_consent_provided.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "terms": { - "timely": [ - "Yes", - "No" - ] - } - } - ], - "must_not": [] - } - } - }, - "consumer_disputed": { - "aggs": { - "consumer_disputed": { - "terms": { - "field": "consumer_disputed.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "terms": { - "timely": [ - "Yes", - "No" - ] - } - } - ], - "must_not": [] - } - } - }, "has_narrative": { "aggs": { "has_narrative": { diff --git a/complaint_search/tests/expected_results/search_with_two_not__valid.json b/complaint_search/tests/expected_results/search_with_two_not__valid.json index e999acf0..2852e9e7 100644 --- a/complaint_search/tests/expected_results/search_with_two_not__valid.json +++ b/complaint_search/tests/expected_results/search_with_two_not__valid.json @@ -7,8 +7,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -211,96 +209,6 @@ } } }, - "consumer_consent_provided": { - "aggs": { - "consumer_consent_provided": { - "terms": { - "field": "consumer_consent_provided.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [], - "must_not": [ - { - "bool": { - "must": [ - { - "bool": { - "should": [ - { - "term": { - "issue.raw": "Incorrect information on your report" - } - } - ] - } - }, - { - "bool": { - "should": [ - { - "term": { - "product.raw": "Credit reporting, credit repair services, or other personal consumer reports" - } - } - ] - } - } - ] - } - } - ] - } - } - }, - "consumer_disputed": { - "aggs": { - "consumer_disputed": { - "terms": { - "field": "consumer_disputed.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [], - "must_not": [ - { - "bool": { - "must": [ - { - "bool": { - "should": [ - { - "term": { - "issue.raw": "Incorrect information on your report" - } - } - ] - } - }, - { - "bool": { - "should": [ - { - "term": { - "product.raw": "Credit reporting, credit repair services, or other personal consumer reports" - } - } - ] - } - } - ] - } - } - ] - } - } - }, "has_narrative": { "aggs": { "has_narrative": { diff --git a/complaint_search/tests/expected_results/search_with_zip_code__valid.json b/complaint_search/tests/expected_results/search_with_zip_code__valid.json index 14f43b3c..2ac50021 100644 --- a/complaint_search/tests/expected_results/search_with_zip_code__valid.json +++ b/complaint_search/tests/expected_results/search_with_zip_code__valid.json @@ -7,8 +7,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -135,58 +133,6 @@ } } }, - "consumer_consent_provided": { - "aggs": { - "consumer_consent_provided": { - "terms": { - "field": "consumer_consent_provided.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "terms": { - "zip_code": [ - "12345", - "23435", - "03433" - ] - } - } - ], - "must_not": [] - } - } - }, - "consumer_disputed": { - "aggs": { - "consumer_disputed": { - "terms": { - "field": "consumer_disputed.raw", - "size": 10 - } - } - }, - "filter": { - "bool": { - "must": [ - { - "terms": { - "zip_code": [ - "12345", - "23435", - "03433" - ] - } - } - ], - "must_not": [] - } - } - }, "has_narrative": { "aggs": { "has_narrative": { diff --git a/complaint_search/tests/expected_results/search_with_zip_code_agg_exclude__valid.json b/complaint_search/tests/expected_results/search_with_zip_code_agg_exclude__valid.json index 650afb0f..0142fd00 100644 --- a/complaint_search/tests/expected_results/search_with_zip_code_agg_exclude__valid.json +++ b/complaint_search/tests/expected_results/search_with_zip_code_agg_exclude__valid.json @@ -7,8 +7,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -135,58 +133,6 @@ } } }, - "consumer_consent_provided": { - "aggs": { - "consumer_consent_provided": { - "terms": { - "size": 10, - "field": "consumer_consent_provided.raw" - } - } - }, - "filter": { - "bool": { - "must": [ - { - "terms": { - "zip_code": [ - "12345", - "23435", - "03433" - ] - } - } - ], - "must_not": [] - } - } - }, - "consumer_disputed": { - "aggs": { - "consumer_disputed": { - "terms": { - "size": 10, - "field": "consumer_disputed.raw" - } - } - }, - "filter": { - "bool": { - "must": [ - { - "terms": { - "zip_code": [ - "12345", - "23435", - "03433" - ] - } - } - ], - "must_not": [] - } - } - }, "has_narrative": { "aggs": { "has_narrative": { @@ -402,4 +348,4 @@ } } } -} \ No newline at end of file +} diff --git a/complaint_search/tests/expected_results/states_agg__valid.json b/complaint_search/tests/expected_results/states_agg__valid.json index 650a6002..dc4c2148 100644 --- a/complaint_search/tests/expected_results/states_agg__valid.json +++ b/complaint_search/tests/expected_results/states_agg__valid.json @@ -7,8 +7,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -98,4 +96,4 @@ } } } -} \ No newline at end of file +} diff --git a/complaint_search/tests/expected_results/states_date_filters__valid.json b/complaint_search/tests/expected_results/states_date_filters__valid.json index 8e6602f4..9ba899b8 100644 --- a/complaint_search/tests/expected_results/states_date_filters__valid.json +++ b/complaint_search/tests/expected_results/states_date_filters__valid.json @@ -7,8 +7,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -163,4 +161,4 @@ } } } -} \ No newline at end of file +} diff --git a/complaint_search/tests/expected_results/trends_filter__valid.json b/complaint_search/tests/expected_results/trends_filter__valid.json index 3142ddbb..70dd79da 100644 --- a/complaint_search/tests/expected_results/trends_filter__valid.json +++ b/complaint_search/tests/expected_results/trends_filter__valid.json @@ -920,8 +920,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -1186,4 +1184,4 @@ } } } -} \ No newline at end of file +} diff --git a/complaint_search/tests/expected_results/trends_sub_lens_product__valid.json b/complaint_search/tests/expected_results/trends_sub_lens_product__valid.json index c286ac01..6f6eac41 100644 --- a/complaint_search/tests/expected_results/trends_sub_lens_product__valid.json +++ b/complaint_search/tests/expected_results/trends_sub_lens_product__valid.json @@ -762,8 +762,6 @@ "company_response", "complaint_id", "complaint_what_happened", - "consumer_consent_provided", - "consumer_disputed", "date_received", "date_sent_to_company", "has_narrative", @@ -885,4 +883,4 @@ } } } -} \ No newline at end of file +} diff --git a/complaint_search/tests/test_es_interface.py b/complaint_search/tests/test_es_interface.py index 51fb767c..1e79459e 100644 --- a/complaint_search/tests/test_es_interface.py +++ b/complaint_search/tests/test_es_interface.py @@ -455,12 +455,6 @@ def test_search_with_company_public_response__valid(self): ], ) - def test_search_with_consumer_consent_provided__valid(self): - self.request_test( - "search_with_consumer_consent_provided__valid", - consumer_consent_provided=["Consent provided"], - ) - def test_search_with_submitted_via__valid(self): self.request_test( "search_with_submitted_via__valid", submitted_via=["Web"] diff --git a/complaint_search/tests/test_views_search.py b/complaint_search/tests/test_views_search.py index 0e4ab5e3..5a1a4078 100644 --- a/complaint_search/tests/test_views_search.py +++ b/complaint_search/tests/test_views_search.py @@ -609,20 +609,6 @@ def test_search_with_timely__valid(self, mock_essearch): ) self.assertEqual("OK", response.data) - @mock.patch("complaint_search.es_interface.search") - def test_search_with_consumer_disputed__valid(self, mock_essearch): - url = reverse("complaint_search:search") - url += "?consumer_disputed=yes&consumer_disputed=no" - mock_essearch.return_value = "OK" - response = self.client.get(url) - self.assertEqual(status.HTTP_200_OK, response.status_code) - # -*- coding: utf-8 -*- - mock_essearch.assert_called_once_with( - agg_exclude=AGG_EXCLUDE_FIELDS, - **self.buildDefaultParams({"consumer_disputed": ["yes", "no"]}), - ) - self.assertEqual("OK", response.data) - @mock.patch("complaint_search.es_interface.search") def test_search_with_company_response__valid(self, mock_essearch): url = reverse("complaint_search:search") @@ -658,22 +644,6 @@ def test_search_with_company_public_response__valid(self, mock_essearch): ) self.assertEqual("OK", response.data) - @mock.patch("complaint_search.es_interface.search") - def test_search_with_consumer_consent_provided__valid(self, mock_essearch): - url = reverse("complaint_search:search") - url += "?consumer_consent_provided=Yes&consumer_consent_provided=No" - mock_essearch.return_value = "OK" - response = self.client.get(url) - self.assertEqual(status.HTTP_200_OK, response.status_code) - # -*- coding: utf-8 -*- - mock_essearch.assert_called_once_with( - agg_exclude=AGG_EXCLUDE_FIELDS, - **self.buildDefaultParams( - {"consumer_consent_provided": ["Yes", "No"]} - ), - ) - self.assertEqual("OK", response.data) - @mock.patch("complaint_search.es_interface.search") def test_search_with_has_narrative__valid(self, mock_essearch): url = reverse("complaint_search:search") diff --git a/complaint_search/views.py b/complaint_search/views.py index c38f02f9..5b1100dd 100644 --- a/complaint_search/views.py +++ b/complaint_search/views.py @@ -68,8 +68,6 @@ "company", "company_public_response", "company_response", - "consumer_consent_provided", - "consumer_disputed", "has_narrative", "issue", "product", diff --git a/swagger-config.yaml b/swagger-config.yaml index 29b8febd..d40563da 100644 --- a/swagger-config.yaml +++ b/swagger-config.yaml @@ -31,8 +31,6 @@ paths: - $ref: '#/components/parameters/company_received_max' - $ref: '#/components/parameters/company_received_min' - $ref: '#/components/parameters/company_response' - - $ref: '#/components/parameters/consumer_consent_provided' - - $ref: '#/components/parameters/consumer_disputed' - $ref: '#/components/parameters/date_received_max' - $ref: '#/components/parameters/date_received_min' - $ref: '#/components/parameters/has_narrative' @@ -87,8 +85,6 @@ paths: - $ref: '#/components/parameters/company_received_max' - $ref: '#/components/parameters/company_received_min' - $ref: '#/components/parameters/company_response' - - $ref: '#/components/parameters/consumer_consent_provided' - - $ref: '#/components/parameters/consumer_disputed' - $ref: '#/components/parameters/date_received_max' - $ref: '#/components/parameters/date_received_min' - $ref: '#/components/parameters/has_narrative' @@ -121,8 +117,6 @@ paths: - $ref: '#/components/parameters/company_received_max' - $ref: '#/components/parameters/company_received_min' - $ref: '#/components/parameters/company_response' - - $ref: '#/components/parameters/consumer_consent_provided' - - $ref: '#/components/parameters/consumer_disputed' - $ref: '#/components/parameters/date_received_max' - $ref: '#/components/parameters/date_received_min' - $ref: '#/components/parameters/has_narrative' @@ -183,8 +177,6 @@ paths: - $ref: '#/components/parameters/company_received_max' - $ref: '#/components/parameters/company_received_min' - $ref: '#/components/parameters/company_response' - - $ref: '#/components/parameters/consumer_consent_provided' - - $ref: '#/components/parameters/consumer_disputed' - $ref: '#/components/parameters/date_received_max' - $ref: '#/components/parameters/date_received_min' - $ref: '#/components/parameters/has_narrative' @@ -216,8 +208,6 @@ paths: - $ref: '#/components/parameters/company_received_max' - $ref: '#/components/parameters/company_received_min' - $ref: '#/components/parameters/company_response' - - $ref: '#/components/parameters/consumer_consent_provided' - - $ref: '#/components/parameters/consumer_disputed' - $ref: '#/components/parameters/date_received_max' - $ref: '#/components/parameters/date_received_min' - $ref: '#/components/parameters/focus' @@ -301,24 +291,6 @@ components: type: array items: type: string - consumer_consent_provided: - name: consumer_consent_provided - in: query - description: Filter the results to only return these types of consent consumer provided - explode: true - schema: - type: array - items: - type: string - consumer_disputed: - name: consumer_disputed - in: query - description: Filter the results to only return the specified state of consumer disputed, i.e. yes, no - explode: true - schema: - type: array - items: - type: string date_received_max: name: date_received_max in: query @@ -619,12 +591,6 @@ components: complaint_what_happened: type: string description: A description of the complaint provided by the consumer - consumer_consent_provided: - type: string - description: Identifies whether the consumer opted in to publish their complaint narrative - consumer_disputed: - type: string - description: Whether the consumer disputed the company's response date_received: type: string format: date @@ -765,10 +731,6 @@ components: $ref: '#/components/schemas/Aggregation' company_response: $ref: '#/components/schemas/Aggregation' - consumer_consent_provided: - $ref: '#/components/schemas/Aggregation' - consumer_disputed: - $ref: '#/components/schemas/Aggregation' has_narrative: $ref: '#/components/schemas/Aggregation' issue: