|
37 | 37 | "dct_creator_sm", |
38 | 38 | "schema_provider_s", |
39 | 39 | "dct_accessRights_s", |
| 40 | + "geo_country", |
| 41 | + "geo_region", |
| 42 | + "geo_county", |
40 | 43 | } |
41 | 44 |
|
42 | 45 |
|
@@ -98,15 +101,15 @@ def get_facet_aggregation_config(facet_name: str) -> dict: |
98 | 101 | "size": DEFAULT_FACET_SIZE, |
99 | 102 | }, |
100 | 103 | "geo_country": { |
101 | | - "field": "geo_country", |
| 104 | + "field": "geo_country.keyword", |
102 | 105 | "size": GEO_COUNTRY_FACET_SIZE, |
103 | 106 | }, |
104 | 107 | "geo_region": { |
105 | | - "field": "geo_region", |
| 108 | + "field": "geo_region.keyword", |
106 | 109 | "size": GEO_REGION_FACET_SIZE, |
107 | 110 | }, |
108 | 111 | "geo_county": { |
109 | | - "field": "geo_county", |
| 112 | + "field": "geo_county.keyword", |
110 | 113 | "size": GEO_COUNTY_FACET_SIZE, |
111 | 114 | }, |
112 | 115 | } |
@@ -536,9 +539,10 @@ async def search_resources( |
536 | 539 | "terms": {"field": "gbl_georeferenced_b", "size": DEFAULT_FACET_SIZE} |
537 | 540 | }, |
538 | 541 | # Spatial facet aggregations with configurable sizes |
539 | | - "geo_country": {"terms": {"field": "geo_country", "size": GEO_COUNTRY_FACET_SIZE}}, |
540 | | - "geo_region": {"terms": {"field": "geo_region", "size": GEO_REGION_FACET_SIZE}}, |
541 | | - "geo_county": {"terms": {"field": "geo_county", "size": GEO_COUNTY_FACET_SIZE}}, |
| 542 | + # Note: These fields are text with keyword subfields in the actual index |
| 543 | + "geo_country": {"terms": {"field": "geo_country.keyword", "size": GEO_COUNTRY_FACET_SIZE}}, |
| 544 | + "geo_region": {"terms": {"field": "geo_region.keyword", "size": GEO_REGION_FACET_SIZE}}, |
| 545 | + "geo_county": {"terms": {"field": "geo_county.keyword", "size": GEO_COUNTY_FACET_SIZE}}, |
542 | 546 | } |
543 | 547 |
|
544 | 548 | selected_aggs = ( |
|
0 commit comments