@@ -33,11 +34,10 @@ The request must have the following headers:
~~~
Authorization: Bearer {access_token}
Content-Type: application/json
data-partition-id: {partition}
data-partition-id: bootcamp
~~~
You should get the `access_token` as part of the authorization process <linkiscoming>.
Also the default `partition` is `opendes`.
You should get the access_token during authorization.
## Request body
...
...
@@ -59,7 +59,7 @@ The request body should contain a JSON-style query.
}
}
~~~
Note that all quotes are double-quotes, and that inner quotes must be escaped.
Note that all quotes are double-quotes, and that internal quotes must be escaped.
**Parameters**
...
...
@@ -74,10 +74,14 @@ The query body must contain `kind`; other parameters are optional.
| returnedFields | The fields on which to project the results. | "returnedFields": ["data.ResourceTypeID", "kind"] |
| aggregateBy | Groups results by the specified field. | "aggregateBy": "kind" |
| sort | Allows you to add one or more sorts on specific fields | "sort": {"field": ["kind"], "order":["DESC"]} |
| spatialFilter | Filters resources located in an area | |
| spatialFilter | Filters resources located in an area | See [below](#spatial-queries) |
## Queries
### Text indexing
When indexing data, OSDU Indexer service parse non-alphanumeric characters (dash, semicolon, etc.) as a space. In queries, such characters are also replaced by a space. So, the following text queries are equivalent: 'BIR-01' and 'BIR 01'.
### Text queries
The string to search for should be specified in the `query` parameter.
...
...
@@ -96,7 +100,9 @@ This request searches for fields which contain text 'A05'.
#### Wildcard
The API supports wildcard in text search. Use ? to replace a single character, and * to replace zero or more characters.
The API supports wildcard in text search. Use `?` to replace a single character, and `*` to replace zero or more characters. A query term cannot start with a wildcard.
> Note: Wildcard does not work with `UWI` and `UWBI`, since they are numeric fields.
**Examples**
...
...
@@ -114,9 +120,18 @@ The API supports wildcard in text search. Use ? to replace a single character, a
}
~~~
When querying a multi-term phase with a wildcard, use the [AND operator](#boolean-operators). E.g., the following query will find term 'BIR' and terms starting with zero: '0?':
~~~json
{
"kind":"opendes:osdu:*:*",
"query":"data.Data.IndividualTypeProperties.FacilityName:(BIR AND 0?)"
}
~~~
#### Field-match query
A field in the document can be searched by using `<field-name>:<value>`.
A field in the document can be searched by using `<field-name>:<value>`. To have several fields matched, use [Booleans](#boolean-operators).
String values with special characters such as `:` or `/` should be put in escaped quotes: `\"`.
...
...
@@ -147,6 +162,23 @@ Multiple terms or clauses can be grouped together with parentheses.
This request searches for master-data wells with the 8690 or 8438 ResourceID.
#### Fuzzy search
In fuzzy search, the half of characters of the query string can be modified (added, removed, or replaced). E.g., the "ab" query returns "ba", "ac", "cb", etc. To do a fuzzy search, use the tilde symbol `~` at the end of a string.
**Example**
~~~json
{
"kind":"opendes:osdu:*:0.2.1",
"query":"data.WellName:EMM~",
"limit":30
}
~~~
This request returns resources with the WellName containing EMM, EMO, EEM, OMM, EWM, EMC, ERM, etc.
> Note: The `WellName` field is valid only in the **0.2.1** schema.
### Filters
Return fields in results can be filtered. Specify the list of fields in the `returnedFields` parameter.
...
...
@@ -188,32 +220,31 @@ The starting offset of return results can be specified in the `offset` parameter
**Example**
~~~json
{
"kind":"opendes:osdu:*:*",
"query":"(data.ResourceID:3687) AND (data.ResourceTypeID:\"srn:type:master-data/Wellbore:\")",