iDigBio / idigbio-search-api

Server-side code driving iDigBio's search functionality.
GNU General Public License v3.0
24 stars 5 forks source link

throws 500 error because of missing properties doc_count value #37

Closed wilsotc closed 5 years ago

wilsotc commented 5 years ago

For an institution code query, a 500 error is returned because of a missing object property that is no longer used. curl 'http://beta-search.idigbio.org/v2/mapping/' -H 'Accept: application/json, text/javascript, /; q=0.01' -H 'Referer: http://beta.idigbio.org/portal/search' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36' -H 'Sec-Fetch-Mode: cors' -H 'Content-Type: application/json' --data-binary '{"rq":{"institutioncode":"a"},"type":"auto","threshold":100000}' --compressed {"error":"Cannot read property 'doc_count' of undefined"}

wilsotc commented 5 years ago

https://github.com/iDigBio/idigbio-search-api/commit/b15284de665874a5a27812c676907be145a39e14 The sd property appears to be "species diversity" within each geohash. Elasticsearch seems to ignore this aggregation.