1. Create the Sphinx configuration file at
/usr/local/sphinx/etc/feeds.conf
with the following content:source feeds { type = xmlpipe2 xmlpipe_command = /usr/bin/php /path/to/webroot/feeds/makeindex.php xmlpipe_field = title xmlpipe_field = description xmlpipe_field = author xmlpipe_attr_timestamp = pub_date xmlpipe_attr_multi = category_id } index feed-items { source = feeds path = /usr/local/sphinx/var/data/feed-items charset_type = utf-8 } indexer { mem_limit = 64M }
2. Create the PHP script,
/path/to/webroot/feeds/makeindex.php
, to stream the XML required for indexing:<?php require('init.php'); require('simplepie.inc'); // Instantiate the simplepie class // We will use simplepie to parse the feed xml $feed = new SimplePie(); // We don't want to cache feed items $feed->enable_cache(false); $feed->set_timeout(30); // We will use PHP's inbuilt XMLWriter to create the xml structure $xmlwriter = new XMLWriter(); $xmlwriter->openMemory();...
- Tech Categories
- Best Sellers
- New Releases
- Books
- Videos
- Audiobooks
Tech Categories Popular Audiobooks
- Articles
- Newsletters
- Free Learning
You're reading from Sphinx Search Beginner's Guide
Abbas Ali has over 15 years of experience in Web Development and is a Zend Certified PHP 5 Engineer. A Mechanical Engineer by education, Abbas turned to software development just after finishing his engineering degree. He is a member of the core development team for the Coppermine Photo Gallery, an open source project which is one of the most popular photo gallery applications in the world. Fascinated with both machines and knowledge, Abbas is always learning new programming techniques and technologies. Amongst various technologies, some of his favorites are Laravel, VueJS, and Sphinx. He got acquainted with Sphinx in 2009 and has been using it in most of his commercial projects ever since. He loves open source and believes in contributing back to the community. Abbas is married to Tasneem and has two daughters, Munira and Zahra. He has lived in Nagpur (India) all his life and is in no rush to move to any other city in the world. In his free time he loves to watch movies and television. He is also an amateur photographer and cricketer. Abbas founded Ranium Systems, a web and mobile development company in 2012 and is currently working as its Chief Executive Officer. The company specializes in development of enterprise level, high performance and scalable web and mobile applications
Read more about Abbas Ali
Unlock this book and the full library FREE for 7 days
Author (1)
Abbas Ali has over 15 years of experience in Web Development and is a Zend Certified PHP 5 Engineer. A Mechanical Engineer by education, Abbas turned to software development just after finishing his engineering degree. He is a member of the core development team for the Coppermine Photo Gallery, an open source project which is one of the most popular photo gallery applications in the world. Fascinated with both machines and knowledge, Abbas is always learning new programming techniques and technologies. Amongst various technologies, some of his favorites are Laravel, VueJS, and Sphinx. He got acquainted with Sphinx in 2009 and has been using it in most of his commercial projects ever since. He loves open source and believes in contributing back to the community. Abbas is married to Tasneem and has two daughters, Munira and Zahra. He has lived in Nagpur (India) all his life and is in no rush to move to any other city in the world. In his free time he loves to watch movies and television. He is also an amateur photographer and cricketer. Abbas founded Ranium Systems, a web and mobile development company in 2012 and is currently working as its Chief Executive Officer. The company specializes in development of enterprise level, high performance and scalable web and mobile applications
Read more about Abbas Ali