How to create and interact with domains and perform search queries using Amazon CloudSearch?

Reading Time: 9 minutes
Amazon CloudSearch

The collection of data that you want to search for can consist of unstructured documents, semi-structured documents such as XML, or structured data. Amazon CloudSearch is a fully managed service that allows users to search large collections of data such as web pages, document files, forum posts, or product information.

In this blog, we will demonstrate hands-on using a sample data set of 5000 popular movie titles, we will use that data to upload to the search domain and submit queries to see how Amazon CloudSearch works.

In this blog, we will cover:

  • What is Amazon CloudSearch?
  • Benefits of Amazon CloudSearch
  • Features of Amazon CloudSearch
  • Pricing
  • Hands-on
  • Amazon CloudSearch Testimonials
  • Conclusion

What is Amazon CloudSearch?

Amazon CloudSearch is a fully managed service in the AWS Cloud that makes setting up, operating, and growing a search solution for any website or application simple and cost-effective. Searching big collections of data, such as web pages, document files, forum discussions, or product information, can be made easier with Amazon CloudSearch.

Furthermore, you may add quick search features without becoming a search specialist. And there’s no need to be concerned about hardware provisioning, setup, or maintenance in CloudSearch.

Benefits of Amazon CloudSearch

Benefits of Amazon CloudSearch

You can quickly add rich search features to your website or application with Amazon CloudSearch. You won’t have to learn how to search or bother about hardware provisioning, setup, or maintenance. You can build a search domain and upload the data you want to make searchable with a few clicks in the AWS Management Console, and Amazon CloudSearch will automatically supply the resources and deploy a highly tailored search index.

At any time, you can modify your search parameters, fine-tune search relevancy, and apply new settings. Amazon CloudSearch effortlessly expands to meet your demands as your data and traffic volumes fluctuate.

Simple: The AWS Management Console, AWS CLI, and AWS SDKs can all be used to set up and maintain an Amazon CloudSearch domain. Simply point to a sample of your data, and Amazon CloudSearch will suggest how to set up the indexing options for your domain. You may quickly add and remove index fields, as well as change search settings like faceting and highlighting. You don’t have to re-upload your data if you modify your configuration.

Scalable: For all search domains, Amazon CloudSearch provides robust autoscaling. Amazon CloudSearch can scale your search domain’s resources up or down as your data or query volume changes. If you know you’ll need more capacity for bulk uploads or a spike in search traffic, you can control scaling.

Reliable: Amazon CloudSearch monitors and recovers your search domains automatically. Amazon CloudSearch creates and maintains resources for a search domain in two Availability Zones when Multi-AZ is enabled, ensuring high availability. In both Availability Zones, updates are applied automatically to the search instances. In the event of a failure, search traffic is spread across both Availability Zones, and the instances in any zone are capable of managing the full load.

High Performance: Through automatic sharding and horizontal and vertical autoscaling, Amazon CloudSearch ensures low latency and great throughput even at a huge scale.

Fully Managed: Amazon CloudSearch is a custom search service that is fully controlled by Amazon. Provisioning, setup, and configuration of hardware and software, software patching, data partitioning, node monitoring, scaling, and data durability are all taken care of for you.

Cost-Effective: Amazon CloudSearch is intended to be low-cost. You just pay for the resources you utilize, at affordable hourly rates. When compared to running a search environment on your own, Amazon CloudSearch has a cheap total cost of ownership for your search applications.

Secure: To authenticate users and prevent unauthorized access to your domains, Amazon CloudSearch employs powerful cryptographic algorithms. Amazon CloudSearch works with Identity and Access Management (IAM) to govern access to the CloudSearch configuration service as well as the document, search, and suggest services for each domain.

Features of Amazon CloudSearch

Features of Amazon CloudSearch

Amazon CloudSearch has a number of advanced search options, including:

  • Free text, Boolean, and Faceted searches are all available.
  • Suggestions from autocomplete
  • Relevance ranking and query-time rank expressions that can be customized
  • Weighting in the field
  • Highlighting geospatial searches
  • There are 34 languages supported

Pricing

Pricing of Amazon CloudSearch

You only have to pay for what you use. There are no setup fees or commitments required to get started with Amazon CloudSearch. The use of search instances accounts for the majority of a domain’s costs. For data durability and recovery, all source documents and updates to the domain are saved behind the scenes on Amazon S3, but customers get this for free, which is major cost savings over a self-managed search infrastructure. Using the AWS Simple Monthly Calculator, you may estimate your monthly bill. You will pay according to your monthly usage across the different dimensions including Data transfer, IndexDocuments requests, Search instances, and Document batch uploads

Hands-On

Step 1: Create a Search Domain

Step 2: Upload Data for Indexing

Step 3: Search Your Domain

Step 4: Delete Your Movies Domain

  1. Create a Search Domain
  • Go to the Amazon CloudSearch console, click Create Your First Search Domain
  • In the Name your domain step, enter a name for your new domain and click continue.
Amazon CloudSearch
  • In the Configure index step, click Use a predefined configuration, select IMDb movies (demo), and click on Continue button
  • In the Review index configuration step, review the index fields being configured
  • Click on Continue
