![]()
Apache Solr for Indexing Data
Table of Contents
Apache Solr for Indexing Data
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Getting Started
Overview and installation of Solr
Installing Solr in OS X (Mac)
Running Solr
Installing Solr in Windows
Installing Solr on Linux
The Solr architecture and directory structure
Solr directory structure
Cores in Solr (Multicore Solr)
Summary
2. Understanding Analyzers, Tokenizers, and Filters
Introducing analyzers
Analysis phases
Tokenizers
Standard tokenizer
Keyword tokenizer
Lowercase tokenizer
N-gram tokenizer
Filters
Lowercase filter
Synonym filter
Porter stem filter
Running your analyzer
Summary
3. Indexing Data
Indexing data in Solr
Introducing field types
Defining fields
Defining an unique key
Copy fields and dynamic fields
Building our musicCatalogue example
Using the Solr Admin UI
Facet searching
Summary
4. Indexing Data – The Basic Technique and Using Index Handlers
Inserting data into Solr
Configuring UpdateRequestHandler
Indexing documents using XML
Adding and updating documents
Deleting a document
Indexing documents using JSON
Adding a single document
Adding multiple JSON documents
Sequential JSON update commands
Indexing updates using CSV
Summary
5. Indexing Data with the Help of Structured Datasources – Using DIH
Indexing data from MySQL
Configuring datasource
DIH commands
Indexing data using XPath
Summary
6. Indexing Data Using Apache Tika
Introducing Apache Tika
Configuring Apache Tika in Solr
Indexing PDF and Word documents
Summary
7. Apache Nutch
Introducing Apache Nutch
Installing Apache Nutch
Configuring Solr with Nutch
Summary
8. Commits, Real-Time Index Optimizations, and Atomic Updates
Understanding soft commit, optimize, and hard commit
Using atomic updates in Solr
Using RealTime Get
Summary
9. Advanced Topics – Multilanguage, Deduplication, and Others
Multilanguage indexing
Removing duplicate documents (deduplication)
Content streaming
UIMA integration with Solr
Summary
10. Distributed Indexing
Setting up SolrCloud
The collections API
Updating configuration files
Distributed indexing and searching
Summary
11. Case Study of Using Solr in E-Commerce
Creating an AutoSuggest feature
Facet navigation
Search filtering and sorting
Relevancy boosting
Summary
Index
![]()
Apache Solr for Indexing Data
Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: December 2015
Production reference: 1151215
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78355-323-5
www.packtpub.com
![]()
Authors
Sachin Handiekar
Anshul Johri
Reviewers
Damiano Braga
Florian Hopf
Commissioning Editor
Ashwin Nair
Acquisition Editors
Rebecca Pedley
Reshma Raman
Content Development Editor
Rohit Kumar Singh
Technical Editor
Utkarsha S. Kadam
Copy Editor
Vikrant Phadke
Project Coordinator
Mary Alex
Proofreader
Safis Editing
Indexer
Rekha Nair
Production Coordinator
Manu Joseph
Cover Work
Manu Joseph
![]()
Sachin Handiekar is a senior software developer with over 5 years of experience in Java EE development. He graduated in computer science from the University of Greenwich, London, and currently works for a global consulting company, developing enterprise applications using various open source technologies, such as Apache Camel, ServiceMix, ActiveMQ, and ZooKeeper.
He has a lot of interest in open source projects and has contributed code to Apache Camel and developed plugins for the Spring Social, which can be found on GitHub at https://github.com/sachin-handiekar.
He also actively writes about enterprise application development on his blog (http://www.sachinhandiekar.com/).
Anshul Johri has more than 10 years of technical experience in software engineering. He did his masters in computer science from the computer science department in the University of Pune. Anshul has always been a start-up mindset guy, working on fast-paced development using cutting-edge technologies and doing multiple things at a time. His core strength has always been search technology, whereby Solr plays an important role in his career. Anshul started using Solr around 9 years ago, and since then, he has never looked back. He did better and better with Solr, whether using it or contributing to the open source search community. He has used Solr extensively in all his organizations across various projects.
As mentioned earlier, Anshul has always been a start-up mindset guy. Because of that, he has worked with many start-ups in his career so far, which includes early-age and mid-size start-ups as well. To name a few, they are Ibibo.com, Asklaila.com, Bookadda.com, and so on. His last company was Amazon, where he spent around 2 years building scalable systems for Amazon Prime (a global product). Anshul recently started his own company in India with another friend from Amazon and founded http://www.r...