Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Thinking Sphinx - Delta indexing doesn't work

In my app, I need every new record to be added to the index instantly (not after rake ts:index). If I understand it correctly delta indexing is what I'm looking for. So, I added delta column to every table I'm indexing with Sphinx, set the default value to false and added set_property :delta => true to every define_index block; then ran rake ts:index and rake ts:restart. However, the "instant" indexing doesn't seem to work. When testing in console I create a new record, save it and try to search it but won't get it back (after I run rake ts:index it works just fine). Am I doing something wrong here?

like image 482
Milan Novota Avatar asked May 05 '09 09:05

Milan Novota


2 Answers

thank you for your efforts. After some pretty long exploration I found out that I just forgot to run the migration (which set the default value for delta columns to false). Now, I should get some minus points for such a stupid mistake. Sorry for bothering you and thank you once again.

like image 128
Milan Novota Avatar answered Sep 28 '22 16:09

Milan Novota


I'm having a similar problem with delta indexing not working...actually it works in my dev environment but not production. I'm confused by the statements at the beginning of the post which indicate that the default value for delta should be false. In the thinking sphinx doc at http://freelancing-god.github.com/ts/en/deltas.html it states the default value should be true:

def self.up
  add_column :articles, :delta, :boolean, :default => true,
    :null => false
end

Am I missing something?

Thanks!

like image 23
Spob Avatar answered Sep 28 '22 15:09

Spob