|
2 | 2 |
|
3 | 3 | The official [MongoDB Atlas](https://www.mongodb.com/) AWS CDK resource for Node.js. |
4 | 4 |
|
5 | | -> AWS CDK [L1 construct] and data structures for the [AWS CloudFormation Registry] type `MongoDB::Atlas::SearchIndex` v1.0.0. |
| 5 | +> AWS CDK [L1 construct] and data structures for the [AWS CloudFormation Registry] type `MongoDB::Atlas::SearchIndex` v3.0.0. |
6 | 6 |
|
7 | 7 | [L1 construct]: https://docs.aws.amazon.com/cdk/latest/guide/constructs.html |
8 | 8 | [AWS CloudFormation Registry]: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry.html |
9 | 9 |
|
10 | 10 | ## Description |
11 | 11 |
|
12 | | -Returns, adds, edits, and removes Atlas Search indexes. Also returns and updates user-defined analyzers. |
| 12 | +Returns, adds, edits, and removes Atlas indexes for Search or Vector search. Also returns and updates user-defined analyzers. It requires CFN resource `MongoDB::Atlas::SearchIndex` >= 3.0.0. |
13 | 13 |
|
14 | 14 | ## MongoDB Atlas API Docs |
15 | 15 |
|
@@ -42,29 +42,49 @@ You can find more information about activating this type in the [AWS CloudFormat |
42 | 42 | import { CfnSearchIndex } from 'awscdk-resources-mongodbatlas'; |
43 | 43 |
|
44 | 44 | const mySearchIndex = new CfnSearchIndex(this, 'MySearchIndex', { |
45 | | - analyzer: 'lucene.standard', |
46 | | - clusterName: atlasProps.clusterName, |
47 | | - collectionName: atlasProps.collectionName, |
48 | | - database: atlasProps.dbName, |
49 | | - mappings: { |
50 | | - fields: [ |
51 | | - "summary:string", |
52 | | - "description:string", |
53 | | - "minimum_nights:number"], |
54 | | - dynamic: false, |
55 | | - }, |
56 | | - name: atlasProps.indexName, |
57 | | - profile: atlasProps.profile, |
58 | | - projectId: atlasProps.projId, |
59 | | - searchAnalyzer: 'lucene.standard' |
60 | | - }); |
| 45 | + profile: atlasProps.profile, |
| 46 | + projectId: atlasProps.projId, |
| 47 | + clusterName: atlasProps.clusterName, |
| 48 | + name: atlasProps.indexNameSearch, |
| 49 | + collectionName: atlasProps.collectionName, |
| 50 | + database: atlasProps.dbName, |
| 51 | + searchAnalyzer: 'lucene.standard', |
| 52 | + analyzer: 'lucene.standard', |
| 53 | + mappings: { |
| 54 | + fields: JSON.stringify({ |
| 55 | + employees: { |
| 56 | + type: "string", |
| 57 | + analyzer: "lucene.whitespace", |
| 58 | + } |
| 59 | + }), |
| 60 | + dynamic: false, |
| 61 | + }, |
| 62 | +}); |
| 63 | + |
| 64 | +const myVectorSearchIndex = new CfnSearchIndex(this, 'MyVectorSearchIndex', { |
| 65 | + profile: atlasProps.profile, |
| 66 | + projectId: atlasProps.projId, |
| 67 | + clusterName: atlasProps.clusterName, |
| 68 | + name: atlasProps.indexNameVector, |
| 69 | + collectionName: atlasProps.collectionName, |
| 70 | + database: atlasProps.dbName, |
| 71 | + type: 'vectorSearch', |
| 72 | + fields: JSON.stringify([ |
| 73 | + { |
| 74 | + type: "vector", |
| 75 | + path: "plot_embedding", |
| 76 | + numDimensions: 1536, |
| 77 | + similarity: "euclidean" |
| 78 | + } |
| 79 | + ]), |
| 80 | +}); |
61 | 81 | ``` |
62 | 82 |
|
63 | 83 | ## Feedback |
64 | 84 |
|
65 | 85 | This library is auto-generated and published to all supported programming languages by the [cdklabs/cdk-cloudformation] project based on the API schema published for `MongoDB::Atlas::SearchIndex`. |
66 | 86 |
|
67 | | -* Issues related to this generated library should be [reported here](https://github.com/cdklabs/cdk-cloudformation/issues/new?title=Issue+with+%40cdk-cloudformation%2Fmongodb-atlas-searchindex+v1.0.0). |
| 87 | +* Issues related to this generated library should be [reported here](https://github.com/cdklabs/cdk-cloudformation/issues/new?title=Issue+with+%40cdk-cloudformation%2Fmongodb-atlas-searchindex+v3.0.0). |
68 | 88 | * Issues related to `MongoDB::Atlas::SearchIndex` should be reported to the [publisher](https://github.com/mongodb/mongodbatlas-cloudformation-resources/issues). |
69 | 89 | * Feature requests should be [reported here](https://feedback.mongodb.com/forums/924145-atlas?category_id=392596) |
70 | 90 |
|
|
0 commit comments