Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Ektron London Conference: New Search Features in Ektron 9

1,127 views

Published on

Shakti Gohil Senior Application Engineer, Ektron, discusses the new search features available in Ektron 9, including the SOLR search provider, and the building blocks of the Search API.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Ektron London Conference: New Search Features in Ektron 9

  1. 1. Shakti Gohil Senior Application Engineer shakti.gohil@ektron.co.uk Search
  2. 2. Copyright © 2013 Ektron, Inc. Agenda • New search provider SOLR in Ektron9 • Building blocks of Search API • Examples and Hands On
  3. 3. Copyright © 2013 Ektron, Inc. SOLR • Based on Apache Lucene • Provides a robust enterprise search functionality • Includes faceted search, recommendation of similar results, spell check and more • Ektron Search is now built on SOLR
  4. 4. Copyright © 2013 Ektron, Inc. SOLR – what you need? • Based on JAVA • Java development kit (JDK) • Server • Glassfish, JBoss, Jetty, Resin, Tomcat, WebLogic, WebSphere • User account • User must have “Log on as a Service” right from local security policy • SQL server: TCP/IP enabled • SOLR Install
  5. 5. Copyright © 2013 Ektron, Inc. Building Blocks of Search API • Search Manager • Criteria • Keyword Criteria • Advanced Criteria • SearchResponce
  6. 6. Copyright © 2013 Ektron, Inc. Criteria • Keyword Criteria • Free text, keyword centric search query • Intended for broad, traditional search query • Advance Criteria • Narrow search results using expression tree • For narrower, targeted query
  7. 7. Copyright © 2013 Ektron, Inc. Example Code • Simple search • Spelling suggestion • Expression Tree • Content Property • Smartform Property • Metadata Property • Faceted search on • Smart form • Metadata • Taxonomy
  8. 8. Copyright © 2013 Ektron, Inc. Simple Search // Create instance search manager Ektron.Cms.Search.SearchManager searchManager = new Ektron.Cms.Search.SearchManager(); // Create instance of keyword criteria Ektron.Cms.Search.KeywordSearchCriteria criteria = new Ektron.Cms.Search.KeywordSearchCriteria(); // Search for pain text criteria.QueryText = "product"; // pass criteria object in search method to get search results var searchResponce = searchManager.Search(criteria);
  9. 9. Copyright © 2013 Ektron, Inc. Spelling suggestion // searchResponce object contains search results var searchResponce = searchManager.Search(criteria); // Check for spelling suggestion if (!string.IsNullOrWhiteSpace(searchResponce.SpellingSuggestion)) { // code to display spelling suggestion on page // searchResponce.SpellingSuggestion – string stores suggested spelling }
  10. 10. Copyright © 2013 Ektron, Inc. Expression Tree // Create instance of advanced criteria Ektron.Cms.Search.AdvancedSearchCriteria criteria = new Ektron.Cms.Search.AdvancedSearchCriteria(); // Build expression tree – add search content property criteria.ExpressionTree = SearchContentProperty.Id > 0 & SearchContentProperty.XmlConfigId.EqualTo(7); // Add smart form property - date criteria.ExpressionTree &= SearchSmartFormProperty.GetDateProperty("/root/pubDate").GreaterThan(new DateTime(2013, 5, 25)); // Add metadata property criteria.ExpressionTree &= SearchMetadataProperty.GetStringProperty("Region").EqualTo(“Europe");
  11. 11. Copyright © 2013 Ektron, Inc. Faceted Search • RefinementSpecification • Identifies a field on which facets should be generated. • Does not specify any additional constraints. • Refinement • Identifies the facet field and a constraint that should be applied to refine the query. • This is applicable when the user has selected a specific facet value/range by which they intend to refine their query.
  12. 12. Copyright © 2013 Ektron, Inc. Faceted Search // Add refinement specification - Fields on which facet should be generated criteria.Refinement.Add(new StringRefinementSpecification(SearchSmartFormProperty.GetStringProperty("/root /author"))); criteria.Refinement.Add(new StringRefinementSpecification(Ektron.Cms.Search.Solr.SearchSolrProperty.CreateE xactStringProperty(SearchContentProperty.TaxonomyCategory))); criteria.Refinement.Add(new StringRefinementSpecification(SearchMetadataProperty.GetStringProperty("Regio n")));
  13. 13. Copyright © 2013 Ektron, Inc. Faceted Search // Add refinement specification - Fields on which facet should be generated criteria.Refinement.Add(new StringRefinementSpecification(SearchSmartFormProperty.GetStringProperty("/root /author"))); // After SEARCH operation, Get facet information from SearchResponceData var authorFacet = searchResponce.Facets[SearchSmartFormProperty.GetStringProperty("/root/auth or")]; foreach (UniqueFacetBucket<string> bucket in authorFacet.Buckets) { if (bucket.Count > 0) { // bucket.Refinement.Data – stored key:value pair // bucket.Value – facet value // bucket.Count – number of item fall in this bucket } }
  14. 14. Copyright © 2013 Ektron, Inc. Faceted Search How to add refinement condition. // Smart form refinement criteria.Refinement.Add(new Ektron.Cms.Search.Refinement(Ektron.Cms.Search.SearchSmartFormProperty.Get StringProperty("/root/author"), " estrootauthor:jonathan")); // Metadata refinement criteria.Refinement.Add(new Ektron.Cms.Search.Refinement(SearchMetadataProperty.GetStringProperty("Regi on"), “emtregion:europe”)) //searchManager.search operation code var searchResponce = searchManager.Search(criteria);
  15. 15. Shakti Gohil Senior Application Engineer shakti.gohil@ektron.co.uk Questions ?
  16. 16. Copyright © 2013 Ektron, Inc. Thank You

×