Sphinx Search Engine 0.9.7, Ruby Client API 0.3.0

(MySQL, Ruby & Rails) · English (12,964 views)

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

Основные новшества 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.

5 Responses to this entry

Subscribe to comments with RSS

joost
said on 13.04.2007 at 9.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 13.04.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 27.04.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 27.04.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 30.08.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.