Start Slideshow

This document is designed to be viewed as a reveal.js slide show presentation. You can either read/print the contents of the presentation (and the speaker notes) below, or click here to view slideshow.

(Please consult the reveal.js docs for information on how to control the slideshow once it's started)

A ZIP file containing this presentation is available for offline perusal.

Lifecycle of a Solr Search Request

Chris "Hoss" Hostetter - 2017-09-14


https://home.apache.org/~hossman/rev2017/

https://twitter.com/_hossman

https://www.lucidworks.com/


Agenda

Deep Dive look into the lifecycle of 4 Solr Search Requests...

  • Single Node: Single SolrCore
    1. Simple Query
    2. Facet Query
  • SolrCloud: 2 Shards + 2 Replicas
    1. Simple Query
    2. Facet Query

...and where various types of Plugins can be used.

Simple Query

Single Node: Single SolrCore

bin/solr -e techproducts
http://localhost:8983/solr/techproducts/select
       ?           q = ipod
       &        sort = inStock desc, score desc
       &          fl = id, name
       &        rows = 10
Layers: HTTP, Webapp, DispatchFilter, CoreContainer, SolrCores
In a single SolrCore: RequestHandlers with initParams & components; QueryComponents, notably only SearchComponent used in this request
QueryComponent.prepare() which uses QParsers & the IndexSchema (including SchemaFields and FieldTypes) to validate & parse all the request input
QueryComponent.process() which uses the data created by prepare() to execute the search against the SolrIndexSearcher + the JsonResponseWriter which serializes the results back to the HTTP client

More Complex Query

Single Node: Single SolrCore

http://localhost:8983/solr/techproducts/select
       ?           q = ipod
       &          fq = price:[* TO 1000]
       &        sort = div(popularity,price) asc,
                       score desc
       &          fl = id, name, why:[explain style=nl]
       &       facet = true
       & facet.field = cat
Layers: HTTP, Webapp, DispatchFilter, CoreContainer, SolrCores
QueryComponent.prepare() + FacetComponent.prepare() using pluggable ValueSource parsers & the IndexSchema (including SchemaFields and FieldTypes)to validate & parse all the request input
FacetComponent.process() uses the DocSet created by QueryComponent.process() to compute the facet counts for each term + the JsonResponseWriter which serializes the results back to the HTTP client, including data from the ExplainAugmenter

Simple Query

SolrCloud: 4 Nodes, 2 Shards, 2 Replicas

bin/solr -e cloud
...
http://localhost:8983/solr/techproducts/select
       ?           q = ipod
       &        sort = inStock desc, score desc
       &          fl = id, name
       &        rows = 10
4 Jetty instances w/their RequestDispatchers, each containing different replicas of shards from various collections, and how they resolve requests for the 'techproducts' collection
SearchHandler + QueryComponent.distributedProcess on a 'coordinator' node issuing multiple sub-requests to one replica of each shard in order to merge all results
Hypothetical α request+responses, Hypothetical β requests+responses, & the final Merged results from both

Complex Query*

SolrCloud: 4 Node, 2 Shards, 2 Replicas

http://localhost:8983/solr/techproducts/select
       ?           q = ipod
       &        sort = inStock desc, score desc
       &          fl = id, name
       &       facet = true
       & facet.field = cat
SearchHandler + QueryComponent.distributedProcess & FacetComponent.distributedProcess on a 'coordinator' node issuing multiple sub-requests to one replica of each shard in order to merge all results
Hypothetical FacetComponent α request+responses+merging, Hypothetical β requests+responses, & the final Merged results after the β

Q & A