In this lab, we will create a Lambda function which will connect the provided web interface to an Elasticsearch domain to provide search functionality.
**Note:** This lab can have extended launch times (10 to 30 minutes).
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Investigate the Lab Environment
With the provided information, log in to the AWS web console and look around at the provided resources. You should find:
- An Elasticsearch domain
- A Franken_Search Lambda function
- An S3 bucket containing the files for the Frankenwords site
- An API Gateway configured to trigger the Franken_Search Lambda function
- Update the Lambda Function
Update the Franken_Search function to forward an appropriately formatted query to the provided Elasticsearch domain and return a JSON string with the required information.
The JSON object, which is expected by the frontend site, should be structured as follows:
{ "total_hits": integer, "chapter_count": integer, "total_score": float, "hits": [ { "location": string, "score": float } ] }
- Test Frankenwords!
Test the Frankenwords site to ensure functionality, and learn how often words and phrases are used in Mary Shelley’s Frankenstein!