Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright © Sequence Collective Ltd 2014 Content Search Using SOLR Copyright © Sequence Collective Ltd 2014 By: Dr. Ehab ElGindy Technical Team Lead Implementing.

Similar presentations


Presentation on theme: "Copyright © Sequence Collective Ltd 2014 Content Search Using SOLR Copyright © Sequence Collective Ltd 2014 By: Dr. Ehab ElGindy Technical Team Lead Implementing."— Presentation transcript:

1 Copyright © Sequence Collective Ltd 2014 Content Search Using SOLR Copyright © Sequence Collective Ltd 2014 By: Dr. Ehab ElGindy Technical Team Lead Implementing Content Search for Car Dealer Website

2 Introduction Sitecore/Solr Configuration Demo Website Searching Items Computed Fields Facets Autocomplete (Bonus) QA Thank you Copyright © Sequence Collective Ltd 2014 Contents

3 Chaptertitle Introduction Copyright © Sequence Collective Ltd 2014

4 1.Understand how Sitecore and Solr work together. 2.Implement the search for a demo car dealer website. 3.Customise Sitecore and Solr configurations to implement the search logic. 4.Discuss the best practices of implementing Solr search in Sitecore. Copyright © Sequence Collective Ltd 2014 What are we going to do today? Introduction

5 Chaptertitle Sitecore/Solr Configuration Copyright © Sequence Collective Ltd 2014

6 The Sitecore.ContentSearch.Solr.Indexes.config controls: What Sitecore fields/data types to index (schema-less by default) Computed fields (transform the data before being sent to Solr) Url of the Solr Server. Core names. Indexing strategy. What Can I Configure and Where? Sitecore/Solr Configuration Copyright © Sequence Collective Ltd 2014 Sitecore.ContentSearch.Solr.Indexes.config Schema.xml The Solr Schema.xml config file controls: How fields will be indexed. How fields will be queried.

7 Copyright © Sequence Collective Ltd 2014 Example (The Text – Dynamic Field) - Sitecore Sitecore/Solr Configuration title_t body_t

8 Copyright © Sequence Collective Ltd 2014 Example (The Text – Dynamic Field) - Solr Sitecore/Solr Configuration

9 Chaptertitle Awesome Cars Copyright © Sequence Collective Ltd 2014

10 Computed Fields Search Results Auto Complete Facets

11 A Simple LINQ query Copyright © Sequence Collective Ltd 2014 Searching Cars

12 The Search Entity Mapping Searching Cars Copyright © Sequence Collective Ltd 2014 Base Template Car Item Template

13 Chaptertitle Computed Fields Copyright © Sequence Collective Ltd 2014

14 Computed Fields Copyright © Sequence Collective Ltd 2014 Searching Cars Store additional information about Sitecore items in Solr such as Image Url What you need to do? Implement the IComputedIndexField interface Override the ComputeFieldValue method Update the Sitecore.ContentSearch.Solr.Indexes.config to use the computed field

15 Computed Fields Copyright © Sequence Collective Ltd 2014 Searching Cars Page url is not indexed by default. You will need to create a computed field to fix it.

16 Chaptertitle Search Query Copyright © Sequence Collective Ltd 2014

17 Search Query Copyright © Sequence Collective Ltd 2014 Searching Cars Search for: BMW title_t:(BMW) OR body_t:(BMW) Why not using string.Contains()?.Where(i => i.Title.Contains(searchQuery))

18 Search Query (using multiword queries) Copyright © Sequence Collective Ltd 2014 Searching Cars Search for: Black BMW Spaces = Exact matching !!! title_t:(“Black BMW”) OR body_t:(“Black BMW”) title_t:(Black@BMW) OR body_t:(Black@BMW) Quick workaround Will this work?

19 Search Query (Boosting) Copyright © Sequence Collective Ltd 2014 Searching Cars (title_t:(BMW))^5 OR (body_t:(BMW))^1

20 Chaptertitle Facets Copyright © Sequence Collective Ltd 2014

21 Facets Copyright © Sequence Collective Ltd 2014 Facets Use LINQ to specify the facets Use the SearchResults.Facets property to enumerate the facets Each facet object contains it’s name and the aggregate count Facet Category FacetValue.Name FacetValue.AggregateCount

22 Chaptertitle Auto-Complete (NGram) Copyright © Sequence Collective Ltd 2014

23 NGram Copyright © Sequence Collective Ltd 2014 Auto-Complete A way of converting text into smaller tokens. Min and max lengths are specified. For example the NGram(min=2, max=3) for the word “Awesome” is (aw, we, es, so, om, me, awe, wes, eso, ome) The search auto-complete is a typical application of using NGrams

24 Ngram – How to implement it in Sitecore? Copyright © Sequence Collective Ltd 2014 Auto-Complete Define a new field type in Solr that uses the solr.NGramTokenizerFactory. Create a new field in Solr using the new field type. Use the CopyField feature in Solr to copy the title filed into the new field. Map the new field to SearchResultItem class in Sitecore. Write a LINQ query to filter the results using the new field.

25 Chaptertitle Copyright © Sequence Collective Ltd 2014 Questions

26 Chaptertitle Dr. Ehab ElGindy Technical Team Lead Copyright © Sequence Collective Ltd 2014 Email: Twitter: Blog: ehab.elgindy@sequence.co.uk @ehabelgindy http://www.ehabelgindy.com Thankyou


Download ppt "Copyright © Sequence Collective Ltd 2014 Content Search Using SOLR Copyright © Sequence Collective Ltd 2014 By: Dr. Ehab ElGindy Technical Team Lead Implementing."

Similar presentations


Ads by Google