News and updates
- 2020-11-11: Updated
- 2019-07-18: Initial version
General
- All parameter names are case sensitive. Parameter values are not case sensitive.
- Search supports application/json media type only.
Introduction UPDATED
CDISC Library maintains an index. Index is a collection of multiple document types. A document type is comprised of related metadata, or fields. Certain fields are pre-aggregated with a list of unique values to aid filtering or subsetting. The search API performs searches against this index. This strategy allows searches to be completed very efficiently, with most requests in less than 500 ms.
Note, CDISC Library uses Microsoft Cognitive Search as the search engine as of the 2020-11-11 release. Technical explanations such as query expressions, filters, and syntax alike can be found in the Technical References section below.
Technical References NEW
- Query types and composition in Azure Cognitive Search: https://docs.microsoft.com/en-us/azure/search/search-query-overview
- Lucene query parser syntax for constructing search queries: https://lucene.apache.org/core/6_6_1/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#N10013
- Lucene query operators for constructing search queries: https://lucene.apache.org/core/6_6_1/queryparser/org/apache/lucene/queryparser/simple/SimpleQueryParser.html
- Filter syntax to be used in search queries: https://docs.microsoft.com/en-us/azure/search/search-filters
- Hit highlighting to work with search results: https://docs.microsoft.com/en-us/azure/search/search-pagination-page-layout#hit-highlighting
Basic Construct
The basic construct of a search API request is /mdr/search?q={searchExpression}&{scope}={scopeExpression}
, where:
Parameter | Description | Cardinality |
---|---|---|
q={searchExpression}
| Search expression to use in the query. | 1 |
{scope}={scopeEexpression}
| The search scope and expression to filter against. | 0..* |
Response
This section summarizes how the API would respond for each scenario listed.
Scenario | Status code | Remarks |
---|---|---|
Valid query with no matches | 200 Ok | UPDATED The API returns a response, in JSON format as follows: { "hasMore": false, "hits": [], "totalHits": 0 } |
Valid query with at least one match | 200 Ok | The API returns a result set in JSON format. Each instance of matches will be in the hits element. The number of matches will appear in the totalHits element. Paging is supported. |
Invalid query | 400 Bad Request | This includes, but not limited to, missing required parameter, malformed URL, and invalid paging. User should review the |
Search Expression UPDATED
A search expression {searchExpression}
is a series of of terms and operators. It may be one of the following:
Expression type | Example | Remarks |
---|---|---|
Single term | q=treatment | Return entries from index where the term treatment appears. |
Multiple terms | q=date exposure treatment | Return entries from index where all the terms date exposure treatment appear in one document, regardless of word order. |
Refer to the the Technical References section for detailed explanations and examples.
Scopes
In general, scopes are pre-aggregated field terms for filtering or subsetting searches. An endpoint is available to obtain a list of scopes:
/mdr/search/scopes
Further, to obtain a list of pre-aggregated terms for each scope:
/mdr/search/scopes/{scope}
Example
Below is a sample response from /mdr/search/scopes/core
, where core
is one of the scopes, referring to the Core column in dataset specification tables in CDASH, SDTM, and ADaM products:
{ "hasMore": false, "total": 7, "values": [ "Conditionally Required", "Expected", "Highly Recommended", "Optional", "Permissible", "Recommended/Conditional", "Required" ] }
Scope Expression UPDATED
A scope expression {scopeExpression}
is a series of of terms and operators. It may be one of the following:
Expression type | Example | Remarks |
---|---|---|
Single term | q={searchExpression}&core=Recommended | Limit the search to entries in the index where core contains the term Recommended . |
Multiple terms |
q={searchExpression}&core=Conditionally%20Required | Limit the search to entries in the index where |
Refer to the the Technical References section for detailed explanations and examples.
Match Highlighting UPDATED
Highlighting is disabled by default.
It is possible to have highlights added to indicate what part of the index matched the search. The highlights appear as pairs in the JSON-formatted response returned. Client applications can consume and render additional visualization.
Parameter | Description | Cardinality |
---|---|---|
highlight={fieldList} || * | A list of fields to highlight where matches are found. To enable highlighting, set the value of highlight to a comma-separated list of field names that should have highlighting applied. To highlight all fields, use * as the field name. The API will insert an element to each match instance, name | 1 |
Refer to the the Technical References section for detailed explanations and examples.
Result Set Paging
Additional query parameters are available for paging. Paging is useful to limit and control the result set (or, hits) returned. By default, the API returns the first 100 hits. The total number of hits is at the end of a response.
Parameter | Description | Cardinality |
---|---|---|
start={startIndex}
| The initial result index to return, starting at 0. The default for
{startIndex}
is 0. | 0..1 |
pageSize={pageSize}
| The number of results to return, starting at
{startIndex}
. The default for
{pageSize}
is 100. | 0..1 |
Paging works for both searches and scope listings, as follows:
Application | API construct | Remarks |
---|---|---|
Searches |
/mdr/search?q={searchExpression}&{scope}={scopeEexpression}&start={startIndex}&pageSize={pageSize}
| The total number of hits appears at the end of the API response, regardless of page index |
Scope listings |
/mdr/search/scopes/{scope}&start={startIndex}&pageSize={pageSize}
|
Example
Listing SDTMIG v3.3 variables whose core is Required, returns the 51st to 100th matches, out of 344 hits in total:
q=&start=50&pageSize=50&product=SDTMIG%20v3.3&core=Required