Sphinx 0.9.7-RC2 released, Ruby API updated

Posted by Dmytro Shteflyuk on under Ruby & Rails

Today I found that Sphinx search engine has been updated. Major new features include:

  • extended query mode with boolean, field limits, phrases, and proximity support (eg.: @title "hello world"~10 | @body example program);
  • extended sorting mode (eg.: @weight DESC @id ASC);
  • combined phrase+statistical ranking which takes words frequencies into account (currently in extended mode only);
  • official Python API;
  • contributed Perl and Ruby APIs.

I have updated Sphinx Client Library along with Sphinx 0.9.7-RC2 Windows build.

Using Sphinx search engine in Ruby on Rails

Posted by Dmytro Shteflyuk on under Ruby & Rails

Almost all Web-applications needs data search logic and really often this logic should have full-text search capabilities. If you are using MySQL database, you can use its FULLTEXT search, but it’s not efficient when you have a large amout of data. In this case third party search engines used, and one of them (and I think, the most efficient) is Sphinx. In this article I’ll present my port of Sphinx client library for Ruby and show how to use it.

Read the rest of entry »

WordPress Plugins: sCategory Permalink – select category for permalink generation

Posted by Dmytro Shteflyuk on under WordPress

I’m starting publishing custom WordPress plugins used in this blog, and today it will be “sCategory Permalink”. I like permalink option of WordPress %category% (and using it here), but it has one great limitation – when this option is selected, WordPress uses category with lowest ID for permalink generation! Just imagine following scenario: you have category “Development” (common for all posts related to software building), and several specific categories, for example “PHP”, “AJAX”, “JavaScript”. You have Development category ID greater than any of other categories IDs, therefor specific categories used for URL generation. But one day you decided to start learning Ruby on Rails and post about this in your blog. It’s the problem, because when you will create category “Ruby on Rails”, its ID will be greater then ID of “Development”. Now you have to take decision: to abandon posting in both categories at the same time, or to update “Development” category ID. Lastest can be done in two ways: remove category from WordPress administration area and re-add it (and then you need to go through all of your posts and add needed to this category), or update ID in database (there are several tables related on category ID). But now you can relax! Just download and install plugin!

Read the rest of entry »

WordPress Widgets: Ad Rotator

Posted by Dmytro Shteflyuk on under WordPress

Automattic has released fine plugin for WordPress — WordPress Widgets which can be used to personalize your blog without knowing HTML. You don’t need to edit your WordPress theme at all! Just choose required widget, drag and drop it to sidebar. There are many widgets already created by different developers which you can use on your blog.

Read the rest of entry »