Administrating Solr - Surendra Mohan - E-Book

Administrating Solr E-Book

Surendra Mohan

0,0
27,59 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

Implementing different search engines on web products is a mandate these days. Apache Solr is a robust search engine, but simply implementing Apache Solr and forgetting about it is not a good idea, especially when you have to fight for the search ranking of your web product. In such a scenario, you need to keep monitoring, administrating, and optimizing your Solr to retain your ranking.

"Administrating Solr" is a practical, hands-on guide. This book will provide you with a number of clear, step-by-step exercises and some advanced concepts which will help you administrate, monitor, and optimize Solr using Drupal and associated scripts. Administrating Solr will also provide you with a solid grounding on how you can use Apache Solr with Drupal.

"Administrating Solr" starts with an overview of Apache Solr and the installation process to get you familiar with Solr. It then gradually moves on to discuss the mysteries that make Solr flexible enough to render appropriate search results in different scenarios. This book will take you through clear and practical concepts that will help you monitor, administrate, and optimize your Solr appropriately using both scripts and tools. This book will also teach you ways to query your search and methods to keep your Solr healthy and well maintained. With this book, you will learn how to effectively implement and optimize Solr using Drupal.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB
MOBI

Seitenzahl: 115

Veröffentlichungsjahr: 2013

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Table of Contents

Administrating Solr
Credits
About the Author
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. Searching Data
Installation
Request/response handling
Querying
Querying based on a particular field value
Searching for a phrase
Boosting phrases over words
Prioritizing your document in search results
Query nesting
Faceted search
Search based on the same value range
Filter your facet results
Autosuggest feature using faceting
Geospatial search
Storing geographical points in the index
Sort results by a distance from a point
Distributed search
Summary
2. Monitoring Solr
Monitoring metrics
Stats.jsp
JMX MBeans
Solr with JMX
Using password-based authentication
Singler-user environment
Multiuser environment
Agent-less health checks
Ping status
Agent-based health checks
Monitoring tools
Opsview
Solr-specific plugin
Service check set up
Host configuration
Viewing output
New Relic for PHP
Features
System requirement
SPM
What are SPM monitors?
Features
Summary
3. Managing Solr
Basic Solr scripts
User scripts.conf
Init script
Backup your Solr
Using the Solr replication handler
Backup scripts from earlier Solr releases
Configuring logging
Temporary logging settings
Permanent logging settings
Tomcat logging settings
Jetty logging settings
Collection distribution scripts
Scripts configuration
Rsyncd set up
Summary
4. Optimizing Solr Tools and Scripts
Business rules
Drools
Drools language features
Drools rule format
Drools rule language (DRL)
Domain-specific language
Guided rule editor
Other Drools features
XML rule language
Why rules?
The rule engine workflow
Benefits of using rules
Language Detection
Configuring language detection
Tika language detection
LangDetect language detection
OpenNLP (Natural Language Processing)
Sentence detection and splitting
Tokenization
Part-Of-Speech tagging
Named entity recognition
Case study – Apache Solr with Drupal 7
Autocomplete
Faceted search
Facet slider
Boosting search relevancy
Prioritizing search results
Customizing the search result display
Summary
A. Solr Resources
Index

Administrating Solr

Administrating Solr

Copyright © 2013 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 author, 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: October 2013

Production Reference: 1081013

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham B3 2PB, UK.

ISBN 978-1-78328-325-5

www.packtpub.com

Cover Image by Jeremy Segal (<[email protected]>)

Credits

Author

Surendra Mohan

Reviewers

Aamir Hussain

Anshul Johri

Acquisition Editor

Joanne Fitzpatrick

Commissioning Editor

Govindan .K

Technical Editors

Monica John

Siddhi Rane

Project Coordinator

Joel Goveya

Proofreader

Mario Cecere

Indexer

Hemangini Bari

Graphics

Yuvraj Mannari

Production Coordinator

Aditi Gajjar

Cover Work

Aditi Gajjar

About the Author

Surendra Mohan is currently a Drupal Consultant cum Architect at a well-known software consulting organization in India. Prior to joining this organization, he served a few Indian MNCs, and a couple of startups in varied roles such as Programmer, Technical Lead, Project Lead, Project Manager, Solution Architect, and Service Delivery Manager. He has around nine years of working experience in Web Technologies covering media and entertainment, real-estate, travel and tours, publishing, e-learning, enterprise architecture, and so on. He is also a speaker cum trainer, who delivers talks on Drupal, Open Source, PHP, Moodle, and so on along with organizing and delivering TechTalks in Drupal meetups and Drupal Camps in Mumbai, India.

He had also reviewed other technical books such as Drupal 7 Multi Site Configuration, Drupal Search Engine Optimization, titles on Drupal commerce, ElasticSearch, Drupal related video tutorials and many more.

I would like to thank my family and friends who supported and encouraged me in completing my reviews on time with good quality.

About the Reviewers

Aamir Hussain is a well-versed software design engineer with more than four years experience. He has excelled at problems involving breadth. He is an expert in internals knowledge gained in debugging Linux, Mac OS X, and third party components. He has developed complex software systems using Python/Django, Apache Solr, MySql, MongoDB, HTML, XML/XSD/XSLT, JavaScript, SQL, CSS, and lot more open source technologies. He is very determined to get top quality job done by continually learning new technologies.

