SVC101 Building Search into Your App - AWS re: Invent 2012

2,587 views

Published on

Amazon CloudSearch is a fully-managed search service in the cloud that allows customers to easily integrate fast and highly scalable search functionality into their applications. In this session, we cover the basics of search and search engines. We take an introductory look at CloudSearch along with a deep dive showing how to build a CloudSearch-based web application.

  • Be the first to comment

SVC101 Building Search into Your App - AWS re: Invent 2012

  1. 1. Search experience = user retention and revenue
  2. 2. DNS / Load Balancing AWS QuerySearch Domain Search API Console Doc Command Console Config Command Console Svc API Line Tools API Line Tools ACCESS CONTROL ACCESS CONTROL ACCESS CONTROL SEARCH SERVICE DOCUMENT SERVICE CONFIG SERVICE Search Documents Add Documents Create Domains Update Documents Configure Domains Delete Documents Delete Domains
  3. 3. DATA Document Quantity and Size SEARCH INSTANCE SEARCH INSTANCE SEARCH INSTANCE Index Partition 1 Index Partition 2 Index Partition n Copy 1 Copy 1 Copy 1TRAFFICSearchRequestVolume and SEARCH INSTANCE SEARCH INSTANCE SEARCH INSTANCEComplexity Index Partition 1 Index Partition 2 Index Partition n Copy 2 Copy 2 Copy 2 SEARCH INSTANCE SEARCH INSTANCE SEARCH INSTANCE Index Partition 1 Index Partition 2 Index Partition n Copy n Copy n Copy n
  4. 4. • The Challenge• The Data: The Million Song Data Set http://labrosa.ee.columbia.edu/millionsong/• The Application
  5. 5. Field name Descriptionartist_mbid The musicbrainz.org IDartist_name Name of the artistaudio_md5 Hash code of the audiodanceability According to The Echo Nestduration In secondsloudness General loudness of the tracksong_hottnesss According to Echo Nesttitle Song titleyear Song year
  6. 6. • Create an Amazon CloudSearch domain• Identify use case and supporting data• Upload data• Configure the domain• Improve document ranking• Integrate with the front end• Keep documents up-to-date
  7. 7. • Create an Amazon CloudSearch domain• Identify use case and supporting data• Upload data• Configure the domain• Improve document ranking• Integrate with the front end• Keep documents up-to-date
  8. 8. • Create an Amazon CloudSearch domain• Identify use case and supporting data• Upload data• Configure the domain• Improve document ranking• Integrate with the front end• Keep documents up-to-date
  9. 9. YearSong TitleArtist NameFamiliarity
  10. 10. ArtistGenreYear
  11. 11. TitleArtist NameGenreArtist FamiliarityYear
  12. 12. • Create an Amazon CloudSearch domain• Identify use case and supporting data• Prepare and upload data• Configure the domain• Improve document ranking• Integrate with the front end• Keep documents up-to-date
  13. 13. SDF Batches AmazonMillion Song CloudSearch DataSet
  14. 14. SDF Batches[ {"type":"add", "id": "soaczam12ab0181559", "version":5, "lang":"en", "fields": { "title":"Ruby Tuesday", "artist_name":"The Rolling Stones", "year":"1967", "artist_familiarity":864830, "genre":["alternative", "ambient", "dance", "electronic", "pop", "r&b", "reggae"] }},… ]
  15. 15. • Create an Amazon CloudSearch domain• Identify use case and supporting data• Prepare and upload data• Configure the domain• Improve document ranking• Integrate with the front end• Keep documents up-to-date
  16. 16. Text fields formatching user terms Result enabled toretrieve source data
  17. 17. Literal fields for Faceting Facet enabled toretrieve facet counts Search enabled for narrowing
  18. 18. Integer fields forranking, narrowing
  19. 19. • Create an Amazon CloudSearch domain• Identify use case and supporting data• Prepare and upload data• Configure the domain• Improve document ranking• Integrate with the front end• Keep documents up-to-date
  20. 20. • Create an Amazon CloudSearch domain• Identify use case and supporting data• Prepare and upload data• Configure the domain• Improve document ranking• Integrate with the front end• Keep documents up-to-date
  21. 21. PHP Integration$results = file_get_contents( http://search-mn-songs-5bbplyghbb5tk257rsb7iamlsy." . "us-east-1.cloudsearch.amazonaws.com" . "/2011-02-01/search?q=" . $keyword . "&return-fields=title,artist_name,year&" . "facet=artist_name,year_facet,genre&" . "rank=-" . $rank); $resultsObj = json_decode($results);
  22. 22. Simple Search Result{"rank": "-text_relevance","match-expr": "(label rolling stone)","hits": { "found": 204, "start": 0, "hit": [ { "id": "sontsst12cf5f88b42"}, { "id": "sopvopr12ab017f082"}, { "id": "sorzrpw12ac468a13b"}, ] },...
  23. 23. Search Results With Return Values"hit":[ { "id": "sontsst12cf5f88b42", "data": { "artist_familiarity": [ "925048" ], "artist_name": [ "The Rolling Stones" ], "text_relevance": [ "326" ], "title": [ "Heart Of Stone" ], "year": [ "1964" ] } },
  24. 24. Facets In Search Results{…"hits": { … },"facets": { "genre": { "constraints": [ { "value": "pop", "count": 126 }, { "value": "rock", "count": 125 }, { "value": "alternative", "count": 109 }, { "value": "electronic", "count": 106 }, { "value": "jazz", "count": 58 }, ... ] } }
  25. 25. XX
  26. 26. • Create an Amazon CloudSearch domain• Identify use case and supporting data• Prepare and upload data• Configure the domain• Improve document ranking• Integrate with the front end• Keep documents up-to-date
  27. 27. 26ms
  28. 28. https://github.com/pbs/haystack-cloudsearch
  29. 29. Get Started Now, Free Trial
  30. 30. We are sincerely eager to hear your feedback on thispresentation and on re:Invent. Please fill out an evaluation form when you have a chance.

×