Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search context #633

Merged
merged 6 commits into from
Nov 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## Unreleased

### Removed
- Removed "next" from the search metadata and query parameter, added POST body and headers to the links for paging support

### Changed
- The STAC API endpoint `/stac` has been merged with `/`
- The STAC API endpoint `/stac/search` is now called `/search`
- Support for [CommonMark 0.29 instead of CommonMark 0.28](https://spec.commonmark.org/0.29/changes.html).
- [Checksum extension](extensions/checksum/README.md) is now using self-identifiable hashes ([Multihash](https://github.com/multiformats/multihash)).
- Removed "next" from the search metadata and query parameter, added POST body and headers to the links for paging support
- API `search` extension renamed to `context` extension. JSON object renamed from `search:metadata` to `context`

## [v0.8.1] - 2019-11-01

Expand Down
2 changes: 1 addition & 1 deletion api-spec/STAC-extensions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1586,7 +1586,7 @@ components:
$ref: '#/components/schemas/item'
links:
$ref: '#/components/schemas/itemCollectionLinks'
'search:metadata':
context:
type: object
required:
- next
Expand Down
2 changes: 1 addition & 1 deletion api-spec/extensions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ API Extensions given follow the same guidelines for Extension Maturity as given
| ------------- | ----------- | -------- |
| [Fields](fields/README.md) | Adds parameter to control which fields are returned in the response. | *Pilot* |
| [Query](query/README.md) | Adds parameter to search Item and Collection properties. | *Pilot* |
| [Search](search/README.md) | Adds search-related metadata to [ItemCollection](../../item-spec/itemcollection-spec.md). | *Proposal* |
| [Context](context/README.md) | Adds search related metadata (context) to [ItemCollection](../../item-spec/itemcollection-spec.md). | *Proposal* |
| [Sort](sort/README.md) | Adds Parameter to control sorting of returns results. | *Pilot* |
| [Transaction](transaction/README.md) | Adds PUT and DELETE endpoints for the creation, editing, and deleting of items and Collections. | *Pilot* |

Expand Down
2 changes: 1 addition & 1 deletion api-spec/extensions/STAC-extensions.merge.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
!!files_merge_append ["STAC.yaml", "extensions/STAC-extensions.fragment.yaml", "extensions/query/query.fragment.yaml", "extensions/sort/sort.fragment.yaml", "extensions/fields/fields.fragment.yaml", "extensions/search/search.fragment.yaml", "extensions/transaction/transaction.fragment.yaml"]
!!files_merge_append ["STAC.yaml", "extensions/STAC-extensions.fragment.yaml", "extensions/query/query.fragment.yaml", "extensions/sort/sort.fragment.yaml", "extensions/fields/fields.fragment.yaml", "extensions/context/context.fragment.yaml", "extensions/transaction/transaction.fragment.yaml"]
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Search Extension Specification
# Context Extension Specification

**Extension [Maturity Classification](../../../extensions/README.md#extension-maturity): Proposal**

Expand All @@ -12,9 +12,9 @@ search, for example, from calling the `/search` API endpoint.

| Element | Type | Description |
| ----------------- | --------------------- | ------------------------------------------------------------ |
| `search:metadata` | [SearchMetadata Object](#searchmetadata-object) | **REQUIRED.** The search-related metadata for the [ItemCollection](../../../item-spec/itemcollection-spec.md). |
| `context` | [Context Object](#context-object) | **REQUIRED.** The search-related metadata for the [ItemCollection](../../../item-spec/itemcollection-spec.md). |

### SearchMetadata Object
### Context Object

| Element | Type | Description |
| ------------ | --------------- | ------------------------------------------------------------ |
Expand All @@ -26,13 +26,13 @@ search, for example, from calling the `/search` API endpoint.

**limit** - The maximum number of results requested explicitly, the default limit used by the service implementation if no parameter was provided, or the maximum limit used by the service implementation if the limit parameter was larger. `null` if no limit was placed on the query that retrieved these results, which should be a rare case in practice.

## Example ItemCollection augmented with SearchMeta field
## Example ItemCollection augmented with Context field

```json
{
"type": "FeatureCollection",
"features": [ ],
"search:metadata": {
"context": {
"limit": 10,
"matched": 1092873,
"returned": 9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ components:
itemCollection:
type: object
properties:
'search:metadata':
'context':
type: object
required:
- next
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"type": "FeatureCollection",
"features": [ ],
"search:metadata": {
"context": {
"limit": 10,
"matched": 1092873,
"returned": 9
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "schema.json#",
"title": "Search Extension",
"title": "Context Extension",
"type": "object",
"description": "STAC Search Extension",
"description": "STAC search metadata",
"allOf": [
{
"$ref": "#/definitions/search_metadata"
"$ref": "#/definitions/context"
}
],
"definitions": {
"search_metadata": {
"context": {
"type": "object",
"required": [
"search:metadata"
"context"
],
"properties": {
"search:metadata": {
"context": {
"type": "object",
"required": [
"next",
"returned"
],
"properties": {
Expand Down