I’ve been working a lot with the Sitecore Content Search API lately, currently working on using the API for a webshop, and making the experience of finding your products awesome. Unfortunately I can’t write about the customer and their products, so I’ll try to blog about the code being made, and match it for a new project called MovieShop.
The MovieShop will show movie titles and enable you to search through them.
The ideas is to implement:
- Search for movies
- Custom fields for relevant fields
- Facets on relevant fields
- Exposing search through ASP.NET Web.API
- Searching via UI using AngularJs
In order to show how to do all of the above, my biggest problem was to get some data, that could be used for demos, and that didn’t require too much trouble to gain access to. I’ve previously done some Work with "The Movie DB", www.themoviedb.org. It’s a service like IMDB, which gathers information about movies, and exposes them through various services. Fortunately, this service has an open API, where you sign up, and gets access to archives. I thought it would be perfect as a data store, which has some basic information about various products (videos).
I've added the code to this repo at GitHub https://github.com/mikkelhm/Sitecore-Movieshop, check out the files located at https://github.com/mikkelhm/Sitecore-Movieshop/tree/master/MovieShop/MovieShop.Website/sitecore%20modules/shell/MovieShop for the import. What the data will give me is a movie list of the most top rated movies at TMDB, just around 2500 movies. I thought the data could be Associated as a typical webshop containing plenty of products (videos).
The data will look a lot like this; it contains a basic website node, containing a product container. The container contains al the movies, split into folders containing their first letters. I’ve also imported the genres, the production Companies and the production countries, these are saved in tree list fields on the movies. Lastly, the code gets the posters for the movies just to get a little graphic for the movies.
Stay tuned for more in this project, the next part will define the search index. That part will build on one of my previous blogpost about defining search indexes (http://mikkelhm.dk/post/2014/07/30/defining-a-custom-index-in-sitecore-7-the-absolute-minimum1.aspx).
Also, check out the project at GitHub (https://github.com/mikkelhm/Sitecore-Movieshop) for newest changes.