Talk:IDigBio API: Difference between revisions

add more content
(add more content)
Line 211: Line 211:
== Searching iDigBio ==
== Searching iDigBio ==


While iDigBio does not currently provide Search API endpoints to faciliate queries via the API, we do offer direct access to the backend Elasticsearch index servers.
At this time the recommended method for searching iDigBio is to use the Portal search, not the API. The portal also provides bulk download capabilities for aquiring larger sets of data.  See: https://www.idigbio.org/portal
 
The iDigBio API does not currently (yet!) provide query/search capabilities.  However, the back-end Elasticsearch interface is public-facing and available for use by advanced users and programmers. This is the same interface that is used by the iDigBio Portal search.


'''Direct queries to the iDigBio Elasticsearch service should be considered an Advanced operation.'''
'''Direct queries to the iDigBio Elasticsearch service should be considered an Advanced operation.'''


=== Elasticsearch Overview ===
An overview of Elasticsearch: http://www.elasticsearch.org/overview/elasticsearch/
 
Elasticsearch provides Lucene-style indexes for querying which return JSON formatted data. This is the same interface that is used by the iDigBio Portal search to query Elasticsearch.
 
More information about querying an Elastic Search server can be found at: http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/query-dsl.html
 
The iDigBio Elasticsearch service is accessed via a base URL combined with the query specificiation. The indexes provide two document types to query on; Records and Media Records.


The search base URL is:
The iDigBio search index provides two document types to query on: Records and Media Records. Search results are returned as JSON-formatted documents. Each type can be queried through the following respective URLs:


https://search.idigbio.org/
{| class="wikitable"
!Query Type
!Search URL
|-
|Records
|https://search.idigbio.org/idigbio/records/_search
|-
|Media Records
|https://search.idigbio.org/idigbio/mediarecords/_search
|}


=== Elasticsearch records ===
See the [[iDigBio API Examples]] page for Elasticsearch examples that are specific to iDigBio.


https://search.idigbio.org/idigbio/records/_search
=== Elasticsearch - Records ===


Available fields:
Useful parameters for '''Records'' queries to Elasticsearch:


<pre>
<pre>
Line 289: Line 294:
TODO: include something about hasImage, scientificname
TODO: include something about hasImage, scientificname


=== Elasticsearch mediarecords ===
=== Elasticsearch - Media Records ===


https://search.idigbio.org/idigbio/mediarecords/_search
https://search.idigbio.org/idigbio/mediarecords/_search
There are no useful parameters for '''Media Records''' queries using Elasticsearch at this time.


Sample query:
Sample query:
1,554

edits