PacktLib: Apache Solr PHP Integration

Apache Solr PHP Integration

Credits

About the Author

About the Reviewers

www.PacktPub.com

Preface

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

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

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

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

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

Debug and Stats Component

Solr relevance ranking

Executing debug through PHP code

Running debug on Solr interface

The stats component

Summary

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

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