Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Peter Steenbergen:
How to use PHP solarium in a Laravel project
Jul 29, 2016 @ 15:22:09

In this post to his site Peter Steenbergen shows you how to integrate SOLR searching into your Laravel application via the PHP Solarium library.

This is my second blog in a series about SOLR with the PHP Solarium library. My first blog was about the usage of OR filters to create Multi-Select facets with SOLR. With this blog item I will show you how easy it is to implement the PHP Solarium library in the Laravel framework.

He starts off with a fresh Laravel install and configures it to connect to a local SOLR server (he assumes you already have one running at this point). The he installs the Solarium library through Composer and makes a new service provider to create the client and bind it to the dependency injection container (app). To test the connection he makes a basic controller with one endpoint and an injected version of the Solarium client. With this working, he introduces the code from his previous post allowing for multi-select facet searching to return matching results.

tagged: solarium laravel project introduction solr search multiselect facet

Link: http://petericebear.github.io/laravel-php-solarium-integration-20160725/

SitePoint PHP Blog:
Geospatial Search with SOLR and Solarium
Nov 25, 2014 @ 19:55:56

The SitePoint PHP blog has a new post from Lukas White that gets into the details of combining SOLR searching with Solarium to perform geospatial queries.

In a recent series of articles I looked in detail at Apache’s SOLR and Solarium. To recap; SOLR is a search service with a raft of features – such as faceted search and result highlighting – which runs as a web service. Solarium is a PHP library which allows you to integrate with SOLR – whether local or remote – interacting with it as if it were a native component of your application. If you’re unfamiliar with either, then my series is over here, and I’d urge you to take a look. In this article, I’m going to look at another part of SOLR which warrants its own discussion; Geospatial search.

He uses a simple example, locating airports near a given location, to give a more "real world" idea of how it all works. He starts by introducing the concept of geospatial searching and the idea of "points" as they relate to a specific location. He then gets into the actual setup of the application, including the SOLR schema configuration and making the queries on the data. The Solarium library allows for simple location queries when given just the "latlong" helper type and the location/distance to use for the starting point. He uses the data from the OpenFlights service to gather the airport data and creates a search form and basic list output of the results from searches on it. If you'd like to see the end result in action, check out this demo website.

tagged: solr search solarium library tutorial geospatial query airport demo

Link: http://www.sitepoint.com/geospatial-search-solr-solarium/

SitePoint PHP Blog:
Using Solarium with SOLR for Search – Advanced
May 08, 2014 @ 16:56:46

The SitePoint PHP blog has finished off their series showing you how to integrate searching with SOLR (via Solarium) into your PHP application. In this last part of the series, Lukas White gets into some of the more advanced topics around searching and handling the resulting output in your views.

In the first three parts we installed and configured SOLR and Solarium and started building an example application for searching movies. We’ve also looked at faceted search. We’re going to wrap up the series by looking at some more advanced features of SOLR, and how to use them with Solarium.

He's broken up the rest of the tutorial to talk about a few of these more advanced features like:

  • Highlighting search matches in the output of documents (depending on the type of match)
  • Using the searching for an autocomplete
  • Configuring and making the request with an array-based configuration (a more manual process)
  • Adding additional cores to the search (allowing for more flexibility on search styles and configurations)

He also points to two other resources that could be handy along your path to SOLR dominance: the SOLR reference guide and the official Solarium documentation.

tagged: solr search solarium library tutorial series part4 advanced

Link: http://www.sitepoint.com/using-solarium-solr-search-advanced/

SitePoint PHP Blog:
Using Solarium with SOLR for Search – Implementation
May 07, 2014 @ 15:54:10

The SitePoint PHP blog has posted the third part of their series looking at using the Solarium tool to hook your PHP application into a SOLR search instance. In this latest part of the series they get down to the actual search implementation.

In the first part I introduced the key concepts and we installed and set up SOLR. In part two we installed and configured Solarium, a library which enables us to use PHP to “talk” to SOLR as if it were a native component. Now we’re finally ready to start building the search mechanism, which is the subject of this installment.

He starts with a simple search example, making a request to select the matches for a given query (given on the URL as a variable "q"). He shows how to run the select and fetch the results as a result set. He enhances this, containing the search logic inside a class and making a template to show the results. He also includes examples of how to use the "Disjunction Max", sorting and pagination functionality. Finally, he looks at a more complex type of search, a faceted search, and includes code examples of making the request and displaying the results.

tagged: solr solarium search engine tutorial implement basics faceted

Link: http://www.sitepoint.com/using-solarium-solr-search-implementation/

SitePoint PHP Blog:
Using Solarium with SOLR for Search – Solarium and GUI
May 06, 2014 @ 18:49:34

The SitePoint PHP blog continues their series looking at the use of the Solarium tool to work with the SOLR searching tool in PHP. In this latest part (part two) of the series they move beyond the setup and configuration and get into some actual code to use the server.

