Got data? Let's make it searchable! This interactive presentation will demonstrate getting documents into Solr quickly, provide some tips in adjusting Solr's schema to match your needs better, and finally 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.
Take control of your SAP testing with UiPath Test Suite
Rapidly Prototype Search with Solr
1. 1
Rapid Prototyping
with
Solr
presented by
Erik Hatcher, Technical Staff, Lucid Imagination
1
2. Abstract
Got data? Let's make it searchable! This interactive
presentation will demonstrate getting documents into
Solr quickly, provide some tips in adjusting Solr's
schema to match your needs better, and finally 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.
2
2
3. Why prototype?
Demonstrate Solr can handle your needs
Buy-in
"Prototyping: faster than teaching a 9-year-old
Ju-Jitsu"
It's quick, easy, AND FUN!
The User Interface is the app
3
3
4. Got Data?
Files?
Solr Cell
Databases?
Data Import Handler
Feeds (Atom/RSS/XML)?
Data Import Handler
3rd party repositories?
Lucene Connectors Framework
custom indexing scripts using a Solr API
CSV!!!
CSV upload handler
4
4
6. LucidWorks for Solr
great starting point
built-in and pre-configured:
Clustering
Carrot2
Search UI
Solritas (VelocityResponseWriter)
Server includes root context, handy for serving static files
Better stemming
KStem
Tomcat, optionally
6
6
7. ~/LucidWorks: start.sh
2010-05-21 08:53:49.595::INFO: Logging to STDERR via
org.mortbay.log.StdErrLog
2010-05-21 08:53:49.764::INFO: jetty-6.1.3
May 21, 2010 8:53:50 AM org.apache.solr.core.SolrResourceLoader
locateSolrHome
INFO: JNDI not configured for solr (NoInitialContextEx)
May 21, 2010 8:53:50 AM org.apache.solr.core.SolrResourceLoader
locateSolrHome
INFO: using system property solr.solr.home: /Users/erikhatcher/
LucidWorks/lucidworks/jetty/../solr
May 21, 2010 8:53:50 AM org.apache.solr.core.SolrResourceLoader <init>
INFO: Solr home set to '/Users/erikhatcher/LucidWorks/lucidworks/
jetty/../solr/'
.
.
.
May 21, 2010 8:53:51 AM org.apache.solr.core.SolrCore registerSearcher
INFO: [] Registered new searcher Searcher@21fb3211 main
7
7
8. Your Data
First Name,Last Name,Company,Title,Work Country
Erik,Hatcher,Lucid Imagination,"Member, Technical Staff", USA
.
.
.
8
8
14. Schema tinkering
Removed all example field definitions
Uncomment and adjust catch-all dynamic field:
<dynamicField name="*" type="string" multiValued="false"/>
Ensure uniqueKey is appropriate
Unusual in this data example:
<!-- <uniqueKey>id</uniqueKey> -->
Make every document/field fully searchable!
<copyField source="*" dest="text"/>
Then restart!
14
14
15. Issues with no uniqueKey
Remove from solrconfig.xml references to:
clustering component
query elevation component
data import handler
Then restart!
15
15
16. Reindexing with cleaner field names
# Delete all documents
curl "http://localhost:8983/solr/update?stream.body=%3Cdelete%3E%3Cquery
%3E*:*%3C/query%3E%3C/delete%3E&commit=true"
# Index your data
curl "http://localhost:8983/solr/update/csv?
commit=true&stream.file=EuroCon2010.csv&fieldnames= first,last,
company,title,country&header=true"
16
16