Thanks for the reply Pat, unfortunately I think this was a case of me
being ignorant :-( I checked the setup and realised that I had a where
condition on the index which meant that when the deleted flag was set,
some application logic would change some other attributes such that
the record would no longer meet the where condition in the index. This
resulted in the strange situation where the delta would not be able to
index the change, and the main index record would remain.

I may play around with the structure and see what I can come up with -
worst case scenario I guess I could save at the deleted = 1 stage,
which would trigger a successful delta before I apply the extra logic
(although that sounds rather ugly).

Another issue I have found with deltas is that I cannot seem to get a
successful delta update of attributes which are from an association,
e.g.

An item has_and_belongs_to_many groups, and the group_id is an
attribute in the item index. If I change the groups the item belongs
to, the item is correctly flagged with delta = true (and the delta
indexer is run), but it does not seem to pick up the group changes.
Any thoughts on that one? I've even tried doing an item.touch within a
console on a record where the main index has the wrong groups, and
while the delta is run, the record can still be found using incorrect
filters.

Thanks,

Philip



On Sep 2, 11:17 pm, Pat Allan <[email protected]> wrote:
> Thinking Sphinx will update attributes if they are integers, booleans  
> or timestamps if they are the only values that have changed (ie: no  
> fields, float, MVA or custom-sql attributes). So it looks like it's  
> updating both the core and delta index with that information in this  
> case.
>
> That doesn't answer why the filter isn't working, though.
>
> How are you handling deletions? Are you overwriting destroy? Also,  
> what versions of TS, Sphinx and Rails are you using?
>
> How long are you waiting to test the search after updating that  
> attribute? Sphinx may take a second or two for the changes to kick in  
> (depends on how powerful the machine is, spare memory, etc).
>
> --
> Pat
>
> On 02/09/2009, at 11:01 PM, monkeyten wrote:
>
>
>
>
>
> > I seem to have a strange problem with my delta indexes and filtering
> > on attributes which I hope someone can shed some light on.
>
> > In my model there is a deleted attribute (a boolean field). Searching
> > on a fresh (full) index will correctly only return results with
> > deleted = 0 if I use :with => {:deleted => 0}. If one of the records
> > is then updated (so deleted = 1), it appears as if both the core and
> > the delta index are updated (based on the query log - not sure if this
> > is the correct interpretation):
>
> > [Wed Sep  2 21:59:16.945 2009] 0.000 sec [scan/2/rel 1 (0,20)]
> > [item_core]
> > [Wed Sep  2 21:59:16.949 2009] 0.000 sec [scan/2/rel 0 (0,20)]
> > [item_delta]
> > [Wed Sep  2 21:59:16.954 2009] 0.000 sec [scan/2/rel 1 (0,20)]
> > [item_core]
>
> > Future searches using the same :with filter will however still return
> > the object which now has deleted = 1 (unless I do a full reindex).
>
> > Can anyone shed any light on the issue?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/thinking-sphinx?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to