Skip to content

Commit 3ce5567

Browse files
author
awstools
committed
feat(client-datazone): This release adds support for numeric filtering and complex free-text searches cases for the Search and SearchListings APIs.
1 parent 83b0e78 commit 3ce5567

9 files changed

Lines changed: 119 additions & 18 deletions

File tree

clients/client-datazone/src/commands/SearchCommand.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export interface SearchCommandInput extends SearchInput {}
2828
export interface SearchCommandOutput extends SearchOutput, __MetadataBearer {}
2929

3030
/**
31-
* <p>Searches for assets in Amazon DataZone.</p> <p>Search in Amazon DataZone is a powerful capability that enables users to discover and explore data assets, glossary terms, and data products across their organization. It provides both basic and advanced search functionality, allowing users to find resources based on names, descriptions, metadata, and other attributes. Search can be scoped to specific types of resources (like assets, glossary terms, or data products) and can be filtered using various criteria such as creation date, owner, or status. The search functionality is essential for making the wealth of data resources in an organization discoverable and usable, helping users find the right data for their needs quickly and efficiently.</p> <p>Many search commands in Amazon DataZone are paginated, including <code>search</code> and <code>search-types</code>. When the result set is large, Amazon DataZone returns a <code>nextToken</code> in the response. This token can be used to retrieve the next page of results. </p> <p>Prerequisites:</p> <ul> <li> <p>The --domain-identifier must refer to an existing Amazon DataZone domain. </p> </li> <li> <p>--search-scope must be one of: ASSET, GLOSSARY_TERM, DATA_PRODUCT, or GLOSSARY.</p> </li> <li> <p>The user must have search permissions in the specified domain.</p> </li> <li> <p>If using --filters, ensure that the JSON is well-formed and that each filter includes valid attribute and value keys. </p> </li> <li> <p>For paginated results, be prepared to use --next-token to fetch additional pages.</p> </li> </ul>
31+
* <p>Searches for assets in Amazon DataZone.</p> <p>Search in Amazon DataZone is a powerful capability that enables users to discover and explore data assets, glossary terms, and data products across their organization. It provides both basic and advanced search functionality, allowing users to find resources based on names, descriptions, metadata, and other attributes. Search can be scoped to specific types of resources (like assets, glossary terms, or data products) and can be filtered using various criteria such as creation date, owner, or status. The search functionality is essential for making the wealth of data resources in an organization discoverable and usable, helping users find the right data for their needs quickly and efficiently.</p> <p>Many search commands in Amazon DataZone are paginated, including <code>search</code> and <code>search-types</code>. When the result set is large, Amazon DataZone returns a <code>nextToken</code> in the response. This token can be used to retrieve the next page of results. </p> <p>Prerequisites:</p> <ul> <li> <p>The --domain-identifier must refer to an existing Amazon DataZone domain. </p> </li> <li> <p>--search-scope must be one of: ASSET, GLOSSARY_TERM, DATA_PRODUCT, or GLOSSARY.</p> </li> <li> <p>The user must have search permissions in the specified domain.</p> </li> <li> <p>If using --filters, ensure that the JSON is well-formed and that each filter includes valid attribute and value keys. </p> </li> <li> <p>For paginated results, be prepared to use --next-token to fetch additional pages.</p> </li> </ul> <p>To run a standard free-text search, the <code>searchText</code> parameter must be supplied. By default, all searchable fields are indexed for semantic search and will return semantic matches for SearchListings queries. To prevent semantic search indexing for a custom form attribute, see the <a href="https://docs.aws.amazon.com/datazone/latest/APIReference/API_CreateFormType.html">CreateFormType API documentation</a>. To run a lexical search query, enclose the query with double quotes (""). This will disable semantic search even for fields that have semantic search enabled and will only return results that contain the keywords wrapped by double quotes (order of tokens in the query is not enforced). Free-text search is supported for all attributes annotated with @amazon.datazone#searchable.</p> <p>To run a filtered search, provide filter clause using the <code>filters</code> parameter. To filter on glossary terms, use the special attribute <code>__DataZoneGlossaryTerms</code>. To filter on an indexed numeric attribute (i.e., a numeric attribute annotated with <code>@amazon.datazone#sortable</code>), provide a filter using the <code>intValue</code> parameter. The filters parameter can also be used to run more advanced free-text searches that target specific attributes (attributes must be annotated with <code>@amazon.datazone#searchable</code> for free-text search). Create/update timestamp filtering is supported using the special <code>creationTime</code>/<code>lastUpdatedTime</code> attributes. Filter types can be mixed and matched to power complex queries.</p> <p> To find out whether an attribute has been annotated and indexed for a given search type, use the GetFormType API to retrieve the form containing the attribute.</p>
3232
* @example
3333
* Use a bare-bones client and the command you need to make an API call.
3434
* ```javascript
@@ -52,13 +52,17 @@ export interface SearchCommandOutput extends SearchOutput, __MetadataBearer {}
5252
* filters: { // FilterClause Union: only one key present
5353
* filter: { // Filter
5454
* attribute: "STRING_VALUE", // required
55-
* value: "STRING_VALUE", // required
55+
* value: "STRING_VALUE",
56+
* intValue: Number("long"),
57+
* operator: "EQ" || "LE" || "LT" || "GE" || "GT" || "TEXT_SEARCH",
5658
* },
5759
* and: [ // FilterList
5860
* {// Union: only one key present
5961
* filter: {
6062
* attribute: "STRING_VALUE", // required
61-
* value: "STRING_VALUE", // required
63+
* value: "STRING_VALUE",
64+
* intValue: Number("long"),
65+
* operator: "EQ" || "LE" || "LT" || "GE" || "GT" || "TEXT_SEARCH",
6266
* },
6367
* and: [
6468
* "<FilterClause>",

clients/client-datazone/src/commands/SearchListingsCommand.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export interface SearchListingsCommandInput extends SearchListingsInput {}
2828
export interface SearchListingsCommandOutput extends SearchListingsOutput, __MetadataBearer {}
2929

3030
/**
31-
* <p>Searches listings in Amazon DataZone.</p> <p>SearchListings is a powerful capability that enables users to discover and explore published assets and data products across their organization. It provides both basic and advanced search functionality, allowing users to find resources based on names, descriptions, metadata, and other attributes. SearchListings also supports filtering using various criteria such as creation date, owner, or status. This API is essential for making the wealth of data resources in an organization discoverable and usable, helping users find the right data for their needs quickly and efficiently.</p> <p>SearchListings returns results in a paginated format. When the result set is large, the response will include a nextToken, which can be used to retrieve the next page of results.</p> <p>The SearchListings API gives users flexibility in specifying what kind of search is run.</p> <p>To run a free-text search, the <code>searchText</code> parameter must be supplied. By default, all searchable fields are indexed for semantic search and will return semantic matches for SearchListings queries. To prevent semantic search indexing for a custom form attribute, see the <a href="https://docs.aws.amazon.com/datazone/latest/APIReference/API_CreateFormType.html">CreateFormType API documentation</a>. To run a lexical search query, enclose the query with double quotes (""). This will disable semantic search even for fields that have semantic search enabled and will only return results that contain the keywords wrapped by double quotes (order of tokens in the query is not enforced). Free-text search is supported for all attributes annotated with @amazon.datazone#searchable.</p> <p>To run a filtered search, provide filter clause using the filters parameter. To filter on glossary terms, use the special attribute <code>__DataZoneGlossaryTerms</code>.</p> <p> To find out whether an attribute has been annotated and indexed for a given search type, use the GetFormType API to retrieve the form containing the attribute.</p>
31+
* <p>Searches listings in Amazon DataZone.</p> <p>SearchListings is a powerful capability that enables users to discover and explore published assets and data products across their organization. It provides both basic and advanced search functionality, allowing users to find resources based on names, descriptions, metadata, and other attributes. SearchListings also supports filtering using various criteria such as creation date, owner, or status. This API is essential for making the wealth of data resources in an organization discoverable and usable, helping users find the right data for their needs quickly and efficiently.</p> <p>SearchListings returns results in a paginated format. When the result set is large, the response will include a nextToken, which can be used to retrieve the next page of results.</p> <p>The SearchListings API gives users flexibility in specifying what kind of search is run.</p> <p>To run a standard free-text search, the <code>searchText</code> parameter must be supplied. By default, all searchable fields are indexed for semantic search and will return semantic matches for SearchListings queries. To prevent semantic search indexing for a custom form attribute, see the <a href="https://docs.aws.amazon.com/datazone/latest/APIReference/API_CreateFormType.html">CreateFormType API documentation</a>. To run a lexical search query, enclose the query with double quotes (""). This will disable semantic search even for fields that have semantic search enabled and will only return results that contain the keywords wrapped by double quotes (order of tokens in the query is not enforced). Free-text search is supported for all attributes annotated with @amazon.datazone#searchable.</p> <p>To run a filtered search, provide filter clause using the <code>filters</code> parameter. To filter on glossary terms, use the special attribute <code>__DataZoneGlossaryTerms</code>. To filter on an indexed numeric attribute (i.e., a numeric attribute annotated with <code>@amazon.datazone#sortable</code>), provide a filter using the <code>intValue</code> parameter. The filters parameter can also be used to run more advanced free-text searches that target specific attributes (attributes must be annotated with <code>@amazon.datazone#searchable</code> for free-text search). Create/update timestamp filtering is supported using the special <code>creationTime</code>/<code>lastUpdatedTime</code> attributes. Filter types can be mixed and matched to power complex queries.</p> <p> To find out whether an attribute has been annotated and indexed for a given search type, use the GetFormType API to retrieve the form containing the attribute.</p>
3232
* @example
3333
* Use a bare-bones client and the command you need to make an API call.
3434
* ```javascript
@@ -50,13 +50,17 @@ export interface SearchListingsCommandOutput extends SearchListingsOutput, __Met
5050
* filters: { // FilterClause Union: only one key present
5151
* filter: { // Filter
5252
* attribute: "STRING_VALUE", // required
53-
* value: "STRING_VALUE", // required
53+
* value: "STRING_VALUE",
54+
* intValue: Number("long"),
55+
* operator: "EQ" || "LE" || "LT" || "GE" || "GT" || "TEXT_SEARCH",
5456
* },
5557
* and: [ // FilterList
5658
* {// Union: only one key present
5759
* filter: {
5860
* attribute: "STRING_VALUE", // required
59-
* value: "STRING_VALUE", // required
61+
* value: "STRING_VALUE",
62+
* intValue: Number("long"),
63+
* operator: "EQ" || "LE" || "LT" || "GE" || "GT" || "TEXT_SEARCH",
6064
* },
6165
* and: [
6266
* "<FilterClause>",

clients/client-datazone/src/commands/SearchTypesCommand.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,17 @@ export interface SearchTypesCommandOutput extends SearchTypesOutput, __MetadataB
5151
* filters: { // FilterClause Union: only one key present
5252
* filter: { // Filter
5353
* attribute: "STRING_VALUE", // required
54-
* value: "STRING_VALUE", // required
54+
* value: "STRING_VALUE",
55+
* intValue: Number("long"),
56+
* operator: "EQ" || "LE" || "LT" || "GE" || "GT" || "TEXT_SEARCH",
5557
* },
5658
* and: [ // FilterList
5759
* {// Union: only one key present
5860
* filter: {
5961
* attribute: "STRING_VALUE", // required
60-
* value: "STRING_VALUE", // required
62+
* value: "STRING_VALUE",
63+
* intValue: Number("long"),
64+
* operator: "EQ" || "LE" || "LT" || "GE" || "GT" || "TEXT_SEARCH",
6165
* },
6266
* and: [
6367
* "<FilterClause>",

clients/client-datazone/src/models/enums.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1366,6 +1366,23 @@ export const SearchOutputAdditionalAttribute = {
13661366
export type SearchOutputAdditionalAttribute =
13671367
(typeof SearchOutputAdditionalAttribute)[keyof typeof SearchOutputAdditionalAttribute];
13681368

1369+
/**
1370+
* @public
1371+
* @enum
1372+
*/
1373+
export const FilterOperator = {
1374+
EQ: "EQ",
1375+
GE: "GE",
1376+
GT: "GT",
1377+
LE: "LE",
1378+
LT: "LT",
1379+
TEXT_SEARCH: "TEXT_SEARCH",
1380+
} as const;
1381+
/**
1382+
* @public
1383+
*/
1384+
export type FilterOperator = (typeof FilterOperator)[keyof typeof FilterOperator];
1385+
13691386
/**
13701387
* @public
13711388
* @enum

clients/client-datazone/src/models/models_1.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
EdgeDirection,
1515
EnableSetting,
1616
EnvironmentStatus,
17+
FilterOperator,
1718
FilterStatus,
1819
FormTypeStatus,
1920
GlossaryStatus,
@@ -10413,10 +10414,22 @@ export interface Filter {
1041310414
attribute: string | undefined;
1041410415

1041510416
/**
10416-
* <p>A search filter value in Amazon DataZone.</p>
10417+
* <p>A search filter string value in Amazon DataZone.</p>
1041710418
* @public
1041810419
*/
10419-
value: string | undefined;
10420+
value?: string | undefined;
10421+
10422+
/**
10423+
* <p>A search filter integer value in Amazon DataZone.</p>
10424+
* @public
10425+
*/
10426+
intValue?: number | undefined;
10427+
10428+
/**
10429+
* <p>Specifies the search filter operator.</p>
10430+
* @public
10431+
*/
10432+
operator?: FilterOperator | undefined;
1042010433
}
1042110434