This is the second article in a four part series on using Solarium, in conjunction with Apache’s SOLR search implementation. In the first part, I introduced the key concepts and we installed and set up SOLR. In this second part we’ll install Solarium, start building an example application, populate the search index and get into a position where we can start running searches.

The frontend, based on the Laravel framework, is simple to get up and running with just a few lines of code. They walk you through the basic CRUD kinds of steps, "pinging" the server to ensure it's up and searching the documents you've added.

tagged: solarium solr search gui laravel crud

Link: http://www.sitepoint.com/using-solarium-solr-search-solarium-gui/

SitePoint PHP Blog:
Using Solarium with SOLR for Search - Setup
May 02, 2014 @ 16:49:16

The SitePoint PHP blog has posted a tutorial showing you how to use the Solarium library to search SOLR. Solarium is a PHP-based, open source tool that helps make interfacing with a SOLR search instance much easier. This post is part one of a larger series covering the combination of SOLR and Solarium.

Apache’s SOLR is an enterprise-level search platform based on Apache Lucene. It provides a powerful full-text search along with advanced features such as faceted search, result highlighting and geospatial search. [...] If you’re using PHP then the Solarium Project makes integration even easier, providing a level of abstraction over the underlying requests which enables you to use SOLR as if it were a native implementation running within your application. In this series, I’m going to introduce both SOLR and Solarium side-by-side.

He starts with some of the basic concepts behind what SOLR is, what kinds of things it's useful for and how to get it installed on your system (using Homebrew). He shows how to set up a sample schema including a detailed look at the different types and required fields it will need. As this is just the first part of the series, it stops there and will get into the actual PHP code for the interface in the next edition.

tagged: solr solarium search engine tutorial interface opensource library

Link: http://www.sitepoint.com/using-solarium-solr-search-setup/

Jeroen van Dijk:
Multi-select faceting in Solr with Solarium
Nov 07, 2012 @ 18:14:14

If you're a user of the Solarium tool for querying Solr database already and have been wondering how to work with faceting, you should take a look at this new post from Jeroen van Dijk. He covers using Solarium to do multi-select faceting in a Solr query.

Solarium is a library I often use at Enrise for querying Solr. For one of the projects I work on, AutoTrack.nl a second hand car site, I was having issues on advanced faceting with Solr which I could easily solve using Solarium. [...] Faceting is a technique for guided navigation where search results are separated into categories, often including counts on those categories. The user can then select from those categories to restrict their search step by step.

He includes an example of what kind of results this sort of searching could return and how you can use the "facet.mincount" to restrict the results to an even finer set. There's a bit of code included showing how to use this filtering method with a combination of "addFilterQuery" and "createFacetField" calls before executing the select through Solarium.

tagged: solr search solarium facet mincount tutorial

Link:

Bas De Nooijer's Blog:
Benchmarking PHP Solr response data handling
Mar 02, 2012 @ 15:08:03

On his blog Bas De Nooijer has put together some PHP Solr benchmarks around a few different ways to handle the response data.

Solr supports multiple output formats. Some are for general use (xml, json) and some are even language specific. If you’re using PHP these are the most logical response writer formats: xml, json, phps (serialized php), php (php code to execute). On top of that PHP offers multiple ways to parse XML. I’m benchmarking these options to determine the most efficient decoding to implement in the next major version of Solarium, but the results should be useful for any PHP Solr implementation.

He includes a snippet of code he's using to generate the benchmarks, a PHPUnit test that pulls in two different json-based results and, for now, just runs a json_decode on it. You can see the results of his testing here, graphing out the different response handling methods and their time (in milliseconds) to parse the response. It's interesting to see that there's a direct relation to the size of the data set and how long it takes for the methods to execute.

The current code for his benchmarks is available over on github

tagged: solr response handling solarium benchmark

Link:

DZone.com:
Solarium PHP Solr client
Apr 07, 2011 @ 15:09:31

New on DZone.com today there's an article from Bas De Nooijer talking about a new tool he's created to allow PHP to work directly with Solr (the popular searching platform from the Apache project) as a result of research he'd done from a previous article. The result is < href="https://github.com/basdenooijer/solarium">Solarium, an open sourced PHP client for Solr.

I’ve worked on a lot of Solr implementations in PHP applications. There are multiple solutions: manual HTTP requests, the solr-php-client library, custom implementations etcetera. However they all have one issue in common: they only handle the communication with Solr, many other important parts like query building are not covered at all. And the parts that are covered are usually over-simplified. [...] At first I developed it as a library for my own projects, but I’ve decided to turn it into an opensource project. The project is called 'Solarium' and can be found on github: https://github.com/basdenooijer/solarium

You can find complete details about the project over on its wiki including basics concepts of query flow and using the ping/select/update query methods to access your Solr server.

tagged: solarium solr client github opensource search

Link:


Trending Topics: