Term search
Supports the jQuery autocomplete function, returning an array of objects describing thesaurus terms that begin with, end with, or contain the given text. The match is not case sensitive.
Service URL |
https://apps.usgs.gov/thesaurus/term-search.php |
Parameters |
thcode |
Thesaurus identifier; if not specified, the USGS Thesaurus will be used. If specified as "any", the search will be carried out on all available thesauri. |
term |
Fragment of text to match candidate terms |
callback |
Name of a function in which to wrap the results, to support JSONP |
rel |
Relationship used to match the given term fragment to the thesaurus terms. All comparisons ignore letter case.
word |
(default) Text matches the beginning of any word in the thesaurus term |
begins |
Text matches the beginning of a thesaurus term |
contains |
Text occurs anywhere in a thesaurus term |
ends |
Text matches the end of a thesaurus term |
exact |
Text matches the thesaurus term exactly |
|
uf |
Set to zero to exclude non-preferred terms from the results |
|
Output |
An array of objects, each containing the following members:
thcode |
Unique identifier for the thesaurus (same as input thcode value) |
code |
Unique identifier for a term within the thesaurus |
label |
Text matching the input string, may be the non-preferred term |
value |
Descriptor text of the matched thesaurus term |
|
Special cases
-
If no term is given, the service returns an empty array:
https://apps.usgs.gov/thesaurus/term-search.php
-
If a percent sign is specified as the term, the service returns all of the terms in the given thesaurus alphabetically:
https://apps.usgs.gov/thesaurus/term-search.php?thcode=2&term=%
Example
(line breaks and extra spaces added here for clarity)
https://apps.usgs.gov/thesaurus/term-search.php?term=con