1042210435
/**

clients/client-datazone/src/schemas/schemas_0.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,6 +1260,7 @@ const _iT = "itemType";
12601260
const _iTd = "idempotencyToken";
12611261
const _iTdl = "idleTimeout";
12621262
const _iUS = "isUpdateSupported";
1263+
const _iV = "intValue";
12631264
const _iVE = "isValueEditable";
12641265
const _ia = "iam";
12651266
const _id = "id";
@@ -1365,6 +1366,7 @@ const _oPIwn = "ownerProjectId";
13651366
const _oPN = "ownerProjectName";
13661367
const _oPO = "overrideProjectOwners";
13671368
const _oUI = "owningUserId";
1369+
const _op = "operator";
13681370
const _or = "orchestrator";
13691371
const _or_ = "or";
13701372
const _ord = "order";
@@ -2777,8 +2779,8 @@ export var FailureCause$: StaticStructureSchema = [3, n0, _FC,
27772779
];
27782780
export var Filter$: StaticStructureSchema = [3, n0, _F,
27792781
0,
2780-
[_a, _v],
2781-
[0, 0], 2
2782+
[_a, _v, _iV, _op],
2783+
[0, 0, 1, 0], 1
27822784
];
27832785
export var FilterExpression$: StaticStructureSchema = [3, n0, _FE,
27842786
0,

clients/client-datazone/test/index-objects.spec.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ import {
404404
FilterClause$,
405405
FilterExpression$,
406406
FilterExpressionType,
407+
FilterOperator,
407408
FilterStatus,
408409
FormEntryInput$,
409410
FormEntryOutput$,
@@ -2166,6 +2167,7 @@ assert(typeof EnableSetting === "object");
21662167
assert(typeof EntityType === "object");
21672168
assert(typeof EnvironmentStatus === "object");
21682169
assert(typeof FilterExpressionType === "object");
2170+
assert(typeof FilterOperator === "object");
21692171
assert(typeof FilterStatus === "object");
21702172
assert(typeof FormTypeStatus === "object");
21712173
assert(typeof GlossaryStatus === "object");

clients/client-datazone/test/index-types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,7 @@ export type {
554554
EntityType,
555555
EnvironmentStatus,
556556
FilterExpressionType,
557+
FilterOperator,
557558
FilterStatus,
558559
FormTypeStatus,
559560
GlossaryStatus,

0 commit comments

Comments
 (0)