Search API#
You can obtain a SearchApi handle by calling Project.get_search_api.
SearchApi #
feature_search #
feature_search(
search_term: str, offset: int = 0, limit: int = 100
) -> search_results.FeatureSearchResult
Search for features.
import hopsworks
project = hopsworks.login()
search_api = project.get_search_api()
result = search_api.feature_search("search_term")
# get feature group instance
feature_group = result.features[0].get_feature_group()
# get feature instance
feature = result.features[0].get_feature()
| PARAMETER | DESCRIPTION |
|---|---|
search_term | The term to search for. TYPE: |
offset | The number of results to skip. TYPE: |
limit | The number of search results to return. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
search_results.FeatureSearchResult | The matching features from all feature stores in the project including shared feature stores. |
| RAISES | DESCRIPTION |
|---|---|
ValueError | If the search term is not provided. |
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request. |
featuregroup_search #
featuregroup_search(
search_term: str,
filter_by: FILTER_BY_ARG = None,
offset: int = 0,
limit: int = 100,
) -> search_results.FeatureGroupSearchResult
Search for feature group.
import hopsworks
project = hopsworks.login()
search_api = project.get_search_api()
result = search_api.featuregroup_search("search_term")
# get feature group instance
featuregroup = result.featuregroups[0].get_feature_group()
| PARAMETER | DESCRIPTION |
|---|---|
search_term | The term to search for. TYPE: |
filter_by | Filter results by a specific field. TYPE: |
offset | The number of results to skip. TYPE: |
limit | The number of search results to return. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
search_results.FeatureGroupSearchResult | The matching feature groups from all feature stores in the project including shared feature stores. |
| RAISES | DESCRIPTION |
|---|---|
ValueError | If the search term is not provided or if the filter_by is not one of the allowed values. |
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request. |
featurestore_search #
featurestore_search(
search_term: str,
filter_by: FILTER_BY_ARG = None,
offset: int = 0,
limit: int = 100,
) -> search_results.FeaturestoreSearchResult
Search for feature groups, feature views, training datasets and features.
import hopsworks
project = hopsworks.login()
search_api = project.get_search_api()
result = search_api.featurestore_search("search-term")
# get feature group instance
featuregroup = result.featuregroups[0].get_feature_group()
| PARAMETER | DESCRIPTION |
|---|---|
search_term | The term to search for. TYPE: |
filter_by | Filter results by a specific field. TYPE: |
offset | The number of results to skip. TYPE: |
limit | The number of search results to return. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
search_results.FeaturestoreSearchResult | The matching results from all feature stores in the project including shared feature stores. |
| RAISES | DESCRIPTION |
|---|---|
ValueError | If the search term is not provided or if the filter_by is not one of the allowed values. |
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request. |
featureview_search #
featureview_search(
search_term: str,
filter_by: FILTER_BY_ARG = None,
offset: int = 0,
limit: int = 100,
) -> search_results.FeatureViewSearchResult
Search for feature views.
import hopsworks
project = hopsworks.login()
search_api = project.get_search_api()
result = search_api.featureview_search("search_term")
# get feature view instance
featureview = result.feature_views[0].get_feature_view()
| PARAMETER | DESCRIPTION |
|---|---|
search_term | The term to search for. TYPE: |
filter_by | Filter results by a specific field (default is None). TYPE: |
offset | The number of results to skip (default is 0). TYPE: |
limit | The number of search results to return (default is 100). TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
search_results.FeatureViewSearchResult | The matching feature views from all feature stores in the project including shared feature stores. |
| RAISES | DESCRIPTION |
|---|---|
ValueError | If the search term is not provided or if the filter_by is not one of the allowed values. |
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request. |
trainingdataset_search #
trainingdataset_search(
search_term: str,
filter_by: FILTER_BY_ARG = None,
offset: int = 0,
limit: int = 100,
) -> search_results.TrainingDatasetSearchResult
Search for training datasets.
import hopsworks
project = hopsworks.login()
search_api = project.get_search_api()
result = search_api.trainingdataset_search("search_term")
# get training datasets instance
trainingdataset = result.trainingdatasets[0].get_training_dataset()
| PARAMETER | DESCRIPTION |
|---|---|
search_term | The term to search for. TYPE: |
filter_by | Filter results by a specific field. TYPE: |
offset | The number of results to skip. TYPE: |
limit | The number of search results to return. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
search_results.TrainingDatasetSearchResult | The matching training datasets from all feature stores in the project including shared feature stores. |
| RAISES | DESCRIPTION |
|---|---|
ValueError | If the search term is not provided or if the filter_by is not one of the allowed values. |
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request. |
FeaturestoreSearchResult #
Bases: FeaturestoreSearchResultBase
FeatureGroupSearchResult #
FeatureViewSearchResult #
TrainingDatasetSearchResult #
FeatureSearchResult #
FeatureGroupResult #
Bases: FeaturestoreResult
get_feature_group #
get_feature_group()
Get the feature group instance associated with this feature group result.
| RETURNS | DESCRIPTION |
|---|---|
FeatureGroup | The feature group instance. |
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request. |
FeatureViewResult #
Bases: FeaturestoreResult
get_feature_view #
get_feature_view()
Get the feature view instance associated with this feature view result.
| RETURNS | DESCRIPTION |
|---|---|
FeatureView | The feature view instance. |
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request. |
TrainingDatasetResult #
Bases: FeaturestoreResult
get_training_dataset #
get_training_dataset()
Get the training dataset instance associated with this training dataset result.
| RETURNS | DESCRIPTION |
|---|---|
TrainingDataset | The training dataset instance. |
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request. |
FeatureResult #
Bases: FeaturestoreResult
get_feature #
get_feature()
Get the feature instance associated with this feature result.
| RETURNS | DESCRIPTION |
|---|---|
Feature | The feature instance. |
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request. |
get_feature_group #
get_feature_group()
Get the feature group instance associated with this feature.
| RETURNS | DESCRIPTION |
|---|---|
FeatureGroup | The feature group instance. |
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request. |