Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Apache Solr PHP Integration

You're reading from   Apache Solr PHP Integration Build a fully-featured and scalable search application using PHP to unlock the search functions provided by Solr with this book and ebook.

Arrow left icon
Product type Paperback
Published in Nov 2013
Publisher Packt
ISBN-13 9781782164920
Length 118 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Jayant Kumar Jayant Kumar
Author Profile Icon Jayant Kumar
Jayant Kumar
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Apache Solr PHP Integration
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Installing and Integrating Solr and PHP FREE CHAPTER 2. Inserting, Updating, and Deleting Documents from Solr 3. Select Query on Solr and Query Modes (DisMax/eDisMax) 4. Advanced Queries – Filter Queries and Faceting 5. Highlighting Results Using PHP and Solr 6. Debug and Stats Component 7. Spell Check in Solr 8. Advanced Solr – Grouping, the MoreLikeThis Query, and Distributed Search Index

Libraries available for PHP-Solr integration


Every call to Solr for executing any task is eventually a URL which needs particular parameters depending on what we need to get done. So, adding documents to Solr, deleting documents from Solr, and searching of documents can all be done by building URLs with parameters for their respective commands. We can call these URLs using PHP and cURL and interpret the response in JSON. However, instead of remembering every command to be sent in the URL, we can use a library to create the Solr URL and interpret the response. Some of the libraries available are as follows:

  • Solr-PHP-client

  • Apache Solr-PHP extension

  • Solarium

Solr-PHP-client can be obtained from the following location:

https://code.google.com/p/solr-php-client/

It can be seen that the latest release for this library was in November 2009. There have been no developments on this library since 2009. This is a very basic client and does not support a lot of features that are now available in Solr.

Apache SolrPhp extension can be obtained from the following location:

http://pecl.php.net/package/solr

The latest release for this library was in November 2011. This is a comparatively better library. And is also the library suggested for integrating with Solr on www.php.net. It is intended to be very fast and lightweight compared to others. The complete API of the library can be obtained from following location:

http://php.net/manual/en/book.solr.php

Solarium is the latest library for Solr PHP integration. It is open source and is continuously updated. It is fully object oriented and provides features almost as soon as they are made available in Solr. It is fully flexible where you can add a functionality that you feel is missing. Also custom parameters can be used to achieve almost any task. On the downside, the library is somewhat heavy as it has many files. Solarium replicates the concepts of Solr to some extent. And it is being actively developed. We will install Solarium and explore the comprehensive list of features of Solr via PHP code using the Solarium library.

You have been reading a chapter from
Apache Solr PHP Integration
Published in: Nov 2013
Publisher: Packt
ISBN-13: 9781782164920
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image