building client-side search applications with solr

36

Upload: lucenerevolution

Post on 11-May-2015

2.764 views

Category:

Technology


0 download

DESCRIPTION

Presented by Daniel Beach, Search Application Developer, OpenSource Connections Solr is a powerful search engine, but creating a custom user interface can be daunting. In this fast paced session I will present an overview of how to implement a client-side search application using Solr. Using open-source frameworks like SpyGlass (to be released in September) can be a powerful way to jumpstart your development by giving you out-of-the box results views with support for faceting, autocomplete, and detail views. During this talk I will also demonstrate how we have built and deployed lightweight applications that are able to be performant under large user loads, with minimal server resources.

TRANSCRIPT

Page 1: Building Client-side Search Applications with Solr
Page 2: Building Client-side Search Applications with Solr

CLIENT-SIDE SEARCH APPS@DanielBeachOpenSource Connections

Page 3: Building Client-side Search Applications with Solr

World’s Data Doubling Annually

Page 4: Building Client-side Search Applications with Solr

Data Discovery Increasingly Important

Page 5: Building Client-side Search Applications with Solr

Client-SideSearch Applications

Page 6: Building Client-side Search Applications with Solr

Traditional ArchitectureServer

Browser

Database

Page 7: Building Client-side Search Applications with Solr

Client-Side ArchitectureJS App andAssets

Browser

Database Server

Page 8: Building Client-side Search Applications with Solr

Client-Side Benefits• Less Architecture Overhead• Smaller, Focused Teams• Faster to Develop• Application Speed

Page 9: Building Client-side Search Applications with Solr

Speed Matters.

Page 10: Building Client-side Search Applications with Solr

Case Study:Global Patent Search Network

http://gpsn.uspto.gov/

Page 11: Building Client-side Search Applications with Solr

The Challenge• 4+ Million Patents• Terabytes of Data• Multiple Languages• All within a ~3 Month Timeframe

Page 12: Building Client-side Search Applications with Solr

Our Solution:

Page 13: Building Client-side Search Applications with Solr

GPSN: Homepage

Page 14: Building Client-side Search Applications with Solr

GPSN: Search Results

Page 15: Building Client-side Search Applications with Solr

GPSN: Expanded Result

Page 16: Building Client-side Search Applications with Solr

GPSN: Search Controls

Page 17: Building Client-side Search Applications with Solr

GPSN: Patent Detail Page

Page 18: Building Client-side Search Applications with Solr

See it live:http://gpsn.uspto.gov

Page 19: Building Client-side Search Applications with Solr

SpyglassSimple search results with Solr + Ember JS

http://github.com/o19s/spyglass

Page 20: Building Client-side Search Applications with Solr

Spyglass Components

Infinite Scroll

Searcher

Facet Group

Result Set

Facet Facet State

Search Input

Page 21: Building Client-side Search Applications with Solr

Setting up the Searcher

App.searcher = SG.SolrSearcher.create({ url: "http://your-solr-url.com/solr/collection/select", params: { "fl": "title_field, description_field, link_field", "q": {}, "fq": [], "start": 0, "rows": 10, "wt": "json" }});

}app.js

Page 22: Building Client-side Search Applications with Solr

Adding Custom Fields to the Search Template

{{#each results}} <li class="sr-item"> <h4><a href="{{link unbound}}">{{ title }}</a></h4> <div> {{{ description }}} </div> </li>{{/each}} }

index.htm

l

Page 23: Building Client-side Search Applications with Solr

Spyglass Results

Page 24: Building Client-side Search Applications with Solr

Setting up the Searcher

App.searcher = SG.SolrSearcher.create({ url: "http://your-solr-url.com/solr/collection/select", params: { "fl": "title_field, description_field, link_field", "facet": true, "facet.field": ["facet_field1", "facet_field2"], "facet.limit": 5, "q": {}, "fq": [], "start": 0, "rows": 10, "wt": "json" }});

}app.js

Page 25: Building Client-side Search Applications with Solr

Adding a Facet Group: Step 1

App.facetGroup1 = SG.FacetGroup.extend({ searcher: App.searcher, fieldName: 'abstract_en', displayName: 'Abstract'}); }ap

p.js

Page 26: Building Client-side Search Applications with Solr

Adding a Facet Group: Step 2

<div class="sf-module"> {{view App.facetGroup1}}</div> }

index.htm

l

Page 27: Building Client-side Search Applications with Solr

Spyglass Facets

Page 28: Building Client-side Search Applications with Solr

Spyglass Blank States

{{#if searcher.isSearching}} <p>Loading Results &hellip;</p>{{/if}}{{#if searcher.noResults}} <p>No results were found. Try broadening your terms.</p>{{/if}}{{#if searcher.allResultsLoaded}} <p>All Results Loaded</p>{{/if}} }

index.htm

l

Page 30: Building Client-side Search Applications with Solr

Avoiding the Pitfalls.(“OMG, Security!”)

Page 31: Building Client-side Search Applications with Solr

Security.

Page 32: Building Client-side Search Applications with Solr

Google Juice.

Page 33: Building Client-side Search Applications with Solr

Solr Requests.

Page 34: Building Client-side Search Applications with Solr

Minify All The Things.

Page 35: Building Client-side Search Applications with Solr

Pick the Best Option for

Your Project.

Page 36: Building Client-side Search Applications with Solr

CLIENT-SIDE SEARCH APPS@DanielBeachOpenSource Connections