Hi Andrew
Sorry if this isn't clear - the WHERE clause *only* applies when you're
indexing... and so, because the delta index doesn't get invoked, no SQL is
involved - just Sphinx data. Which means that your record change is tracked,
but documents that change from reviewed to non-reviewed will still appear in
search results.
So, either you can use the string/SQL snippet option in the previous email, or
you can always filter on reviewed when searching (provided you keep that
attribute):
Model.search 'foo', :with => {:reviewed => true}
Cheers
--
Pat
On 03/03/2010, at 2:25 AM, Andrew Stewart wrote:
> Hi Pat,
>
>> This is actually the expected behaviour - though it definitely needs some
>> documentation love. Boolean, integer and timestamp attributes can all be
>> updated in the original index, so the delta is not needed in these
>> situations.
>
> That's super. I hadn't realised this so thanks for spelling it out.
>
>
>> I'm guessing in your situation it means that the WHERE clause isn't coming
>> into effect. I should add a setting to disable these 'smarter' updates - but
>> in the meantime, I guess a work-around is:
>> has "reviewed", :type => :boolean
>>
>> Using a string implies a SQL snippet, and TS can't/won't try to figure out
>> what column(s) the string references, and so will perform a delta update in
>> all situations.
>
> Given what you said in the first paragraph, the delta index is a red herring
> here. I wonder why the WHERE clause is not coming into effect?
>
> If I index via rake, the WHERE clause takes effect and reviewed items are
> excluded. Are we sure the main index is updated when a boolean attribute
> alone is updated? I can't think why else the WHERE clause wouldn't have the
> desired effect.
>
> Thanks again,
>
> Andrew
> -------
> http://airbladesoftware.com
>
> --
> 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.
>
--
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.