Skip to content

Commit

Permalink
[Issue #3183] Make search facets for agencies return more than 25 age…
Browse files Browse the repository at this point in the history
…ncies (#3273)

## Summary
Fixes #3183

### Time to review: __3 mins__

## Changes proposed
Modify the search facet count logic to allow up to 1000 unique agencies
in response

## Context for reviewers
By default we configured the size to be 25 arbitrarily. There are about
700 agencies with opportunities in prod, so configured a number a bit
above that for now.

We might want to consider allowing the user of the API to specify the
facets they want in the future.

## Additional information
I loaded a lot of opportunities into the search index, and the response
for facet counts now has all of the agencies we have configured locally
with is about 80.
  • Loading branch information
chouinar authored Dec 18, 2024
1 parent f315e3b commit 3ecdc32
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/src/services/opportunities_v1/search_opportunities.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def _add_aggregations(builder: search.SearchQueryBuilder) -> None:
builder.aggregation_terms("applicant_type", _adjust_field_name("applicant_type"))
builder.aggregation_terms("funding_instrument", _adjust_field_name("funding_instrument"))
builder.aggregation_terms("funding_category", _adjust_field_name("funding_category"))
builder.aggregation_terms("agency", _adjust_field_name("agency_code"))
builder.aggregation_terms("agency", _adjust_field_name("agency_code"), size=1000)


def _get_search_request(params: SearchOpportunityParams) -> dict:
Expand Down

0 comments on commit 3ecdc32

Please sign in to comment.