2015年4月13日星期一

SitePoint PHP Blog: Integrate Elasticsearch with Silex


The SitePoint PHP blog has continued their look at integrating Elasticsearch into a simple Silex-based PHP application. In this latest part of the series (part two) they move away from the full Drupal example in part one and go a bit more simple and create a basic site to show a node's detail (content and title).



In the previous article I started exploring the integration between Drupal 7 and the Elasticsearch engine. The goal was to see how we can combine these open source technologies to achieve a high performance application that uses the best of both worlds. [...] We'll now create a small Silex application that reads data straight from Elasticsearch and returns it to the user.


Using Silex and the same Elasticsearch PHP SDK they create this simple site. The tutorial walks you through the installation of both tools, the configuration of the Elasticsearch client and creating the controllers to respond to the view requests. They also show how to use the Twig templating engine to render the results as a simple page containing the node title, any images attached to it and the body content. The tutorial ends with a brief mention of how this same data could also be rendered as JSON output with a different view handler.


Link: http://www.sitepoint.com/integrate-elasticsearch-silex/

没有评论:

发表评论