Sphinx Search Engine 0.9.7, Ruby Client API 0.3.0

Posted by Dmytro Shteflyuk on under Ruby & Rails

[lang_en]

Sphinx Search EngineIt’s happened! We all waited for Sphinx update and finally Andrew Aksyonoff has released version 0.9.7 of his wonderful search engine (who does not know about it, look my previous posts here and here).

[/lang_en]

[lang_ru]

Sphinx Search EngineСвершилось! Мы все ждали обновления Sphinx, и вот наконец Andrew Aksyonoff выпустил версию 0.9.7 своего замечательного поискового движка (для тех, кто не понимает, о чем я говорю: посмотрите мои предыдущие заметки здесь и здесь).

[/lang_ru]

[lang_en]

Major Sphinx updates include:

  • separate groups sorting clause in group-by mode
  • support for 1-grams, prefix and infix indexing
  • improved documentation

Now about Sphinx Client API for Ruby. In this version I decided that it is not so good to have different interfaces in different languages (BuildExcerpts in PHP and build_excerpts in Ruby). Therefor applications which using version 0.1.0 or 0.2.0 of API should be reviewed after update. Check documentation for details.

New things in the Sphinx Ruby API:

  • Completely synchronized API with PHP version.
  • Fixed bug with processing attributes in query response (thanks to shawn).
  • Fixed bug query processing time round-up (thanks to michael).
  • 100% covered by RSpec specifications.

You could always download latest version from the Sphinx Client API for Ruby page.

If you are using Sphinx in your Ruby on Rails application, you should try acts_as_sphinx plugin.

[/lang_en]

[lang_ru]

Основные новшества Sphinx включают:

  • separate groups sorting clause in group-by mode
  • support for 1-grams, prefix and infix indexing
  • improved documentation

Теперь о Sphinx Client API для Ruby. В этой версии я решил, что нехорошо иметь разные интерфейсы в разных языка (BuildExcerpts в PHP и build_excerpts в Ruby). Потому код приложений, в которых использовали версии 0.1.0 или 0.2.0 API, необходимо пересмотреть. Детали смотрите в документации.

Изменения в Sphinx Client API для Ruby:

  • Полностью синхронизирован API с версией PHP.
  • Исправлена ошибка с обработкой атрибутов в результатах запроса (спасибо shawn).
  • Исправлена ошибка с округлением временем обработки запроса (спасибо michael).
  • Библиотека покрыта на 100% спецификациями RSpec.

Вы всегда можете загрузить последнюю версию со страницы Sphinx Client API для Ruby.

Если Вы используете Sphinx в приложении на Ruby on Rails, посмотрите плагин acts_as_sphinx.

[/lang_ru]

5 Responses to this entry

Subscribe to comments with RSS

joost
said on April 13th, 2007 at 09:17 · Permalink

Great! Shouldn’t this version be also on RubyForge? I saw only v0.2.0 there..

BTW. My opinion is that Ruby methods should always be of the form: object.method_call. And not object.MethodCall..
But this is just my humble opinion.

said on April 13th, 2007 at 11:15 · Permalink

You are right about ruby code conventions. But it is more simple for us to have identical syntax for all languages. I would add more ruby-like syntax in 0.3.1 (hope on this weekend).

joost
said on April 27th, 2007 at 17:50 · Permalink

For those wanting backwards compatibility with set_server methods instead of SetServer. Use this code:

1
2
3
4
5
6
7
8
9
10
class Sphinx::Client
  def method_missing(m, *args)
    m = m.to_s.camelize
    if self.methods.include?(m)
      eval("#{m}(#{args})")
    else
      raise NoMethodError, "undefined method '#{m}'"
    end
  end
end
said on April 27th, 2007 at 17:54 · Permalink

Good point, thank you!

BTW,

1
eval("#{m}(#{args})")

could be rewritten using

1
self.send(m, args)
said on August 30th, 2007 at 14:50 · Permalink

Hey we just implemented it and are really really happy with it: search query duration has an average of 0,0000s on about 20.000 documents. Thats awesome.

jerk

Comments are closed

Comments for this entry are closed for a while. If you have anything to say – use a contact form. Thank you for your patience.