diff --git a/complaint_search/es_builders.py b/complaint_search/es_builders.py index db6836f4..5dd32a62 100644 --- a/complaint_search/es_builders.py +++ b/complaint_search/es_builders.py @@ -72,7 +72,7 @@ def _create_bool_should_clauses(self, es_field_name, value_list, def _create_and_append_bool_should_clauses(self, es_field_name, value_list, filter_list, with_subitems=False, es_subitem_field_name=None): - + filter_clauses = self._create_bool_should_clauses(es_field_name, value_list, with_subitems, es_subitem_field_name) @@ -172,19 +172,19 @@ def build(self): # All fields that need to have an aggregation entry Field = namedtuple('Field', 'name size has_subfield') fields = [ - Field('has_narratives', 10, False), - Field('company', 10000, False), - Field('product', 10000, True), - Field('issue', 10000, True), - Field('state', 50, False), - Field('zip_code', 1000, False), - Field('timely', 10, False), - Field('company_response', 100, False), - Field('company_public_response', 100, False), - Field('consumer_disputed', 100, False), - Field('consumer_consent_provided', 100, False), - Field('tag', 100, False), - Field('submitted_via', 100, False) + Field('has_narratives', 0, False), + Field('company', 0, False), + Field('product', 0, True), + Field('issue', 0, True), + Field('state', 0, False), + Field('zip_code', 0, False), + Field('timely', 0, False), + Field('company_response', 0, False), + Field('company_public_response', 0, False), + Field('consumer_disputed', 0, False), + Field('consumer_consent_provided', 0, False), + Field('tag', 0, False), + Field('submitted_via', 0, False) ] aggs = {} diff --git a/complaint_search/serializer.py b/complaint_search/serializer.py index ae7bb05a..2eb71d18 100644 --- a/complaint_search/serializer.py +++ b/complaint_search/serializer.py @@ -58,7 +58,7 @@ class SearchInputSerializer(serializers.Serializer): child=serializers.CharField(max_length=200), required=False) state = serializers.ListField( child=serializers.ChoiceField(STATE_CHOICES), required=False) - zipcode = serializers.ListField( + zip_code = serializers.ListField( child=serializers.CharField(min_length=5, max_length=5), required=False) timely = serializers.ListField( child=serializers.CharField(max_length=200), required=False) 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 7ce01e86..c982d520 100644 --- a/complaint_search/tests/expected_results/search_no_param__valid.json +++ b/complaint_search/tests/expected_results/search_no_param__valid.json @@ -36,7 +36,7 @@ "has_narratives": { "terms": { "field": "has_narratives", - "size": 10 + "size": 0 } } } @@ -57,7 +57,7 @@ "company": { "terms": { "field": "company", - "size": 10000 + "size": 0 } } } @@ -78,13 +78,13 @@ "product": { "terms": { "field": "product.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_product.raw": { "terms": { "field": "sub_product.raw", - "size": 10000 + "size": 0 } } } @@ -107,13 +107,13 @@ "issue": { "terms": { "field": "issue.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_issue.raw": { "terms": { "field": "sub_issue.raw", - "size": 10000 + "size": 0 } } } @@ -136,7 +136,7 @@ "state": { "terms": { "field": "state", - "size": 50 + "size": 0 } } } @@ -157,7 +157,7 @@ "zip_code": { "terms": { "field": "zip_code", - "size": 1000 + "size": 0 } } } @@ -178,7 +178,7 @@ "timely": { "terms": { "field": "timely", - "size": 10 + "size": 0 } } } @@ -199,7 +199,7 @@ "company_response": { "terms": { "field": "company_response", - "size": 100 + "size": 0 } } } @@ -220,7 +220,7 @@ "company_public_response": { "terms": { "field": "company_public_response.raw", - "size": 100 + "size": 0 } } } @@ -241,7 +241,7 @@ "consumer_disputed": { "terms": { "field": "consumer_disputed.raw", - "size": 100 + "size": 0 } } } @@ -262,7 +262,7 @@ "consumer_consent_provided": { "terms": { "field": "consumer_consent_provided.raw", - "size": 100 + "size": 0 } } } @@ -283,7 +283,7 @@ "tag": { "terms": { "field": "tag", - "size": 100 + "size": 0 } } } @@ -304,7 +304,7 @@ "submitted_via": { "terms": { "field": "submitted_via", - "size": 100 + "size": 0 } } } 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 0f274b0e..d2fa7ed3 100644 --- a/complaint_search/tests/expected_results/search_with_company__valid.json +++ b/complaint_search/tests/expected_results/search_with_company__valid.json @@ -57,7 +57,7 @@ "has_narratives": { "terms": { "field": "has_narratives", - "size": 10 + "size": 0 } } } @@ -78,7 +78,7 @@ "company": { "terms": { "field": "company", - "size": 10000 + "size": 0 } } } @@ -107,13 +107,13 @@ "product": { "terms": { "field": "product.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_product.raw": { "terms": { "field": "sub_product.raw", - "size": 10000 + "size": 0 } } } @@ -144,13 +144,13 @@ "issue": { "terms": { "field": "issue.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_issue.raw": { "terms": { "field": "sub_issue.raw", - "size": 10000 + "size": 0 } } } @@ -181,7 +181,7 @@ "state": { "terms": { "field": "state", - "size": 50 + "size": 0 } } } @@ -210,7 +210,7 @@ "zip_code": { "terms": { "field": "zip_code", - "size": 1000 + "size": 0 } } } @@ -239,7 +239,7 @@ "timely": { "terms": { "field": "timely", - "size": 10 + "size": 0 } } } @@ -268,7 +268,7 @@ "company_response": { "terms": { "field": "company_response", - "size": 100 + "size": 0 } } } @@ -297,7 +297,7 @@ "company_public_response": { "terms": { "field": "company_public_response.raw", - "size": 100 + "size": 0 } } } @@ -326,7 +326,7 @@ "consumer_disputed": { "terms": { "field": "consumer_disputed.raw", - "size": 100 + "size": 0 } } } @@ -355,7 +355,7 @@ "consumer_consent_provided": { "terms": { "field": "consumer_consent_provided.raw", - "size": 100 + "size": 0 } } } @@ -384,7 +384,7 @@ "tag": { "terms": { "field": "tag", - "size": 100 + "size": 0 } } } @@ -413,7 +413,7 @@ "submitted_via": { "terms": { "field": "submitted_via", - "size": 100 + "size": 0 } } } 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 ff87b3be..84a44746 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 @@ -55,7 +55,7 @@ "has_narratives": { "terms": { "field": "has_narratives", - "size": 10 + "size": 0 } } } @@ -84,7 +84,7 @@ "company": { "terms": { "field": "company", - "size": 10000 + "size": 0 } } } @@ -113,13 +113,13 @@ "product": { "terms": { "field": "product.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_product.raw": { "terms": { "field": "sub_product.raw", - "size": 10000 + "size": 0 } } } @@ -150,13 +150,13 @@ "issue": { "terms": { "field": "issue.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_issue.raw": { "terms": { "field": "sub_issue.raw", - "size": 10000 + "size": 0 } } } @@ -187,7 +187,7 @@ "state": { "terms": { "field": "state", - "size": 50 + "size": 0 } } } @@ -216,7 +216,7 @@ "zip_code": { "terms": { "field": "zip_code", - "size": 1000 + "size": 0 } } } @@ -245,7 +245,7 @@ "timely": { "terms": { "field": "timely", - "size": 10 + "size": 0 } } } @@ -274,7 +274,7 @@ "company_response": { "terms": { "field": "company_response", - "size": 100 + "size": 0 } } } @@ -295,7 +295,7 @@ "company_public_response": { "terms": { "field": "company_public_response.raw", - "size": 100 + "size": 0 } } } @@ -324,7 +324,7 @@ "consumer_disputed": { "terms": { "field": "consumer_disputed.raw", - "size": 100 + "size": 0 } } } @@ -353,7 +353,7 @@ "consumer_consent_provided": { "terms": { "field": "consumer_consent_provided.raw", - "size": 100 + "size": 0 } } } @@ -382,7 +382,7 @@ "tag": { "terms": { "field": "tag", - "size": 100 + "size": 0 } } } @@ -411,7 +411,7 @@ "submitted_via": { "terms": { "field": "submitted_via", - "size": 100 + "size": 0 } } } 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 f17847bc..47c5597a 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 @@ -55,7 +55,7 @@ "has_narratives": { "terms": { "field": "has_narratives", - "size": 10 + "size": 0 } } } @@ -84,7 +84,7 @@ "company": { "terms": { "field": "company", - "size": 10000 + "size": 0 } } } @@ -113,13 +113,13 @@ "product": { "terms": { "field": "product.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_product.raw": { "terms": { "field": "sub_product.raw", - "size": 10000 + "size": 0 } } } @@ -150,13 +150,13 @@ "issue": { "terms": { "field": "issue.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_issue.raw": { "terms": { "field": "sub_issue.raw", - "size": 10000 + "size": 0 } } } @@ -187,7 +187,7 @@ "state": { "terms": { "field": "state", - "size": 50 + "size": 0 } } } @@ -216,7 +216,7 @@ "zip_code": { "terms": { "field": "zip_code", - "size": 1000 + "size": 0 } } } @@ -245,7 +245,7 @@ "timely": { "terms": { "field": "timely", - "size": 10 + "size": 0 } } } @@ -266,7 +266,7 @@ "company_response": { "terms": { "field": "company_response", - "size": 100 + "size": 0 } } } @@ -295,7 +295,7 @@ "company_public_response": { "terms": { "field": "company_public_response.raw", - "size": 100 + "size": 0 } } } @@ -324,7 +324,7 @@ "consumer_disputed": { "terms": { "field": "consumer_disputed.raw", - "size": 100 + "size": 0 } } } @@ -353,7 +353,7 @@ "consumer_consent_provided": { "terms": { "field": "consumer_consent_provided.raw", - "size": 100 + "size": 0 } } } @@ -382,7 +382,7 @@ "tag": { "terms": { "field": "tag", - "size": 100 + "size": 0 } } } @@ -411,7 +411,7 @@ "submitted_via": { "terms": { "field": "submitted_via", - "size": 100 + "size": 0 } } } 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 index 0529685d..ed267b52 100644 --- 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 @@ -55,7 +55,7 @@ "has_narratives": { "terms": { "field": "has_narratives", - "size": 10 + "size": 0 } } } @@ -84,7 +84,7 @@ "company": { "terms": { "field": "company", - "size": 10000 + "size": 0 } } } @@ -113,13 +113,13 @@ "product": { "terms": { "field": "product.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_product.raw": { "terms": { "field": "sub_product.raw", - "size": 10000 + "size": 0 } } } @@ -150,13 +150,13 @@ "issue": { "terms": { "field": "issue.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_issue.raw": { "terms": { "field": "sub_issue.raw", - "size": 10000 + "size": 0 } } } @@ -187,7 +187,7 @@ "state": { "terms": { "field": "state", - "size": 50 + "size": 0 } } } @@ -216,7 +216,7 @@ "zip_code": { "terms": { "field": "zip_code", - "size": 1000 + "size": 0 } } } @@ -245,7 +245,7 @@ "timely": { "terms": { "field": "timely", - "size": 10 + "size": 0 } } } @@ -274,7 +274,7 @@ "company_response": { "terms": { "field": "company_response", - "size": 100 + "size": 0 } } } @@ -303,7 +303,7 @@ "company_public_response": { "terms": { "field": "company_public_response.raw", - "size": 100 + "size": 0 } } } @@ -332,7 +332,7 @@ "consumer_disputed": { "terms": { "field": "consumer_disputed.raw", - "size": 100 + "size": 0 } } } @@ -353,7 +353,7 @@ "consumer_consent_provided": { "terms": { "field": "consumer_consent_provided.raw", - "size": 100 + "size": 0 } } } @@ -382,7 +382,7 @@ "tag": { "terms": { "field": "tag", - "size": 100 + "size": 0 } } } @@ -411,7 +411,7 @@ "submitted_via": { "terms": { "field": "submitted_via", - "size": 100 + "size": 0 } } } diff --git a/complaint_search/tests/expected_results/search_with_consumer_disputed__valid.json b/complaint_search/tests/expected_results/search_with_consumer_disputed__valid.json index 8830cc08..d2bff546 100644 --- a/complaint_search/tests/expected_results/search_with_consumer_disputed__valid.json +++ b/complaint_search/tests/expected_results/search_with_consumer_disputed__valid.json @@ -55,7 +55,7 @@ "has_narratives": { "terms": { "field": "has_narratives", - "size": 10 + "size": 0 } } } @@ -84,7 +84,7 @@ "company": { "terms": { "field": "company", - "size": 10000 + "size": 0 } } } @@ -113,13 +113,13 @@ "product": { "terms": { "field": "product.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_product.raw": { "terms": { "field": "sub_product.raw", - "size": 10000 + "size": 0 } } } @@ -150,13 +150,13 @@ "issue": { "terms": { "field": "issue.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_issue.raw": { "terms": { "field": "sub_issue.raw", - "size": 10000 + "size": 0 } } } @@ -187,7 +187,7 @@ "state": { "terms": { "field": "state", - "size": 50 + "size": 0 } } } @@ -216,7 +216,7 @@ "zip_code": { "terms": { "field": "zip_code", - "size": 1000 + "size": 0 } } } @@ -245,7 +245,7 @@ "timely": { "terms": { "field": "timely", - "size": 10 + "size": 0 } } } @@ -274,7 +274,7 @@ "company_response": { "terms": { "field": "company_response", - "size": 100 + "size": 0 } } } @@ -303,7 +303,7 @@ "company_public_response": { "terms": { "field": "company_public_response.raw", - "size": 100 + "size": 0 } } } @@ -324,7 +324,7 @@ "consumer_disputed": { "terms": { "field": "consumer_disputed.raw", - "size": 100 + "size": 0 } } } @@ -353,7 +353,7 @@ "consumer_consent_provided": { "terms": { "field": "consumer_consent_provided.raw", - "size": 100 + "size": 0 } } } @@ -382,7 +382,7 @@ "tag": { "terms": { "field": "tag", - "size": 100 + "size": 0 } } } @@ -411,7 +411,7 @@ "submitted_via": { "terms": { "field": "submitted_via", - "size": 100 + "size": 0 } } } diff --git a/complaint_search/tests/expected_results/search_with_field__valid.json b/complaint_search/tests/expected_results/search_with_field__valid.json index 47708aa6..270e607a 100644 --- a/complaint_search/tests/expected_results/search_with_field__valid.json +++ b/complaint_search/tests/expected_results/search_with_field__valid.json @@ -36,7 +36,7 @@ "has_narratives": { "terms": { "field": "has_narratives", - "size": 10 + "size": 0 } } } @@ -57,7 +57,7 @@ "company": { "terms": { "field": "company", - "size": 10000 + "size": 0 } } } @@ -78,13 +78,13 @@ "product": { "terms": { "field": "product.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_product.raw": { "terms": { "field": "sub_product.raw", - "size": 10000 + "size": 0 } } } @@ -107,13 +107,13 @@ "issue": { "terms": { "field": "issue.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_issue.raw": { "terms": { "field": "sub_issue.raw", - "size": 10000 + "size": 0 } } } @@ -136,7 +136,7 @@ "state": { "terms": { "field": "state", - "size": 50 + "size": 0 } } } @@ -157,7 +157,7 @@ "zip_code": { "terms": { "field": "zip_code", - "size": 1000 + "size": 0 } } } @@ -178,7 +178,7 @@ "timely": { "terms": { "field": "timely", - "size": 10 + "size": 0 } } } @@ -199,7 +199,7 @@ "company_response": { "terms": { "field": "company_response", - "size": 100 + "size": 0 } } } @@ -220,7 +220,7 @@ "company_public_response": { "terms": { "field": "company_public_response.raw", - "size": 100 + "size": 0 } } } @@ -241,7 +241,7 @@ "consumer_disputed": { "terms": { "field": "consumer_disputed.raw", - "size": 100 + "size": 0 } } } @@ -262,7 +262,7 @@ "consumer_consent_provided": { "terms": { "field": "consumer_consent_provided.raw", - "size": 100 + "size": 0 } } } @@ -283,7 +283,7 @@ "tag": { "terms": { "field": "tag", - "size": 100 + "size": 0 } } } @@ -304,7 +304,7 @@ "submitted_via": { "terms": { "field": "submitted_via", - "size": 100 + "size": 0 } } } 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 364bc0b4..9d6699a5 100644 --- a/complaint_search/tests/expected_results/search_with_frm__valid.json +++ b/complaint_search/tests/expected_results/search_with_frm__valid.json @@ -36,7 +36,7 @@ "has_narratives": { "terms": { "field": "has_narratives", - "size": 10 + "size": 0 } } } @@ -57,7 +57,7 @@ "company": { "terms": { "field": "company", - "size": 10000 + "size": 0 } } } @@ -78,13 +78,13 @@ "product": { "terms": { "field": "product.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_product.raw": { "terms": { "field": "sub_product.raw", - "size": 10000 + "size": 0 } } } @@ -107,13 +107,13 @@ "issue": { "terms": { "field": "issue.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_issue.raw": { "terms": { "field": "sub_issue.raw", - "size": 10000 + "size": 0 } } } @@ -136,7 +136,7 @@ "state": { "terms": { "field": "state", - "size": 50 + "size": 0 } } } @@ -157,7 +157,7 @@ "zip_code": { "terms": { "field": "zip_code", - "size": 1000 + "size": 0 } } } @@ -178,7 +178,7 @@ "timely": { "terms": { "field": "timely", - "size": 10 + "size": 0 } } } @@ -199,7 +199,7 @@ "company_response": { "terms": { "field": "company_response", - "size": 100 + "size": 0 } } } @@ -220,7 +220,7 @@ "company_public_response": { "terms": { "field": "company_public_response.raw", - "size": 100 + "size": 0 } } } @@ -241,7 +241,7 @@ "consumer_disputed": { "terms": { "field": "consumer_disputed.raw", - "size": 100 + "size": 0 } } } @@ -262,7 +262,7 @@ "consumer_consent_provided": { "terms": { "field": "consumer_consent_provided.raw", - "size": 100 + "size": 0 } } } @@ -283,7 +283,7 @@ "tag": { "terms": { "field": "tag", - "size": 100 + "size": 0 } } } @@ -304,7 +304,7 @@ "submitted_via": { "terms": { "field": "submitted_via", - "size": 100 + "size": 0 } } } diff --git a/complaint_search/tests/expected_results/search_with_has_narratives__valid.json b/complaint_search/tests/expected_results/search_with_has_narratives__valid.json index e78b5524..c177268b 100644 --- a/complaint_search/tests/expected_results/search_with_has_narratives__valid.json +++ b/complaint_search/tests/expected_results/search_with_has_narratives__valid.json @@ -47,7 +47,7 @@ "has_narratives": { "terms": { "field": "has_narratives", - "size": 10 + "size": 0 } } } @@ -76,7 +76,7 @@ "company": { "terms": { "field": "company", - "size": 10000 + "size": 0 } } } @@ -105,13 +105,13 @@ "product": { "terms": { "field": "product.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_product.raw": { "terms": { "field": "sub_product.raw", - "size": 10000 + "size": 0 } } } @@ -142,13 +142,13 @@ "issue": { "terms": { "field": "issue.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_issue.raw": { "terms": { "field": "sub_issue.raw", - "size": 10000 + "size": 0 } } } @@ -179,7 +179,7 @@ "state": { "terms": { "field": "state", - "size": 50 + "size": 0 } } } @@ -208,7 +208,7 @@ "zip_code": { "terms": { "field": "zip_code", - "size": 1000 + "size": 0 } } } @@ -237,7 +237,7 @@ "timely": { "terms": { "field": "timely", - "size": 10 + "size": 0 } } } @@ -266,7 +266,7 @@ "company_response": { "terms": { "field": "company_response", - "size": 100 + "size": 0 } } } @@ -295,7 +295,7 @@ "company_public_response": { "terms": { "field": "company_public_response.raw", - "size": 100 + "size": 0 } } } @@ -324,7 +324,7 @@ "consumer_disputed": { "terms": { "field": "consumer_disputed.raw", - "size": 100 + "size": 0 } } } @@ -353,7 +353,7 @@ "consumer_consent_provided": { "terms": { "field": "consumer_consent_provided.raw", - "size": 100 + "size": 0 } } } @@ -382,7 +382,7 @@ "tag": { "terms": { "field": "tag", - "size": 100 + "size": 0 } } } @@ -411,7 +411,7 @@ "submitted_via": { "terms": { "field": "submitted_via", - "size": 100 + "size": 0 } } } 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 3b1f3733..eefb83af 100644 --- a/complaint_search/tests/expected_results/search_with_issue__valid.json +++ b/complaint_search/tests/expected_results/search_with_issue__valid.json @@ -69,7 +69,7 @@ "has_narratives": { "terms": { "field": "has_narratives", - "size": 10 + "size": 0 } } } @@ -105,7 +105,7 @@ "company": { "terms": { "field": "company", - "size": 10000 + "size": 0 } } } @@ -141,13 +141,13 @@ "product": { "terms": { "field": "product.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_product.raw": { "terms": { "field": "sub_product.raw", - "size": 10000 + "size": 0 } } } @@ -170,13 +170,13 @@ "issue": { "terms": { "field": "issue.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_issue.raw": { "terms": { "field": "sub_issue.raw", - "size": 10000 + "size": 0 } } } @@ -214,7 +214,7 @@ "state": { "terms": { "field": "state", - "size": 50 + "size": 0 } } } @@ -250,7 +250,7 @@ "zip_code": { "terms": { "field": "zip_code", - "size": 1000 + "size": 0 } } } @@ -286,7 +286,7 @@ "timely": { "terms": { "field": "timely", - "size": 10 + "size": 0 } } } @@ -322,7 +322,7 @@ "company_response": { "terms": { "field": "company_response", - "size": 100 + "size": 0 } } } @@ -358,7 +358,7 @@ "company_public_response": { "terms": { "field": "company_public_response.raw", - "size": 100 + "size": 0 } } } @@ -394,7 +394,7 @@ "consumer_disputed": { "terms": { "field": "consumer_disputed.raw", - "size": 100 + "size": 0 } } } @@ -430,7 +430,7 @@ "consumer_consent_provided": { "terms": { "field": "consumer_consent_provided.raw", - "size": 100 + "size": 0 } } } @@ -466,7 +466,7 @@ "tag": { "terms": { "field": "tag", - "size": 100 + "size": 0 } } } @@ -502,7 +502,7 @@ "submitted_via": { "terms": { "field": "submitted_via", - "size": 100 + "size": 0 } } } diff --git a/complaint_search/tests/expected_results/search_with_max_date__valid.json b/complaint_search/tests/expected_results/search_with_max_date__valid.json index f835bd73..7805d583 100644 --- a/complaint_search/tests/expected_results/search_with_max_date__valid.json +++ b/complaint_search/tests/expected_results/search_with_max_date__valid.json @@ -50,7 +50,7 @@ "has_narratives": { "terms": { "field": "has_narratives", - "size": 10 + "size": 0 } } } @@ -73,7 +73,7 @@ "company": { "terms": { "field": "company", - "size": 10000 + "size": 0 } } } @@ -96,13 +96,13 @@ "product": { "terms": { "field": "product.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_product.raw": { "terms": { "field": "sub_product.raw", - "size": 10000 + "size": 0 } } } @@ -127,13 +127,13 @@ "issue": { "terms": { "field": "issue.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_issue.raw": { "terms": { "field": "sub_issue.raw", - "size": 10000 + "size": 0 } } } @@ -158,7 +158,7 @@ "state": { "terms": { "field": "state", - "size": 50 + "size": 0 } } } @@ -181,7 +181,7 @@ "zip_code": { "terms": { "field": "zip_code", - "size": 1000 + "size": 0 } } } @@ -204,7 +204,7 @@ "timely": { "terms": { "field": "timely", - "size": 10 + "size": 0 } } } @@ -227,7 +227,7 @@ "company_response": { "terms": { "field": "company_response", - "size": 100 + "size": 0 } } } @@ -250,7 +250,7 @@ "company_public_response": { "terms": { "field": "company_public_response.raw", - "size": 100 + "size": 0 } } } @@ -273,7 +273,7 @@ "consumer_disputed": { "terms": { "field": "consumer_disputed.raw", - "size": 100 + "size": 0 } } } @@ -296,7 +296,7 @@ "consumer_consent_provided": { "terms": { "field": "consumer_consent_provided.raw", - "size": 100 + "size": 0 } } } @@ -319,7 +319,7 @@ "tag": { "terms": { "field": "tag", - "size": 100 + "size": 0 } } } @@ -342,7 +342,7 @@ "submitted_via": { "terms": { "field": "submitted_via", - "size": 100 + "size": 0 } } } diff --git a/complaint_search/tests/expected_results/search_with_min_date__valid.json b/complaint_search/tests/expected_results/search_with_min_date__valid.json index 6c83bf64..264ca1e1 100644 --- a/complaint_search/tests/expected_results/search_with_min_date__valid.json +++ b/complaint_search/tests/expected_results/search_with_min_date__valid.json @@ -50,7 +50,7 @@ "has_narratives": { "terms": { "field": "has_narratives", - "size": 10 + "size": 0 } } } @@ -73,7 +73,7 @@ "company": { "terms": { "field": "company", - "size": 10000 + "size": 0 } } } @@ -96,13 +96,13 @@ "product": { "terms": { "field": "product.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_product.raw": { "terms": { "field": "sub_product.raw", - "size": 10000 + "size": 0 } } } @@ -127,13 +127,13 @@ "issue": { "terms": { "field": "issue.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_issue.raw": { "terms": { "field": "sub_issue.raw", - "size": 10000 + "size": 0 } } } @@ -158,7 +158,7 @@ "state": { "terms": { "field": "state", - "size": 50 + "size": 0 } } } @@ -181,7 +181,7 @@ "zip_code": { "terms": { "field": "zip_code", - "size": 1000 + "size": 0 } } } @@ -204,7 +204,7 @@ "timely": { "terms": { "field": "timely", - "size": 10 + "size": 0 } } } @@ -227,7 +227,7 @@ "company_response": { "terms": { "field": "company_response", - "size": 100 + "size": 0 } } } @@ -250,7 +250,7 @@ "company_public_response": { "terms": { "field": "company_public_response.raw", - "size": 100 + "size": 0 } } } @@ -273,7 +273,7 @@ "consumer_disputed": { "terms": { "field": "consumer_disputed.raw", - "size": 100 + "size": 0 } } } @@ -296,7 +296,7 @@ "consumer_consent_provided": { "terms": { "field": "consumer_consent_provided.raw", - "size": 100 + "size": 0 } } } @@ -319,7 +319,7 @@ "tag": { "terms": { "field": "tag", - "size": 100 + "size": 0 } } } @@ -342,7 +342,7 @@ "submitted_via": { "terms": { "field": "submitted_via", - "size": 100 + "size": 0 } } } 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 6f0fda73..e2d83099 100644 --- a/complaint_search/tests/expected_results/search_with_product__valid.json +++ b/complaint_search/tests/expected_results/search_with_product__valid.json @@ -73,7 +73,7 @@ "has_narratives": { "terms": { "field": "has_narratives", - "size": 10 + "size": 0 } } } @@ -110,7 +110,7 @@ "company": { "terms": { "field": "company", - "size": 10000 + "size": 0 } } } @@ -131,13 +131,13 @@ "product": { "terms": { "field": "product.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_product.raw": { "terms": { "field": "sub_product.raw", - "size": 10000 + "size": 0 } } } @@ -176,13 +176,13 @@ "issue": { "terms": { "field": "issue.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_issue.raw": { "terms": { "field": "sub_issue.raw", - "size": 10000 + "size": 0 } } } @@ -221,7 +221,7 @@ "state": { "terms": { "field": "state", - "size": 50 + "size": 0 } } } @@ -258,7 +258,7 @@ "zip_code": { "terms": { "field": "zip_code", - "size": 1000 + "size": 0 } } } @@ -295,7 +295,7 @@ "timely": { "terms": { "field": "timely", - "size": 10 + "size": 0 } } } @@ -332,7 +332,7 @@ "company_response": { "terms": { "field": "company_response", - "size": 100 + "size": 0 } } } @@ -369,7 +369,7 @@ "company_public_response": { "terms": { "field": "company_public_response.raw", - "size": 100 + "size": 0 } } } @@ -406,7 +406,7 @@ "consumer_disputed": { "terms": { "field": "consumer_disputed.raw", - "size": 100 + "size": 0 } } } @@ -443,7 +443,7 @@ "consumer_consent_provided": { "terms": { "field": "consumer_consent_provided.raw", - "size": 100 + "size": 0 } } } @@ -480,7 +480,7 @@ "tag": { "terms": { "field": "tag", - "size": 100 + "size": 0 } } } @@ -517,7 +517,7 @@ "submitted_via": { "terms": { "field": "submitted_via", - "size": 100 + "size": 0 } } } diff --git a/complaint_search/tests/expected_results/search_with_search_term__valid.json b/complaint_search/tests/expected_results/search_with_search_term__valid.json index 9dbade8a..9b74d4a7 100644 --- a/complaint_search/tests/expected_results/search_with_search_term__valid.json +++ b/complaint_search/tests/expected_results/search_with_search_term__valid.json @@ -35,7 +35,7 @@ "has_narratives": { "terms": { "field": "has_narratives", - "size": 10 + "size": 0 } } } @@ -56,7 +56,7 @@ "company": { "terms": { "field": "company", - "size": 10000 + "size": 0 } } } @@ -77,13 +77,13 @@ "product": { "terms": { "field": "product.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_product.raw": { "terms": { "field": "sub_product.raw", - "size": 10000 + "size": 0 } } } @@ -106,13 +106,13 @@ "issue": { "terms": { "field": "issue.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_issue.raw": { "terms": { "field": "sub_issue.raw", - "size": 10000 + "size": 0 } } } @@ -135,7 +135,7 @@ "state": { "terms": { "field": "state", - "size": 50 + "size": 0 } } } @@ -156,7 +156,7 @@ "zip_code": { "terms": { "field": "zip_code", - "size": 1000 + "size": 0 } } } @@ -177,7 +177,7 @@ "timely": { "terms": { "field": "timely", - "size": 10 + "size": 0 } } } @@ -198,7 +198,7 @@ "company_response": { "terms": { "field": "company_response", - "size": 100 + "size": 0 } } } @@ -219,7 +219,7 @@ "company_public_response": { "terms": { "field": "company_public_response.raw", - "size": 100 + "size": 0 } } } @@ -240,7 +240,7 @@ "consumer_disputed": { "terms": { "field": "consumer_disputed.raw", - "size": 100 + "size": 0 } } } @@ -261,7 +261,7 @@ "consumer_consent_provided": { "terms": { "field": "consumer_consent_provided.raw", - "size": 100 + "size": 0 } } } @@ -282,7 +282,7 @@ "tag": { "terms": { "field": "tag", - "size": 100 + "size": 0 } } } @@ -303,7 +303,7 @@ "submitted_via": { "terms": { "field": "submitted_via", - "size": 100 + "size": 0 } } } 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 d230ad86..32c9f298 100644 --- a/complaint_search/tests/expected_results/search_with_size__valid.json +++ b/complaint_search/tests/expected_results/search_with_size__valid.json @@ -36,7 +36,7 @@ "has_narratives": { "terms": { "field": "has_narratives", - "size": 10 + "size": 0 } } } @@ -57,7 +57,7 @@ "company": { "terms": { "field": "company", - "size": 10000 + "size": 0 } } } @@ -78,13 +78,13 @@ "product": { "terms": { "field": "product.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_product.raw": { "terms": { "field": "sub_product.raw", - "size": 10000 + "size": 0 } } } @@ -107,13 +107,13 @@ "issue": { "terms": { "field": "issue.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_issue.raw": { "terms": { "field": "sub_issue.raw", - "size": 10000 + "size": 0 } } } @@ -136,7 +136,7 @@ "state": { "terms": { "field": "state", - "size": 50 + "size": 0 } } } @@ -157,7 +157,7 @@ "zip_code": { "terms": { "field": "zip_code", - "size": 1000 + "size": 0 } } } @@ -178,7 +178,7 @@ "timely": { "terms": { "field": "timely", - "size": 10 + "size": 0 } } } @@ -199,7 +199,7 @@ "company_response": { "terms": { "field": "company_response", - "size": 100 + "size": 0 } } } @@ -220,7 +220,7 @@ "company_public_response": { "terms": { "field": "company_public_response.raw", - "size": 100 + "size": 0 } } } @@ -241,7 +241,7 @@ "consumer_disputed": { "terms": { "field": "consumer_disputed.raw", - "size": 100 + "size": 0 } } } @@ -262,7 +262,7 @@ "consumer_consent_provided": { "terms": { "field": "consumer_consent_provided.raw", - "size": 100 + "size": 0 } } } @@ -283,7 +283,7 @@ "tag": { "terms": { "field": "tag", - "size": 100 + "size": 0 } } } @@ -304,7 +304,7 @@ "submitted_via": { "terms": { "field": "submitted_via", - "size": 100 + "size": 0 } } } 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 d8d720d0..3cbde39d 100644 --- a/complaint_search/tests/expected_results/search_with_sort__valid.json +++ b/complaint_search/tests/expected_results/search_with_sort__valid.json @@ -35,7 +35,7 @@ "has_narratives": { "terms": { "field": "has_narratives", - "size": 10 + "size": 0 } } } @@ -56,7 +56,7 @@ "company": { "terms": { "field": "company", - "size": 10000 + "size": 0 } } } @@ -77,13 +77,13 @@ "product": { "terms": { "field": "product.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_product.raw": { "terms": { "field": "sub_product.raw", - "size": 10000 + "size": 0 } } } @@ -106,13 +106,13 @@ "issue": { "terms": { "field": "issue.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_issue.raw": { "terms": { "field": "sub_issue.raw", - "size": 10000 + "size": 0 } } } @@ -135,7 +135,7 @@ "state": { "terms": { "field": "state", - "size": 50 + "size": 0 } } } @@ -156,7 +156,7 @@ "zip_code": { "terms": { "field": "zip_code", - "size": 1000 + "size": 0 } } } @@ -177,7 +177,7 @@ "timely": { "terms": { "field": "timely", - "size": 10 + "size": 0 } } } @@ -198,7 +198,7 @@ "company_response": { "terms": { "field": "company_response", - "size": 100 + "size": 0 } } } @@ -219,7 +219,7 @@ "company_public_response": { "terms": { "field": "company_public_response.raw", - "size": 100 + "size": 0 } } } @@ -240,7 +240,7 @@ "consumer_disputed": { "terms": { "field": "consumer_disputed.raw", - "size": 100 + "size": 0 } } } @@ -261,7 +261,7 @@ "consumer_consent_provided": { "terms": { "field": "consumer_consent_provided.raw", - "size": 100 + "size": 0 } } } @@ -282,7 +282,7 @@ "tag": { "terms": { "field": "tag", - "size": 100 + "size": 0 } } } @@ -303,7 +303,7 @@ "submitted_via": { "terms": { "field": "submitted_via", - "size": 100 + "size": 0 } } } 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 d1822833..9f7092f4 100644 --- a/complaint_search/tests/expected_results/search_with_state__valid.json +++ b/complaint_search/tests/expected_results/search_with_state__valid.json @@ -57,7 +57,7 @@ "has_narratives": { "terms": { "field": "has_narratives", - "size": 10 + "size": 0 } } } @@ -87,7 +87,7 @@ "company": { "terms": { "field": "company", - "size": 10000 + "size": 0 } } } @@ -117,13 +117,13 @@ "product": { "terms": { "field": "product.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_product.raw": { "terms": { "field": "sub_product.raw", - "size": 10000 + "size": 0 } } } @@ -155,13 +155,13 @@ "issue": { "terms": { "field": "issue.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_issue.raw": { "terms": { "field": "sub_issue.raw", - "size": 10000 + "size": 0 } } } @@ -184,7 +184,7 @@ "state": { "terms": { "field": "state", - "size": 50 + "size": 0 } } } @@ -214,7 +214,7 @@ "zip_code": { "terms": { "field": "zip_code", - "size": 1000 + "size": 0 } } } @@ -244,7 +244,7 @@ "timely": { "terms": { "field": "timely", - "size": 10 + "size": 0 } } } @@ -274,7 +274,7 @@ "company_response": { "terms": { "field": "company_response", - "size": 100 + "size": 0 } } } @@ -304,7 +304,7 @@ "company_public_response": { "terms": { "field": "company_public_response.raw", - "size": 100 + "size": 0 } } } @@ -334,7 +334,7 @@ "consumer_disputed": { "terms": { "field": "consumer_disputed.raw", - "size": 100 + "size": 0 } } } @@ -364,7 +364,7 @@ "consumer_consent_provided": { "terms": { "field": "consumer_consent_provided.raw", - "size": 100 + "size": 0 } } } @@ -394,7 +394,7 @@ "tag": { "terms": { "field": "tag", - "size": 100 + "size": 0 } } } @@ -424,7 +424,7 @@ "submitted_via": { "terms": { "field": "submitted_via", - "size": 100 + "size": 0 } } } 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 33e316d0..2dd99306 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 @@ -55,7 +55,7 @@ "has_narratives": { "terms": { "field": "has_narratives", - "size": 10 + "size": 0 } } } @@ -84,7 +84,7 @@ "company": { "terms": { "field": "company", - "size": 10000 + "size": 0 } } } @@ -113,13 +113,13 @@ "product": { "terms": { "field": "product.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_product.raw": { "terms": { "field": "sub_product.raw", - "size": 10000 + "size": 0 } } } @@ -150,13 +150,13 @@ "issue": { "terms": { "field": "issue.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_issue.raw": { "terms": { "field": "sub_issue.raw", - "size": 10000 + "size": 0 } } } @@ -187,7 +187,7 @@ "state": { "terms": { "field": "state", - "size": 50 + "size": 0 } } } @@ -216,7 +216,7 @@ "zip_code": { "terms": { "field": "zip_code", - "size": 1000 + "size": 0 } } } @@ -245,7 +245,7 @@ "timely": { "terms": { "field": "timely", - "size": 10 + "size": 0 } } } @@ -274,7 +274,7 @@ "company_response": { "terms": { "field": "company_response", - "size": 100 + "size": 0 } } } @@ -303,7 +303,7 @@ "company_public_response": { "terms": { "field": "company_public_response.raw", - "size": 100 + "size": 0 } } } @@ -332,7 +332,7 @@ "consumer_disputed": { "terms": { "field": "consumer_disputed.raw", - "size": 100 + "size": 0 } } } @@ -361,7 +361,7 @@ "consumer_consent_provided": { "terms": { "field": "consumer_consent_provided.raw", - "size": 100 + "size": 0 } } } @@ -390,7 +390,7 @@ "tag": { "terms": { "field": "tag", - "size": 100 + "size": 0 } } } @@ -411,7 +411,7 @@ "submitted_via": { "terms": { "field": "submitted_via", - "size": 100 + "size": 0 } } } diff --git a/complaint_search/tests/expected_results/search_with_tag__valid.json b/complaint_search/tests/expected_results/search_with_tag__valid.json index e713ac7f..45dae47f 100644 --- a/complaint_search/tests/expected_results/search_with_tag__valid.json +++ b/complaint_search/tests/expected_results/search_with_tag__valid.json @@ -55,7 +55,7 @@ "has_narratives": { "terms": { "field": "has_narratives", - "size": 10 + "size": 0 } } } @@ -84,7 +84,7 @@ "company": { "terms": { "field": "company", - "size": 10000 + "size": 0 } } } @@ -113,13 +113,13 @@ "product": { "terms": { "field": "product.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_product.raw": { "terms": { "field": "sub_product.raw", - "size": 10000 + "size": 0 } } } @@ -150,13 +150,13 @@ "issue": { "terms": { "field": "issue.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_issue.raw": { "terms": { "field": "sub_issue.raw", - "size": 10000 + "size": 0 } } } @@ -187,7 +187,7 @@ "state": { "terms": { "field": "state", - "size": 50 + "size": 0 } } } @@ -216,7 +216,7 @@ "zip_code": { "terms": { "field": "zip_code", - "size": 1000 + "size": 0 } } } @@ -245,7 +245,7 @@ "timely": { "terms": { "field": "timely", - "size": 10 + "size": 0 } } } @@ -274,7 +274,7 @@ "company_response": { "terms": { "field": "company_response", - "size": 100 + "size": 0 } } } @@ -303,7 +303,7 @@ "company_public_response": { "terms": { "field": "company_public_response.raw", - "size": 100 + "size": 0 } } } @@ -332,7 +332,7 @@ "consumer_disputed": { "terms": { "field": "consumer_disputed.raw", - "size": 100 + "size": 0 } } } @@ -361,7 +361,7 @@ "consumer_consent_provided": { "terms": { "field": "consumer_consent_provided.raw", - "size": 100 + "size": 0 } } } @@ -382,7 +382,7 @@ "tag": { "terms": { "field": "tag", - "size": 100 + "size": 0 } } } @@ -411,7 +411,7 @@ "submitted_via": { "terms": { "field": "submitted_via", - "size": 100 + "size": 0 } } } 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 33a89cee..80dcb3e7 100644 --- a/complaint_search/tests/expected_results/search_with_timely__valid.json +++ b/complaint_search/tests/expected_results/search_with_timely__valid.json @@ -55,7 +55,7 @@ "has_narratives": { "terms": { "field": "has_narratives", - "size": 10 + "size": 0 } } } @@ -84,7 +84,7 @@ "company": { "terms": { "field": "company", - "size": 10000 + "size": 0 } } } @@ -113,13 +113,13 @@ "product": { "terms": { "field": "product.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_product.raw": { "terms": { "field": "sub_product.raw", - "size": 10000 + "size": 0 } } } @@ -150,13 +150,13 @@ "issue": { "terms": { "field": "issue.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_issue.raw": { "terms": { "field": "sub_issue.raw", - "size": 10000 + "size": 0 } } } @@ -187,7 +187,7 @@ "state": { "terms": { "field": "state", - "size": 50 + "size": 0 } } } @@ -216,7 +216,7 @@ "zip_code": { "terms": { "field": "zip_code", - "size": 1000 + "size": 0 } } } @@ -237,7 +237,7 @@ "timely": { "terms": { "field": "timely", - "size": 10 + "size": 0 } } } @@ -266,7 +266,7 @@ "company_response": { "terms": { "field": "company_response", - "size": 100 + "size": 0 } } } @@ -295,7 +295,7 @@ "company_public_response": { "terms": { "field": "company_public_response.raw", - "size": 100 + "size": 0 } } } @@ -324,7 +324,7 @@ "consumer_disputed": { "terms": { "field": "consumer_disputed.raw", - "size": 100 + "size": 0 } } } @@ -353,7 +353,7 @@ "consumer_consent_provided": { "terms": { "field": "consumer_consent_provided.raw", - "size": 100 + "size": 0 } } } @@ -382,7 +382,7 @@ "tag": { "terms": { "field": "tag", - "size": 100 + "size": 0 } } } @@ -411,7 +411,7 @@ "submitted_via": { "terms": { "field": "submitted_via", - "size": 100 + "size": 0 } } } 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 3130ee28..5851f432 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 @@ -57,7 +57,7 @@ "has_narratives": { "terms": { "field": "has_narratives", - "size": 10 + "size": 0 } } } @@ -87,7 +87,7 @@ "company": { "terms": { "field": "company", - "size": 10000 + "size": 0 } } } @@ -117,13 +117,13 @@ "product": { "terms": { "field": "product.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_product.raw": { "terms": { "field": "sub_product.raw", - "size": 10000 + "size": 0 } } } @@ -155,13 +155,13 @@ "issue": { "terms": { "field": "issue.raw", - "size": 10000 + "size": 0 }, "aggs": { "sub_issue.raw": { "terms": { "field": "sub_issue.raw", - "size": 10000 + "size": 0 } } } @@ -193,7 +193,7 @@ "state": { "terms": { "field": "state", - "size": 50 + "size": 0 } } } @@ -214,7 +214,7 @@ "zip_code": { "terms": { "field": "zip_code", - "size": 1000 + "size": 0 } } } @@ -244,7 +244,7 @@ "timely": { "terms": { "field": "timely", - "size": 10 + "size": 0 } } } @@ -274,7 +274,7 @@ "company_response": { "terms": { "field": "company_response", - "size": 100 + "size": 0 } } } @@ -304,7 +304,7 @@ "company_public_response": { "terms": { "field": "company_public_response.raw", - "size": 100 + "size": 0 } } } @@ -334,7 +334,7 @@ "consumer_disputed": { "terms": { "field": "consumer_disputed.raw", - "size": 100 + "size": 0 } } } @@ -364,7 +364,7 @@ "consumer_consent_provided": { "terms": { "field": "consumer_consent_provided.raw", - "size": 100 + "size": 0 } } } @@ -394,7 +394,7 @@ "tag": { "terms": { "field": "tag", - "size": 100 + "size": 0 } } } @@ -424,7 +424,7 @@ "submitted_via": { "terms": { "field": "submitted_via", - "size": 100 + "size": 0 } } } diff --git a/complaint_search/tests/test_views_search.py b/complaint_search/tests/test_views_search.py index e05d610b..3c8a6193 100644 --- a/complaint_search/tests/test_views_search.py +++ b/complaint_search/tests/test_views_search.py @@ -310,6 +310,30 @@ def test_search_with_state__valid(self, mock_essearch): **{"state": ["CA", "FL", "VA"]}) self.assertEqual('OK', response.data) + @mock.patch('complaint_search.es_interface.search') + def test_search_with_zip_code__valid(self, mock_essearch): + url = reverse('complaint_search:search') + url += "?zip_code=94XXX&zip_code=24236&zip_code=23456" + 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( + **{"zip_code": ["94XXX", "24236", "23456"]}) + self.assertEqual('OK', response.data) + + @mock.patch('complaint_search.es_interface.search') + def test_search_with_timely__valid(self, mock_essearch): + url = reverse('complaint_search:search') + url += "?timely=YES&timely=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( + **{"timely": ["YES", "NO"]}) + 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') @@ -334,6 +358,66 @@ def test_search_with_company_response__valid(self, mock_essearch): **{"company_response": ["Closed", "No response"]}) self.assertEqual('OK', response.data) + @mock.patch('complaint_search.es_interface.search') + def test_search_with_company_public_response__valid(self, mock_essearch): + url = reverse('complaint_search:search') + url += "?company_public_response=Closed&company_public_response=No%20response" + 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( + **{"company_public_response": ["Closed", "No response"]}) + 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( + **{"consumer_consent_provided": ["Yes", "No"]}) + self.assertEqual('OK', response.data) + + @mock.patch('complaint_search.es_interface.search') + def test_search_with_has_narratives__valid(self, mock_essearch): + url = reverse('complaint_search:search') + url += "?has_narratives=Yes&has_narratives=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( + **{"has_narratives": ["Yes", "No"]}) + self.assertEqual('OK', response.data) + + @mock.patch('complaint_search.es_interface.search') + def test_search_with_submitted_via__valid(self, mock_essearch): + url = reverse('complaint_search:search') + url += "?submitted_via=Web&submitted_via=Phone" + 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( + **{"submitted_via": ["Web", "Phone"]}) + self.assertEqual('OK', response.data) + + @mock.patch('complaint_search.es_interface.search') + def test_search_with_tag__valid(self, mock_essearch): + url = reverse('complaint_search:search') + url += "?tag=Older%20American&tag=Servicemember" + 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( + **{"tag": ["Older American", "Servicemember"]}) + self.assertEqual('OK', response.data) + @mock.patch('complaint_search.es_interface.search') def test_search__transport_error_with_status_code(self, mock_essearch): mock_essearch.side_effect = TransportError(status.HTTP_404_NOT_FOUND, "Error")