https://github.com/epomatti/aws-cloudsearch
AWS CloudSearch sandbox
https://github.com/epomatti/aws-cloudsearch
aws aws-cloudsearch terraform
Last synced: about 2 months ago
JSON representation
AWS CloudSearch sandbox
- Host: GitHub
- URL: https://github.com/epomatti/aws-cloudsearch
- Owner: epomatti
- License: mit
- Created: 2022-08-25T20:24:42.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-08-26T00:15:38.000Z (almost 4 years ago)
- Last Synced: 2025-10-09T16:17:36.249Z (9 months ago)
- Topics: aws, aws-cloudsearch, terraform
- Language: HCL
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AWS CloudSearch

## Infrastructure
Create the infrastructure:
```sh
terraform init
terraform apply -auto-approve
```
Terraform will also create the search indexes.
## Search
### Upload documents
Upload the file batch:
```sh
aws cloudsearchdomain upload-documents \
--endpoint-url $documentEndpoint \
--content-type 'application/json' \
--documents 'movies-batch.json' \
--region 'us-east-1'
```
### Send a search
Search with a query:
```sh
aws cloudsearchdomain search \
--endpoint-url $searchEndpoint \
--search-query 'Matrix' \
--region 'us-east-1'
```
### Get suggestions
Create a suggester:
```sh
aws cloudsearch define-suggester \
--domain-name 'movies-domain' \
--suggester 'SuggesterName=movie_suggester,DocumentSuggesterOptions={SourceField=title,FuzzyMatching=none}' \
--region 'us-east-1'
```
Index the documents again (this can take a while):
```sh
aws cloudsearch index-documents \
--domain-name 'movies-domain' \
--region 'us-east-1'
```
Retrieves autocomplete suggestions for a partial query string:
```sh
aws cloudsearchdomain suggest \
--endpoint-url $searchEndpoint \
--suggester 'movie_suggester' \
--suggest-query 'Matrix' \
--region 'us-east-1' \
--size 3
```