0

I am facing problem in thinking sphinx

What i have following table structure

title => varchar
desc => varchar
is_deleted => boolean

Here is my denine_index

define_index do
      indexes title, :sortable => :insensitive
      has :is_deleted, :type=>:boolean
      where "is_deleted = false"
      set_property :delta => true
    end

Here when I edit the topic and search it with edited name, I get the topic and when I search it with old name I get the same topic. For eg if earlier topic had name "Foo" and I renamed "Foo" to "Woo", on searching "Woo" I get "Woo", but on searching "Foo", I again get "Woo". Moreover when I set is_deleted => true and search "Woo" I don't get anything, but on searching "Foo" again I get "Woo". I can't understand why it is happening? Does sphinx don't delete the older index on creating newer index for delta=true.

Again on rebuilding sphinx, i don't get such problems, and all delta is set to false as expected.

Paritosh Singh
  • 6,288
  • 5
  • 37
  • 56
  • I would like you to observe rails logs whether or not indexes getting built. Also you can add debug statement such as logger.info object.inspect before and after the indexing happens i.e. object save b4 n after object save call. – Sandip Ransing Aug 14 '12 at 08:10
  • are you having the field `delta` (boolean field) in your model? – PradeepKumar Aug 14 '12 at 09:41
  • no delta is working fine, but it is not re-indexing, as I told if I search using old topic name I can see new topic, even when it is updated. – Paritosh Singh Aug 14 '12 at 12:02

1 Answers1

0

Use sphinx sql_query_killist to kill results from main index when you know it exists in your delta index similar to these: http://sphinxsearch.com/docs/1.10/conf-sql-query-killlist.html

Rahul garg
  • 9,202
  • 5
  • 34
  • 67