How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
Rapid prototyping with solr - By Erik Hatcher
1. Rapid Prototyping
with Solr
Erik Hatcher, Lucid Imagination
erik.hatcher @ lucidimagination.com, May 25, 2011
2. Abstract
§ Got data? Let's make it searchable! This interactive
presentation will demonstrate getting documents into
Solr quickly, will provide some tips in adjusting Solr's
schema to match your needs better, and finally will
discuss how showcase your data in a flexible search
user interface. We'll see how to rapidly leverage
faceting, highlighting, spell checking, and debugging.
Even after all that, there will be enough time left to
outline the next steps in developing your search
application and taking it to production.
3
3. My Background
§ Erik Hatcher
• Lucid Imagination
§ Technical Staff
• Co-author
§ Java Development with Ant / Ant in Action (Manning)
§ Lucene in Action (Manning)
• Apache Software Foundation
§ Committer – Lucene / Solr
§ PMC – Lucene TLP
§ Member
4
4. Why prototype?
§ Demonstrate Solr can handle your data and
searching needs; mitigate risk, learn the
unknown
§ It’s quick and easy, with very little time
investment
§ Immediate functional user interface impresses
decision makers and target users;
get buy-in
• The user interface IS the app
5
5. Prior Art
§ Hoss’ amazing ISFDB work
• http://www.lucidimagination.com/blog/tag/isfdb/
§ Previous “Rapid Prototyping with Solr” presentations
• Data.gov Catalog on Solr:
http://www.lucidimagination.com/blog/2010/11/05/data-gov-
on-solr/
• Rich text files on Solr:
http://www.lucidimagination.com/Community/Hear-from-
the-Experts/Podcasts-and-Videos/Rapid-Prototyping-
Search-Applications-Solr
• CSV (conference attendee data) on Solr:
http://www.slideshare.net/erikhatcher/rapid-prototyping-
with-solr-4312681
6
6. Rapid Prototyping using CSV
§ Fired up Solr’s example configuration
§ /update/csv
• http://localhost:8983/solr/update/csv?
commit=true&stream.file=EuroCon2010.csv&fieldnames=fi
rst,last,company,title,country&header=true&f.country.map
=Great+Britain:United+Kingdom
§ Tweak configuration
• schema: domain-centric field names
• solrconfig: /browse request handler
• Template adjustments
§ Instant classic search results view, tree map
visualization of facet data, and random selection of
contest winners
7
17. What is Prism?
§ Yet another opinionated brainstorm from Erik
§ https://github.com/lucidimagination/Prism
§ Under the covers
• Ruby
§ because it’s beautiful
• Sinatra
§ to be lightweight and have elegant flexible routing
• Velocity
§ because it is easy to learn and use, and has powerful features, facilitates
edit/refresh work
§ Separate from Solr, Rack-savvy, allows easy coding of new routes
and capabilities
§ Designed to work with any arbitrary Solr instance, and already has
some basic LucidWorks Enterprise capability
§ Totally a proof-of-concept at this point – just a quick hack
18
19. Solritas?
§ Pronounced: so-LAIR-uh-toss
§ Celeritas is a Latin word, translated as "swiftness" or
"speed". It is often given as the origin of the symbol c,
the universal notation for the speed of light - http://
en.wikipedia.org/wiki/Celeritas
§ Technically it’s the VelocityResponseWriter
(wt=velocity)
• simply passes the Solr response through the Apache
Velocity templating engine
§ http://wiki.apache.org/solr/VelocityResponseWriter
§ Built into Solr, available instantly out of the box at:
http://localhost:8983/solr/browse
20
21. Blacklight?
§ http://projectblacklight.org/
§ Blacklight is a free and open source Ruby on Rails based
discovery interface (a.k.a. “next-generation catalog”) especially
optimized for heterogeneous collections. You can use it as a library
catalog, as a front end for a digital repository, or as a single-search
interface to aggregate digital content that would otherwise be
siloed.
§ Production sites:
• http://search.lib.virginia.edu/
• http://searchworks.stanford.edu/
§ Features:
• Authentication
• Saved searches
• Bookmarks – saved result items
• Selected items – for exporting to 3rd party systems
• Customizable / extensible UI
22
22. Prototyping Tips and Tools
§ Get data into Solr in the simplest possible way
• CSV – if it fits, it’s really nice
§ Schema adjusting
• <dynamicField name="*" type="string" multiValued="true"/>
• <copyField source="*" dest="text"/>
§ Data analysis
• Understand what Solr is doing with your fields
• Solr’s Schema Browser and /admin/luke request handler
§ UI
• /browse – easy tweaking of <solr-home>/conf/velocity/*.vm
templates
23
23. Now what?
§ Script the indexing process: full and
incremental/delta
§ Work with real users on real needs
§ Integrate into production systems
§ Iterate on schema enhancements and
configuration tweaks
§ Deploy to staging/production environments and
work at scale: collection size, real queries and
volume, hardware and JVM settings
24
24. Test
§ Performance
§ Scalability
§ Relevance
§ Automate all of the above, start baselines,
avoid regressions
25