Amazon CloudSearch
  • In the set-up access policies step, click search and suggester service: allow all. document service: account owner only. and click continue. The recommended rules allow access to the search endpoint from all IP addresses, and restrict access to the document service to the IP address you specify, click continue.
  • In the Confirm step, click Confirm to create your domain (if required, you can review configuration).
  • Once the domain has been created, click OK to exit the Create New Search Domain wizard and go to the domain’s dashboard.
Amazon CloudSearch
  • When you create a new domain, Amazon CloudSearch initializes resources for that newly created domain. This process takes a few minutes of time. You will be able to see the status of the domain is LOADING during this initialization process.

  1. Upload Data for Indexing
  • Once the status changes to ACTIVE, you can upload your data and start searching.
  • On the document source step, select Predefined data, choose IMDb movies (demo), and click Continue
Amazon CloudSearch
  • On the document summary step, click Finish to return to the domain dashboard.

That’s it! You now have a fully functional Amazon CloudSearch domain ready and now t you can start searching. Updates are applied continuously in the order they are received, so you can start searching your domain right away.

  1. Search Your Domain

There are two ways to achieve this:

  • Search with search tester
  • Search using web requests via browser

Let’s have a look at how to search using search tester:

  • In the Navigation panel, click the name of your movies domain and click the Run a Test Search option.
  • To perform a simple text search, enter the text you want to search for and click Go 
  • To search fields, click Options link and enter a comma-separated list of the fields you want to search in the Search Fields field eg: year, actors. You can append a weight to each field with a caret (^) to control the relative importance of each field in the search results.
Amazon CloudSearch

Other way to search is: Submitting request via web browser

You can submit search requests directly to your search endpoint from any Web browser

For example, to search your movies domain and get the titles of all the available Star Wars movies, append the following search string to your search endpoint. (2013-01-01 is the API version and must be specified.)

Eg: /2013-01-01/search?q=star+wars&return=title

  • Your domain’s search endpoint is shown on the domain dashboard, copy the same and paste in the URL section of your browser
  • Append the search query as shown below: 

search-workfall-cloudsearch-kqivckvpmhilnk5fys6dzwech4.us-east-1.cloudsearch.amazonaws.com/ /2013-01-01/search?q=star+wars&return=title

  • Hit enter, and see the results, to search your movies domain and get the titles of all the available Star Wars movies
Amazon CloudSearch
  1. Delete Your Movies Domain

When you are finished experimenting with your movie’s domain, you must delete it to avoid incurring additional usage fees.

To view the domain dashboard, click the name of the movie domain In the Navigation panel, click the name of your movies domain

Click the Delete this Domain button.

  • In the Delete Domain dialog box, select the Delete the domain option and click OK to permanently remove the domain and all its data.

Amazon CloudSearch Testimonials

News UK

“We use Amazon CloudSearch to let our members search our archive of news articles, dating back to 1785. We love the fact that CloudSearch automatically scales for traffic and data. Having a low cost, high throughput, low-latency search without maintenance and operational overhead lets us focus more time on delighting our members.” – Danny Tedora, Transformation Program Manager, News UK

Search Technologies

“Based on our testing, CloudSearch now consumes roughly 50% fewer resources – resulting in costs being cut in half for the same search workloads. We are excited to see support for a wide variety of languages, plus great features such as autocomplete, hit highlighting, and geospatial search. With these new features, and improved efficiency, CloudSearch should be the default option for fully-managed search applications on AWS.” – Paul Nelson, Chief Architect, Search Technologies

SitePX

“Before the full use of Amazon Web Services, the page load time for our customer was an average of 5 to 8 seconds. Now, we are delivering the same page in 1 second. With Amazon CloudSearch, our search went from an average of 4.5 seconds to 0.5 seconds.” – Ricardo Monteiro, Director of Technology, SitePX

Snapguide

“After evaluating several options for search at Snapguide we picked CloudSearch for its easy setup, automatic scaling, and rich set of developer tools. It was a snap to go from a single set of documents to multiple domains, and CloudSearch handles our complicated queries involving user-visibility logic and custom ranking effortlessly. Having search as a service enables our small team to do more while worrying about less.” – Sam Kimbrel, Senior Software Engineer, Snapguide

SmugMug

“Amazon CloudSearch is a game-changing product that has allowed us to deliver powerful new search capabilities. Our customers can now find what they are looking for faster and more easily than ever before. Amazon CloudSearch fits with our strategy of being 100% based in the cloud, and has allowed us to focus our technical resources on building a great customer experience. We saved many months of re-architecture and development time by going with Amazon CloudSearch.” – Don MacAskill, CEO & Chief Geek, SmugMug

Conclusion

In this blog, we explored the Amazon CloudSearch service and how we can use it to create our domain, upload data for indexing, and then use search queries to perform search operations on data. We also learned different methods to search the data either using a search texter or by submitting HTTP requests through a web browser. We explored how to create and interact with domains created using the Amazon CloudSearch console. Stay tuned to keep getting all updates about our upcoming new blogs on AWS and relevant technologies.

Meanwhile …

Keep Exploring -> Keep Learning -> Keep Mastering

This blog is part of our effort towards building a knowledgeable and kick-ass tech community. At Workfall, we strive to provide the best tech and pay opportunities to AWS-certified talents. If you’re looking to work with global clients, build kick-ass products while making big bucks doing so, give it a shot at workfall.com/partner today.

Back To Top