Skip to content

Commit

Permalink
Adds intake_es documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonb5 committed Aug 10, 2023
1 parent 59618a5 commit 1cb3c5f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions dockerfiles/minimal-notebook/intake_es/src/intake_es/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ def __init__(
skip_client=False,
**kwargs,
):
"""Elasticsearch intake catalog.
Args:
index: String name of the index to search.
host: String url to the Elasticsearch cluster.
es_kwargs: Dictionary of arguments to pass Elasticsearch client.
search_kwargs: Dictionary of initial search arguments.
skip_client: Bool to skip initializing the Elasticsearch client.
kwargs: Extra arguments to pass to `intake.Catalog`.
"""
super().__init__(**kwargs)

self._index = index
Expand All @@ -41,6 +51,17 @@ def __init__(
self._entries = {}

def search(self, **kwargs):
"""Search the Elasticsearch index.
The values of the search arguments can be a string or list. If a list
the each value must be present to match.
Args:
kwargs: Search arguments.
Examples:
>>> cat.search(activity_drs='ScenarioMIP', variable_id=['pr', 'tas'])
"""
if len(kwargs) == 0:
warnings.warn(
"No search arguments, this may take awhile",
Expand Down

0 comments on commit 1cb3c5f

Please sign in to comment.