Constructing REST API Queries

Voyager supports a REST-based Query API. See Using Voyager's REST API for an introduction.

Note: These APIs are subject to change with each software release for the purpose of incorporating improvements in system design, performance, and new software features. Specifically, field names (type information) are often modified to reflect changes in the types of information indexed. For the current API information, contact support@voyagersearch.com.

JSON and XML Response Formats

API queries can return information in either JSON or XML format (XML is the default).

  • The following query returns content from the index in JSON format:

    http://localhost:8888/solr/v0/select?q=roads&wt=json
  • This query returns information in XML format:

    http://localhost:8888/solr/v0/select?q=roads&wt=xml

Query Components

You can specify queries for text strings, spatial extent or filters:

  • Text Query:
    ?q=vegas

  • Spatial Extent:?q=bbox:"IsWithin(-118.3228 32.0174 \-115.1807 33.9160)"

  • Filter:?q=subtype:Raster

Additional parameters:

  • Number of Rows Returned:
    &rows=10

  • Specific Field Information (as opposed to all fields):
    &fl=name,id

Query Examples

  • The following query returns all items matching the text query for “roads” and returns only the “name” and “id” fields in JSON format limited to the first 10 records:

    http://localhost:8888/solr/v0/select?q=roads&fl=name,id&wt=json&rows=10
  • Once search results are returned, you can query Voyager for additional information such as an items thumbnail where a5594bd7ca6e257b is the ID of the item:

  • You can use the ID to obtain a direct link to the detailed search result page:

  • You can use the ID to return a detailed XML representation for the item: