Contained in this KB is a code sample which explains some of the ins and out of the Search Framework API.
The scope of the Ektron Search Framework API is quite broad and can be a bit overwhelming when you're just getting started with search. With the release of Ektron 9.0, which includes support for the Apache Solr search engine, I've pulled together what I hope will be a helpful starting point for those looking to venture into integrating search functionality into their sites.
The search sample below has been built as a fully functional tutorial for Ektron's Search Framework API and provides an overview of most of the major search features:
• How to craft search queries
• Working with search result sets
• Faceted search
• Paging
• and so on…
I've tried to organize it in such a way that it can be followed from top to bottom and it's packed with comment regions offering explanations of each feature. The regions are categorized as follows:
• Help: Explanations of search features and behaviors
• Tip: Implementation tips and best practices
• Example: Descriptions of the example code in the tutorial
• Try it out: Opportunities to play with the code
• Note: Caveats, support notes, etc.
Collapse the regions as you work through the tutorial to get a cleaner look at the code.
Also included in the package is a copy of the implementation without the comment regions. If you prefer to work through the code without all of the additional text, you can feel free to use that source file.
As I mentioned earlier, this page can be dropped into any Ektron site that is registered with Apache Solr. With that said, a majority of the concepts demonstrated in the tutorial are applicable to all of the search engines supported by Ektron. I've tried to note any area when support is more limited or a feature is not applicable.
The sample may also serve as a starting point for your own site search implementation. I encourage you to use the code in any way that you see fit but keep in mind that this code is a sample and was not implemented for deployment in production scenarios. If you intend to reuse any of it, I recommend that you put it through a rigorous testing process.
- Sample.zip90 KB
Please sign in to leave a comment.