1,554
edits
(change search query to limit size to 3 records) |
|||
Line 547: | Line 547: | ||
# "stateprovince" is equal to "Ohio" (there are multiple Fairfield counties throughout the world so we need to restrict the geography by state) | # "stateprovince" is equal to "Ohio" (there are multiple Fairfield counties throughout the world so we need to restrict the geography by state) | ||
The query parameter string will look something like this: | The essential query parameter string will look something like this: | ||
<pre> | <pre> | ||
Line 553: | Line 553: | ||
</pre> | </pre> | ||
In addition, it is possible to request more or fewer records at a time using the "from" and "size" parameters. Below is the full curl example requesting only the first 3 records and grep'ing out only the iDigBio GUID field. Note that we put the URL in quotes to keep the shell from trying to interpret it. | |||
<pre> | <pre> | ||
$ curl -s "http://search.idigbio.org/idigbio/records/_search?q=hasImage:true+AND+county:(fairfield+OR+hocking)+AND+stateprovince:ohio" | json_pp | egrep "\"uuid\"" | $ curl -s "http://search.idigbio.org/idigbio/records/_search?from=0&size=3&q=hasImage:true+AND+county:(fairfield+OR+hocking)+AND+stateprovince:ohio" | json_pp | egrep "\"uuid\"" | ||
"uuid" : "20ad60a8-4126-4cc0-9378-411a9a640005", | "uuid" : "20ad60a8-4126-4cc0-9378-411a9a640005", | ||
"uuid" : "ecf14f53-d225-4eb5-89e6-66379b360781", | "uuid" : "ecf14f53-d225-4eb5-89e6-66379b360781", | ||
"uuid" : "ff69483e-ab19-4fa7-9ca3-d99089280af6", | "uuid" : "ff69483e-ab19-4fa7-9ca3-d99089280af6", | ||
</pre> | </pre> | ||
edits