Book Image

Apache Solr for Indexing Data

Book Image

Apache Solr for Indexing Data

Overview of this book

Apache Solr is a widely used, open source enterprise search server that delivers powerful indexing and searching features. These features help fetch relevant information from various sources and documentation. Solr also combines with other open source tools such as Apache Tika and Apache Nutch to provide more powerful features. This fast-paced guide starts by helping you set up Solr and get acquainted with its basic building blocks, to give you a better understanding of Solr indexing. You’ll quickly move on to indexing text and boosting the indexing time. Next, you’ll focus on basic indexing techniques, various index handlers designed to modify documents, and indexing a structured data source through Data Import Handler. Moving on, you will learn techniques to perform real-time indexing and atomic updates, as well as more advanced indexing techniques such as de-duplication. Later on, we’ll help you set up a cluster of Solr servers that combine fault tolerance and high availability. You will also gain insights into working scenarios of different aspects of Solr and how to use Solr with e-commerce data. By the end of the book, you will be competent and confident working with indexing and will have a good knowledge base to efficiently program elements.
Table of Contents (18 chapters)
Apache Solr for Indexing Data
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Preface

Welcome to Apache Solr for Indexing Data. Solr is an amazing enterprise tool that gives us a search engine with various possibilities to index data and gives users a better experience. This book will cover the various indexing methods that we can use to improve the indexing process by covering step-by-step examples.

The book is all about indexing in Solr, and we'll cover all the possible topics in Solr that developers can use in their use cases by following simple examples.

What this book covers

Chapter 1, Getting Started, covers the basic setup and installation needed to run Solr. It also covers the directory structure and the main configuration files used by Solr.

Chapter 2, Understanding Analyzers, Tokenizers, and Filters, shows you the basic building blocks of Solr, such as analyzers, tokenizers, and filters. These help in the indexing of data. This chapter also covers the most commonly used components in detail and how they work together.

Chapter 3, Indexing Data, helps you get a better understanding of how indexing works in Solr by building a real-life example that covers various aspects, for example, the copy field, facet, indexing time boosting, and so on.

Chapter 4, Indexing Data – The Basic Techniques and Using Index Handlers, covers various techniques by which we can index data in Solr. This chapter explains the various request handlers that are used by Solr to index CSV, JSON, and XML data type documents.

Chapter 5, Indexing Data Using Structured Datasource Using DIH, covers how we can use indexed data from a database by using the data import handler available in Solr.

Chapter 6, Indexing Data Using Apache Tika, illustrates the integration of Apache Tika with Solr for the indexing of documents.

Chapter 7, Apache Nutch, covers the integration of Apache Nutch with Solr for indexing crawl data from the Internet.

Chapter 8, Commits, Real-Time Index Optimizations, and Atomic Updates, shows us how we can use the real-time indexing features available in Solr and utilize these features to provide a real-time search experience.

Chapter 9, Advanced Topics – Multilanguage, Deduplication, and Others, covers advanced topics such as indexing multilanguage documents and removing duplicate documents from Solr.

Chapter 10, Distributed Indexing, tells us how we can utilize SolrCloud to provide a high-availability and fault-tolerant cluster.

Chapter 11, Case Study of Using Solr in E-Commerce, covers a case study by going through easy-to-use, simple examples that can be used in an e-commerce website.

What you need for this book

We are going to cover various approaches to Solr indexing. Each chapter will introduce different approaches with different software. Also, each chapter will cover the installation steps/instructions needed to run the examples for the specific scenario.

The minimal installation which we'll need to run the example code are as follows:

  • JDK 1.6+ (the JAVA_HOME variable should be set up correctly on the system path)

  • Apache Solr 4.10.1

  • The cURL tool (Windows users can download it from http://curl.haxx.se/download.html)

Who this book is for

This book is for developers who want to increase their experience of indexing in Solr by learning about the various index handlers, analyzers, and methods available in Solr. Beginner level Solr development skills are expected.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "We can include other contexts through the use of the include directive."

A block of code is set as follows:

<solr persistent="false">
<cores adminPath="/admin/cores" defaultCoreName="core1">
<core name="core1" instanceDir="core1"/>
<core name="core2" instanceDir="core2"/>
</cores>
</solr>

Any command-line input or output is written as follows:

$cd $SOLR_HOME/example/exampledocs/
$./post.shvidcard.xml

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "Click on Install service. You should get a service successfully installed message."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail , and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at , and we will do our best to address the problem.