Skip to content

Commit de29475

Browse files
author
Andy Barrett
committed
add extra examples to DataCollections.keyword docstring
1 parent 01ff1f8 commit de29475

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

earthaccess/search.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,24 @@ def keyword(self, text: str) -> Self:
149149
150150
Returns:
151151
self
152+
153+
By default, `keyword` searches for collections that contain all words a string.
154+
155+
results = earthaccess.search_datasets(
156+
keyword='sea ice thickness',
157+
)
158+
159+
will return datasets that contain "sea" AND "ice" AND "thickness".
160+
161+
To search for datasets with fields that contain the phrase "sea ice thickness",
162+
the phrase needs to contained in `"`, which must be escaped, e.g. `\"`.
163+
164+
results = earthaccess.search_datasets(
165+
keyword='\"sea ice thickness\"',
166+
)
167+
168+
???+ Note
169+
This behaviour may change in the future.
152170
"""
153171
return super().keyword(text)
154172

0 commit comments

Comments
 (0)