He has also experience in analyzing and designing requirements, Web 2.0 and new technologies, Content Managements, Service Management including fixing problems, Changes control and Management, Release, Testing, Service Design, Service Strategy, and Continual Service Improvement. His specialties are complex problem solving and web portal architecture.

Anshul Johri is a geek by heart and profession. He is an expert in Solr and web development domain. He has around eight years of experience in the software industry.

He works as a freelance and consultant for web development companies.

I would like to thank my wife, Aparna, who always motivates me to do something new and different. She herself is an entrepreneur in the interior designing industry.

www.PacktPub.com

Support files, eBooks, discount offers and more

You might want to visit www.PacktPub.com for support files and downloads related to your book.

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at <[email protected]> for more details.

At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.

http://PacktLib.PacktPub.com

Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books.

Why Subscribe?

Fully searchable across every book published by PacktCopy and paste, print and bookmark contentOn demand and accessible via web browser

Free Access for Packt account holders

If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.

Preface

Solr is a popular and robust open source enterprise search platform from Apache Lucene. Solr is Java-based and runs as a standalone search server within a servlet container such as Tomcat or Jetty. It is built of Lucene Java search library as the core, which is primarily used for full-text indexing and searching. Additionally, Solr core consists of REST-like HTML/XML and JSON APIs, which makes it easy to be virtually compatible with any programming and/or scripting language. Solr is extremely scalable and its external configuration allows you to use it efficiently without any Java coding. Moreover, due to its extensive plugin architecture, you can even customize it as and when required.

Solr's salient features include robust full-text search, faceted search, real-time indexing, clustering, document (Word, PDF, and so on) handling, and geospacial search. Reliability, scalability, and fault tolerance capabilities make Solr even more demanding to the developers, especially to SEO and DevOp professionals.

What this book covers

Chapter 1, Searching data, covers the steps to install Solr, how request and response are handled, ways to query your Solr for most relevant search results, and how to use faceting, geospacial, and distributed search.

Chapter 2, Monitoring Solr, covers how we can monitor Solr, what performance metrics we should be interested in, and how to monitor Solr by using various monitoring tools such as Opsview, New Relic, and Solr Performance Monitoring.

Chapter 3, Managing Solr, covers basic scripts of managing your Solr, scripts to configure both temporary and permanent Solr logs on Tomcat and Jetty, backup your Solr, and collection distribution scripts which include configuration of scripts, SSH, and Rsyncd setup, and how to manage Solr with Drupal 7.

Chapter 4, Optimizing Solr Tools and Scripts, covers business rules and how to write custom rules using Drools, language detection, comparative study of different language detections such as CLD, LangDetect, and Tika, what is NLP, OpenNLP, how does it function and what the different phases OpenNLP consists of and how to implement Solr operation tool using Drupal 7, and the corresponding contributed Drupal modules.

Appendix, Solr Resources, lists down the necessary and essential resources in the form of reference links, books, and video tutorial, which will help you to explore Solr further.

What you need for this book

With an intention to run most of the examples in the book, you will need a XAMPP or any other Linux-based web server, Apache Tomcat or Jetty, Java JDK (latest version), Apache Solr 4.x, and Solr PHP client.

A couple of concepts in this book will require additional software and/or tools such as Tomcat Add-on, Opsview, New Relic, and Solr performance monitoring.

Who this book is for

Administrating Solr is for developers and Solr administrators who have basic knowledge of Solr and are looking for ways to keep their Solr server healthy and well maintained. Basic working knowledge on Apache Lucene is recommended, but is not mandatory.

Conventions

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

Code words in text, folder names, filenames, file extensions, pathnames, dummy URLs, and user input are shown as follows:

The field definition entry in the solrconfig.xml file tells Solr to look for all the JAR files from the ../../lib directory.

A block of code is set as follows:

<field name="id" type="string" indexed="true" stored="true" required="true" /> <field name="title" type="text" indexed="true" stored="true" /> <field name="author" type="string" indexed="true" stored="true"/>

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

<entry> <name>documentCache</name> <class>org.apache.solr.search.LRUCache</class> <version>1.0</version> <description>LRU Cache(maxSize=512, initialSize=512)</description> <stats> <stat name="lookups">3251</stat> <stat name="hits">3101</stat> <stat name="hitratio">0.95</stat> <stat name="inserts">160</stat> <stat name="evictions">0</stat> <stat name="size">160</stat> <stat name="warmupTime">0</stat> <stat name="cumulative_lookups">3251</stat> <stat name="cumulative_hits">3101</stat> <stat name="cumulative_hitratio">0.95</stat> <stat name="cumulative_inserts">150</stat> <stat name="cumulative_evictions">0</stat> </stats> </entry> <entry>

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

curl http://localhost:8080/solr/mbartists/admin/stats.jsp

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "clicking on the Next button moves you to the next screen".

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 may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to <[email protected]>, and mention the book title via 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 on 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 for all Packt books you have purchased from your account at http://www.packtpub.com. 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 would 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 erratasubmissionform link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright 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 <[email protected]> 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

You can contact us at <[email protected]> if you are having a problem with any aspect of the book, and we will do our best to address it.

Chapter 1. Searching Data

In this chapter we will cover how to install Apache Solr on your system. For instance, a Windows-based system. We will cover the following in this chapter:

Request/response handlingQueryingFaceted searchGeospatial search