1. MAKE YOUR GUI SHINE WITH AJAX SOLR
Troy D. Thomas Product Engineering Manager
Koorosh Vakhshoori Technical Architect
2. Make Your GUI Shine With AJAX Solr
Setting the Stage
Company Backgrounder
Project History
Business & Technical Requirements
Inspiration
Demo
Why AJAX Solr?
AJAX Solr Framework DEEP DIVE
Themes
Widgets
Challenges
Q & A
Agenda
3. Company - Background
Synopsys
25 year old company / 1.8B 2012 revenue
Electronic Design Automation (EDA)
Electrical engineers design computer chips
High level design
Simulation
Test
Place and route
IP blocks
Nearly every semiconductor built uses Synopsys software
microprocessors, RAM, etc.
Synopsys â What?
4. Company Background
SolvNet ÂŽ - online knowledge base system used by
customers and employees
Dedicated engineering team
20 year history
1993 Email
1995 A âPatchyâ NCSA Web server + PERL CGI
1997 Verity Netscape search
2001 Java â Netscape Iplanet Portal + Verity
2005 Apache Lucene
2007 Pure Apache
2012 AJAX Solr / Solr 4
Synopsys â SolvNet ÂŽ
5. Lucene
Moved to Lucene - 2005
Custom tokenization helped results
+delay_mode_zero
Autocomplete - 2008
Custom Yahoo UI Widget
Relatively Complex
Tomcat w/ RMI callback
HTML parser
PDF text extraction using PDFBox
Generate Lucene documents
Separate collections â Articles, Docs, etc.
Open Source winsâŚ
6. Requirements
Voice of the customer
Make it faster
Easier to use
Better results
Can you just use Google?
Technical team concerns
Custom code
Lucene aging
JSF foundation - GUI complexity
Business / Technical
7. Project Inspiration
Advanced Full-Text Search Capabilities
Optimized for High Volume Web Traffic
Standards Based Open Interfaces - XML,JSON and HTTP
Comprehensive HTML Administration Interfaces
Server statistics exposed over JMX for monitoring
Scalability - Efficient Replication to other Solr Search Servers
Flexible and Adaptable with XML configuration
Extensible Plugin Architecture
Solr Uses the Lucene Search Library and Extends it!
A Real Data Schema, with Numeric Types, Dynamic Fields, Unique Keys
Powerful Extensions to the Lucene Query Language
Faceted Search and Filtering
Advanced, Configurable Text Analysis
Highly Configurable and User Extensible Caching
Performance Optimizations
External Configuration via XML
An Administration Interface
Monitorable Logging
Fast Incremental Updates and Index Replication
Highly Scalable Distributed search with sharded index across multiple hosts
XML, CSV/delimited-text, and binary update formats
Easy ways to pull in data from databases and XML files from local disk and HTTP sources
Rich Document Parsing and Indexing (PDF, Word, HTML, etc) using Apache Tika
Multiple search indices
Apachecon 2010
8. Solr 4
Solr
Faceting!
Modernize GUI
Deprecate custom code base
Autocomplete using Yahoo UI
Did you mean?
Tika
ExtractingRequestHandler (Solr Cell)
Extract more mime types
Solr 4 (Trunk)
DirectSolrSpellChecker
More like this
Synonym list
Future migration path
Why?
11. Requirements
Dynamic GUI Interface AJAX Solr / Solr 4
Faceting
Autocomplete
Spell checker
Did you mean?
Deeper search (attachments) Tika
Better hit highlighter Solr 4
Technical Translation
12. Why AJAX Solr?
Limited resources / no budget
No GUI designers on staff
Limited specialization
âEnoughâ JavaScript â but not experts
Dynamic GUIs are commonplace (AJAX)
Autocomplete
Faceting
AJAX Solr framework helps with all of these
Considerations
13. AJAX Solr
Modern Standards
JQUERY / JSON friendly
Widget Framework
Autocomplete
Query submit
Save settings
Sort /display results
Pagination
Facet by product
Facet by doc type
Challenges
Session management
Strength of community (Google Group)
Proxy Server
Benefits / Challenges
16. Why AJAX Solr?
⢠Dynamic GUI
â Faceting
â Autocomplete
⢠Faster GUI
â Less data traffic between server and client
â Less area to refresh
â Less mouse clicks
⢠Intuitive
17. What is AJAX Solr?
It is JavaScript framework-agnostic, but
requires an AJAX implementation for
communication with Solr. As such, you may
use the library whether you develop using
jQuery, MooTools, Prototype, Dojo, or any
other framework.
AJAX Solr Wiki
18. Intro AJAX Solr Framework
⢠MVC on top of an Ajax framework
â Our implementation uses Jquery
⢠Main components
â Manager
â Parameters
â Widgets
â Theming
20. Search Black Box View
Browser
Client
index.jsp
solr/select?...&q=clock%20tree%2
0power&..
Web
Application
Server
Solr
Server
Search hits
JSON
Response
21. Search Results Response (JSON)
{
"responseHeader":{
"status":0,
"QTime":960,
"params":{
...
"facet":"true",
"facet.field":[... "{!ex=products}products"],
...
"fq":[... "{!tag=products}products:"Synplify FPGA""],
...
"q":"clock tree power",
...
"spellcheck":"true",
....}},
"response":{"numFound":12,"start":0,"maxScore":1.5953931,
"docs":[
{
...
"id":"913646",
...
"title":" Clock tree fan out using syn_maxfan",
...
"products":["Synplify FPGA"],
"teaser":"... Question: I have a design and I am targetting
Spartan devices. The clock is not meeting timing in a design,
..."},
...
},
"facet_counts":{
...
"facet_fields":{
...
"products":{
...
"Synplify FPGA":12,
...}},
....},
"highlighting":{
"913646":{
"title":[" <em>Clock</em> <em>tree</em> fan out using
syn_maxfan"],
"indexed_content":["The <em>clock</em> is not meeting
timing in a design,..."]},
...}},
"spellcheck":{
"suggestions":{}}}
27. Solr
Search Server
More on Manager
Index
Browser
Client
Proxy
Server
Web
Application
Server
Direct or Proxy
28. Manager Life Cycle
Manager ParameterStore WidgetWidgetWidget
On index.jsp page load
Instantiate
setStore()
Instantiate
InstantiateaddWidget()
For each
widget
init()
init()
init()
For each
widget
For each
widget doRequest() beforeRequest()
executeRequest()
For each
widget afterRequest()
Ajax call
34. Manager Life Cycle
Manager ParameterStore WidgetWidgetWidget
On index.jsp page load
Instantiate
setStore()
Instantiate
InstantiateaddWidget()
For each
widget
init()
init()
init()
For each
widget
For each
widget doRequest() beforeRequest()
executeRequest()
For each
widget afterRequest()
Ajax call
35. AbstractTextWidget
⢠The widget that manipulates
the âqâ parameter
⢠Example implementations:
â TextWidget.q.js
â AutocompleteTermWidget.js
41. ResultWidget
⢠Function: Show the search results. Based
on tutorial example
⢠Extends AbstractWidget
⢠Analytics
â Total hit count
â Which filters and facets
â Selected content type
45. AbstractFacetWidget
AjaxSolr.ProdTypeWidget = AjaxSolr.AbstractFacetWidget(
{
//Single vs. multiValue fq
multiValue: false
âŚ
//Methods
init: function () {
//Initializes the facet field and related parameters.
},
beforeRequest: function () { //Empty},
afterRequest: function () {
//Setup click handler for the selected products.
}
clickhandler: function() { doRequest for selecting a product.}
unclickhandler: function() { doRequest when deselecting a product.}
}
46. Theme
⢠Separate presentation layer
â Result widget: Display metadata and
summary
â Facet widget: Attach click handler
AjaxSolr.theme.prototype.facet_link =
function (value, handler) {
return $('<a href="#"/>').text(value).click(handler);
};
AjaxSolr.theme('facet_link', facet_value,facetHandler)
47. Other Requirements
⢠Interaction with other applications
â Third party JavaScript
⢠Analytics, Survey
â Backend applications
⢠Recent searches
⢠Personalized search profile
⢠Error handling
â Ajax Exception
â Application logging
48. Security concerns
⢠Coarse vs. Granular
â Proxy blocking
â Role based filter
⢠Session management
â Error handling
â Timeout
49. Debugging
⢠Browser side debugging
â Firebug on Firefox
â Chrome developer tools
⢠Raw Solr JSON/XML
â Learn it!
50. Performance Tuning
⢠Reduce Traffic between Server and
Browser
â Filter on server
â Minimize browser side computation
â Solr schema consideration
â Compress JavaScript & CSS
⢠Proxy Server Caching
â JavaScript, CSS
51. Housekeeping
⢠Jquery & Jquery-UI upkeep
⢠Browser compatibilities
â NO IE 6 support
â IE 10
â Plugins
52. Summary
⢠Make your GUI Shine with AJAX Solr
⢠Understanding of the Framework
⢠Best practices
⢠Challenge and possibilities
54. References
⢠AJAX Solr Wiki
https://github.com/evolvingweb/ajax-solr/wiki
⢠Google group âajax-solrâ
https://groups.google.com/forum/?fromgroups#!
forum/ajax-solr
55. CONFERENCE PARTY
The Tipsy Crow: 770 5th Ave
Starts after Stump The Chump
Conference badge gets you in
TOMORROW
Breakfast starts at 7:30
Keynotes start at 8:30
CONTACT US