luomus / laji

Frontend for Finnish Biodiversity Information Facility (FinBIF) data portal laji.fi (and other *.laji.fi frontends)
MIT License
7 stars 0 forks source link

Improve performance of front page taxon search occurrence count #651

Open mikkohei13 opened 3 weeks ago

mikkohei13 commented 3 weeks ago

Currently when you type something to taxon field like "kott" then you click through the results, for each time it does query

GET https://laji.fi/api/warehouse/query/count?taxonId=MX.73070&cache=true

This data is available from taxon endpoint: GET https://laji.fi/api/taxa/MX.73070?selectedFields=occurrenceCount

The later is much more performant than doing Data Warehouse query