You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[STAC API - Core](https://github.com/radiantearth/stac-api-spec/tree/v1.0.0-rc.2/core)
14
+
-**Dependencies:** (any of)
15
+
-[STAC API - Collection Search](https://github.com/stac-api-extensions/collection-search)
16
+
-[STAC API - Item Search](https://github.com/radiantearth/stac-api-spec/tree/v1.0.0/item-search)
17
+
-[STAC API - Features](https://github.com/radiantearth/stac-api-spec/tree/v1.0.0/ogcapi-features)
11
18
-**Owner**: @agstephens
12
19
13
-
This defines a new parameter, `q` that allows the user to perform free-text queries against the item properties.
20
+
This defines a new parameter, `q` that allows the user to perform free-text queries against STAC metadata.
14
21
The value of the parameter is a string and is passed to the underlying backend for free-text searches.
15
-
Queries can be executed either against all string property fields or against specific fields and can make use of `AND` and `OR`
16
-
operators.
22
+
The specific set of text fields to which the parameter is applied is left to the discretion of the implementation, but a recommendation is to at least consider `title`, `description` and `keywords`. It is also allowed to query against all text fields.
17
23
18
24
This extension sits somewhere between the basic API and the [Filter Extension](https://github.com/radiantearth/stac-api-spec/tree/master/fragments/filter) providing
19
25
more powerful query features than the raw API but without the flexibility and increased operators of the filter plugin. This should mostly be used to provide
20
26
the ability to search for keywords across all properties with more complex queries and faceted search being provided by the filter extension.
21
27
22
-
## HTTP GET
28
+
This extension defines two flavors of free text search.
29
+
A simple one that is aligned with [OGC API - Records](https://docs.ogc.org/DRAFTS/20-004.html#_parameter_q) and
30
+
a more advanced one.
31
+
Both variants can be implemented against any of the search endpoints (Collection Search, Item Search, Features).
- Features (item search per collection): <https://api.stacspec.org/v1.0.0-rc.1/ogcapi-features#free-text>
41
+
42
+
The basic free-text search adds a `q` query parameter to the request URI.
43
+
See <https://docs.ogc.org/DRAFTS/20-004.html#_parameter_q> for details.
44
+
45
+
The search works case-insensitive and spaces have no special meaning.
46
+
Any of the search terms must be present in the set of text fields (OR operaror).
47
+
48
+
- In HTTP `GET` requests, all search terms must be separated by a comma. For example, if you want to search for "Earth Observation" or "EO", your query parameter should be as follows: `q=EO,Earth Observation`.
49
+
- In HTTP `POST` requests, an array of search terms must be provided, for example: `{"q": ["EO", "Earth Observation"]}`.
- Features (item search per collection): <https://api.stacspec.org/v1.0.0-rc.1/ogcapi-features#advanced-free-text>
57
+
58
+
**OpenAPI document:**[openapi.yaml](openapi.yaml)
59
+
60
+
### HTTP GET
61
+
62
+
**Examples:**
25
63
26
64
| URL Example | Summary | Detail |
27
65
| ----------- | ------- | ------ |
@@ -33,9 +71,9 @@ the ability to search for keywords across all properties with more complex queri
33
71
|`/search?q=(quick OR brown) AND fox`| Parentheses can be used to group terms | This will search for matching items where `properties.*` CONTAINS `"quick"` OR `"brown"` AND `"fox"`|
34
72
|`/search?q=quick +brown -fox`| Indicate included and excluded terms using `+`/`-`| This will search for items where `properties.*` INCLUDES `"brown"` EXCLUDES `"fox"` OR CONTAINS `"quick"`|
35
73
36
-
## HTTP POST
74
+
###HTTP POST
37
75
38
-
When calling the relevant endpoint using POST withContent-Type: application/json, this adds an attribute q with an object value to the core JSON search request body.
76
+
When calling the relevant endpoint using `POST` with `Content-Type: application/json`, this adds an attribute `q` with an object value to the core JSON search request body.
0 commit comments