EasySearch and Turbo Charged FindPagesWithCriteria
We designed EasySearch as both a full text search engine and a structured data search engine. This is to say that EasySearch can be used to search for named property values of EpiServer pages using common query operators. The cool thing is that it can do this very fast over very big data.
This post describes how one project has used this technique to great effect to construct page lists throughout a site. One of the main reasons mentioned for using EasySearch is that the in built EPiServer functionality for page searches based on property values is limited to writing SQL (a bit of a no-no), writing code against the object model (slow and laborious) or using the ‘FindPagesWithCriteria’ method. This method doesn’t scale well as it needs to load pages to decide if they should be returned.
EasySearch stores the data in a query optimised fashion and therefore doesn’t have any page load overhead when executing the query. It provides a way to create structured queries that go directly against its Lucene index. Now, while the Lucene query language is very powerful, it would be nice to be able invoke a method to execute a query. I chatted with another EasySearch contributor, Mari Jorgensen, about structured search and we agreed that having a simple method call to do 80% of the queries people need would be a good thing to do. So, our current plan is to generalise the approach described by Andreas to provide a new implementation of FindPagesWithCriteria that goes against the EasySearch index.
We are also considering a LINQ provider, but that’s a little more work. However, Andreas already alludes to something similar when he talks about domain models and classes for EpiServer page types.
The comment I really like in Andreas’ post is the following ‘Now we have a site where it’s super easy to fetch data to all sorts of listings with content coming from all over the place, for instance we can easily get news/tips/weather info/track info etc. for any given event (the domain is betting on horse races) which frees the content editors to create the content in the places where it makes sense for them to do so’. This decoupling of content creation and content publishing is the key to a compelling editorial and end user experience.