Responsive Facets with Apache Solr
Upcoming SlideShare
Loading in...5
×
 

Responsive Facets with Apache Solr

on

  • 1,255 views

This is a presentation I presented to JavaMUG on February 12, 2013. I have submitted a proposal on the topic to OSCon for 2013.

This is a presentation I presented to JavaMUG on February 12, 2013. I have submitted a proposal on the topic to OSCon for 2013.

Statistics

Views

Total Views
1,255
Views on SlideShare
1,244
Embed Views
11

Actions

Likes
4
Downloads
19
Comments
0

1 Embed 11

https://twitter.com 11

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Field

Responsive Facets with Apache Solr Responsive Facets with Apache Solr Presentation Transcript

  • Responsive Facetswith Apache SolrDallas, TXFebruary 12, 2013Discussion document – Strictly Confidential & Proprietary
  • Agenda …What we will cover tonight• Concept of Facets• The Problem with RDBMS• Solr to the Rescue• Solr by example• Architecture basics• Putting data in• Getting data out Responsive Facets with Apache Solr February 12, 2013 2
  • Concept of facets…Sometimes the facets only have groups with values Responsive Facets with Apache Solr February 12, 2013 3
  • Concept of facets…Sometimes, they also include a count for the value Responsive Facets with Apache Solr February 12, 2013 4
  • The Problem with RDBMS…Easy enough, just attributes of the product… Responsive Facets with Apache Solr February 12, 2013 5
  • The Problem with RDBMS…Easy enough, just attributes of the product… Or is it! Responsive Facets with Apache Solr February 12, 2013 6
  • The Problem with RDBMS…Easy enough, just attributes of the product… Or is it! Responsive Facets with Apache Solr February 12, 2013 7
  • The Problem with RDBMS…Easy enough, just attributes of the product… Or is it! Responsive Facets with Apache Solr February 12, 2013 8
  • The Problem with RDBMS…Easy enough, just attributes of the product… Or is it! Responsive Facets with Apache Solr February 12, 2013 9
  • Solr to the rescue…We need a better way to organize our data for fast queriesSolr is a standalone search server built on the Lucene Search Library. It offers all thecapabilities of the Lucene library and extends the capabilities. Solr interactions are handledthrough a REST-like API, allowing you to input and retrieve data in a variety of formats.Solr can run within most servlet containers including Tomcat and Jetty.• Full-Text Search Capabilities• Standards Based Open Interfaces – XML, JSON and HTTP• Linearly scalable, auto index replication, auto failover and recovery• Near Real-time indexing• SolrJ library capable of binary over HTTP communication• Faceted Search and Filtering Responsive Facets with Apache Solr February 12, 2013 10
  • Solr to the rescue…Products are inserted into Solr as a Document• Fields and Dynamic Fields• Unique Key on a specific field• Fields are typed – String is a literal – Text is a tokenized string• CopyField allows you to populate multiple fields off a single field insert Responsive Facets with Apache Solr February 12, 2013 11
  • Solr by example…Solr utilizes a REST-like interface with XML, JSON and binary capabilitiesLet’s look at a few examples… Responsive Facets with Apache Solr February 12, 2013 12
  • Architecture basics…Running Solr• Embedded – Makes your application more bloated – More resource intensive• Standalone – Run on it’s own server – Network traffic hit – Replication is an option• SolrCloud – High availability – Sharded with replication – http://bit.ly/TdAJBw Responsive Facets with Apache Solr February 12, 2013 13
  • Architecture basics…Our environment Responsive Facets with Apache Solr February 12, 2013 14
  • Architecture basics… Communicating withSolr SolrJ • Java binary communication • Library that abstracts connection, query formation and response processing Inject Server<bean id="solrServer" class="org.apache.solr.client.solrj.impl.LBHttpSolrServer"><constructor-argvalue="${solr.url.primary}"/></bean> Inject Search Service<bean id="blSearchService" class="com.vology.core.service.search.VolSearchServiceImpl"><constructor-argname="solrServer" ref="${solr.source.primary}" /></bean> Utilize SolrJ Library • ServerContext • SolrQuery • SolrDocument • QueryResponse Responsive Facets with Apache Solr February 12, 2013 15
  • Putting data in…How do we get the data into Solr?Transform fields• Populate transient fields• Determine terminating objectQuery product data from DB• Utilize Hibernate to retrieve relevant productsPopulate SolrJSolrDocument• Java Reflection to get fields we want• SolrField data from FieldAdd SolrDocument• Group into a List<SolrDocument>• Add full set or incremental• Commit Responsive Facets with Apache Solr February 12, 2013 16
  • Getting data outHow do we get the data out of Solr?Build SolrQuery• Query searchable fields from Field table• Creates ‘&’ delimited list for qf from Field table• We utilize a boost value (^100.0)Add Search Facets• Uses search facet and search facet range tables• Creates ‘&’ delimited list of facet.field and facet.rangeQuery on ServerContext• server.query(SolrQuery)• QueryResponse returnedPopulate ProductSearchResult• Set facets• Set results• Passed back to SearchController Responsive Facets with Apache Solr February 12, 2013 17
  • Contact ...Tell me what you thought! blemons@credera.com @brentlemons slideshare.net/brentlemons linkedin.com/in/brentlemons github.com/brentlemonsDo you think this presentation should be at OSCon?• Tweet @oscon to let them know! Responsive Facets with Apache Solr February 12, 2013 18