May 25, 2016 | Written by: Mike Broberg
Categorized: Data Analytics | How-tos
Share this post:
A Lannister always pays his [technical] debtParaphrase of unofficial House Lannister motto
Search engine architectures are rarely as straightforward as you’d expect. Before you can start having fun with your data (such as Game of Thrones character info), there are a lot of components you need to consider to ensure the best overall performance and developer experience:
- What kind of database will you use?
- Will you cache results?
- What search library will you use?
- Will you expose facets?
- What does the UI look like?
- Does it scale?!
Reducing this complexity is the goal of the Simple Search Service example app, from my colleagues on the IBM Cloud Data Services developer advocacy team. Simple Search Service takes data that you’ve dumped into a CSV or TSV file and creates a faceted search API that’s designed to work well with any web or mobile app. The code is open source in the ibm-cds-labs/simple-search-service project on GitHub, and it deploys to Bluemix at the click of a button.
Simple Search Service exposes a pleasant search API and web interface
Simple Search Service is powered by the IBM Cloudant JSON database to build full-text search indexes, and the service uses a Redis key-value store on the IBM Compose database platform to cache results. A Node.js runtime on Bluemix comprises the rest of the back end. The result is a REST API for queries, and an infrastructure that scales.
House Words: full text search for GoT data
To introduce Simple Search Service, we’ve published recent articles on importing game of thrones data and hooking up an easy UI. The articles walk you through code that Glynn Bird and Va Barbosa wrote to produce the GoT character search engine you’ll find at sss-got-theme.mybluemix.net:
An early draft of Va’s front end. See the finished version here.
The API handles free text searches, like the one above that returns any instance of the string
"Frey". If you want to get fancier, you can use the API to restrict queries to specific fields and combine those conditions. For example, try searching for
culture:"Northmen" AND books:"A Clash of Kings" to find all the Starks and their subjects who appear in George R.R. Martin’s second book.
For more on the Simple Search Service, read Glynn’s introductory tutorial, or trace the code on GitHub. Remember: Winter is coming. So brush up on those royal houses of Westeros!
Data in this example app is processed from An API of Ice and Fire. Copyright: The ‘A Song of Ice And Fire’ series and its data is the property of George R.R. Martin. The data is used without claim of ownership.