Apache Solr PHP Integration
eBook - ePub

Apache Solr PHP Integration

  1. 118 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Apache Solr PHP Integration

About this book

In Detail

The Search tool is a very powerful for any website. No matter what type of website, the search tool helps visitors find what they are looking for using key words and narrow down the results using facets. Solr is the popular, blazing fast, open source enterprise search platform from the Apache Lucene project. It is highly scalable, providing distributed search and index replication, and it powers the search and navigation features of many of the world's largest websites.

This book is a practical, hands-on, end-to-end guide that provides you with all the tools required to build a fully-featured search application using Apache Solr and PHP. The book contains practical examples and step-by-step instructions.

Starting off with the basics of installing Apache Solr and integrating it with Php, the book then proceeds to explore the features provided by Solr to improve searches using Php. You will learn how to build and maintain a Solr index using Php, discover the query modes available with Solr, and how to use them to tune the Solr queries to retrieve relevant results. You will look at how to build and use facets in your search, how to tune and use fast result highlighting, and how to build a spell check and auto complete feature using Solr. You will finish by learning some of the advanced concepts required to runa large-scale enterprise level search infrastructure.

Approach

This book is full of step-by-step example-oriented tutorials which will show readers how to integrate Solr in PHP applications using the available libraries, and boost the inherent search facilities that Solr offers.

Who this book is for

If you are a developer who knows PHP and is interested in integrating search into your applications, this is the book for you. No advanced knowledge of Solr is required. Very basic knowledge of system commands and the command-line interface on both Linux and Windows is required. You should also be familiar with the concept of Web servers.

Tools to learn more effectively

Saving Books

Saving Books

Keyword Search

Keyword Search

Annotating Text

Annotating Text

Listen to it instead

Listen to it instead

Apache Solr PHP Integration


Table of Contents

Apache Solr PHP Integration
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. Installing and Integrating Solr and PHP
Solr
Installing Solr
Configuring Tomcat to run Solr
Executing a ping query on Solr using PHP
Libraries available for PHP-Solr integration
Installing Solarium
Executing ping queries on Solr using PHP and Solarium library
More about endpoints
Checking Solr query logs
Solarium adapters
Summary
2. Inserting, Updating, and Deleting Documents from Solr
The Solr schema
Adding sample documents to the Solr index
Using PHP to add documents to the Solr index
Updating documents in Solr using PHP
Deleting documents in Solr using PHP
Commit, rollback, and index optimization
Summary
3. Select Query on Solr and Query Modes (DisMax/eDisMax)
Creating a basic select query with sorting and return fields
Running a query using select configuration
Re-using queries
DisMax and eDisMax query modes
Executing queries using DisMax and eDisMax
Date boosting in an eDisMax query
Advanced query parameters
Summary
4. Advanced Queries – Filter Queries and Faceting
Filter queries and their benefits
Executing filter queries
Creating filter query configuration
Faceting
Facet by field
Facet by query
Facet by range
Facet by pivot
Summary
5. Highlighting Results Using PHP and Solr
Solr highlighting configuration
Highlighting in Solr using PHP and Solarium
Using different highlighting tags for different fields
Highlighting using the fast vector highlighter
Summary
6. Debug and Stats Component
Solr relevance ranking
Executing debug through PHP code
Running debug on Solr interface
The stats component
Summary
7. Spell Check in Solr
Solr configuration for spell check
Spell checker implementations available with Solr
Running a spell check query using PHP
Implementing the autocomplete feature using PHP and Solr
Summary
8. Advanced Solr – Grouping, the MoreLikeThis Query, and Distributed Search
Grouping results by fields
Grouping results by queries
Running more like this query using PHP
More like this tuning parameters
Distributed search
Setting up a distributed search
Executing a distributed search using PHP
Setting up Solr master-slave
Load balancing Solr queries using PHP
Summary
Index

Apache Solr PHP Integration

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: November 2013
Production Reference: 1181113
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78216-492-0
www.packtpub.com
Cover Image by Aniket Sawant ()

Credits

Author
Jayant Kumar
Reviewers
Renoir Boulanger
Ruben Teijeiro
Acquisition Editor
Luke Presland
Commisioning Editor
Amit Ghodake
Technical Editors
Sharvari H. Baet
Nadeem Bagban
Project Coordinator
Suraj Bist
Proofreader
Ting Baker
Indexer
Monica Ajmera Mehta
Production Coordinator
Melwyn D'sa
Cover Work
Melwyn D'sa

About the Author

Jayant Kumar is an experienced software professional and a Bachelor of Engineering in Computer Science, with more than 12 years' of experience in architecting and developing large-scale web applications.
Jayant is an expert on search technologies and PHP and has been working with Lucene and Solr for more than 10 years now. He has been the key person responsible for introducing Lucene as a search engine in www.naukri.com, the most successful job portal in India.
Jayant has played many different important roles throughout his career, including software developer, team leader, project manager, and architect, but his primary focus has been on building scalable solutions on the web. Currently, he is associated with the digital division of HT Media as the Chief Architect responsible for the job site www.shine.com.
Jayant is an avid blogger and his blog can be visited at http://jayant7k.blogspot.in. His LinkedIn profile is available at http://www.linkedin.com/in/jayantkumar.

About the Reviewers

Renoir Boulanger is an application developer fascinated with web standards. He has been developing websites and web applications in PHP for over 10 years. His experience includes server management and web development for several communications agencies in the province of Quebec. He has created web integration libraries, and participated in the development of various specialized web applications, some of which were for big-name clients such as the W3C, Ericsson, Telefilm Canada, and the Union des Artistes du Québec.
Renoir's involvement in the W3C is as a member of developer relations and system teams, mainly contributing to the WebPlatform Docs (http://webplatform.org/) project to maintain the site stability, improve the site feature...

Table of contents

  1. Apache Solr PHP Integration

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn how to download books offline
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 990+ topics, we’ve got you covered! Learn about our mission
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more about Read Aloud
Yes! You can use the Perlego app on both iOS and Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app
Yes, you can access Apache Solr PHP Integration by Jayant Kumar in PDF and/or ePUB format, as well as other popular books in Computer Science & Open Source Programming. We have over one million books available in our catalogue for you to explore.