Closed bkd closed 1 month ago
Thanks for reporting this @bkd.
I'm not quite sure how to best approach this though, given the field is based on a custom SQL string - adding in the logic to reliably parse SQL into Thinking Sphinx feels like a significant jump in complexity for what my gut suggests is an edge-case. Not that your case isn't valid, just that I don't think it's common.
If yourself or others can come up with a solution that doesn't involve the SQL parsing/manipulation, I'd love to hear about it! But at least for now, I'm to close this issue given I'm not going to do anything about it myself at this point in time.
We have an index
__I am using apartment gem and modified thinking_sphinx/configuration.rb (sphinxmultiplier is merged again at config generation as this was causing issues of not hitting the right index multiplier - not the issue here)
produces for core and delta
where as this should be for the _delta index definition:
When running delta indexes it was taking forever as it was not having the WHERE people.delta = true clause added
fiddling around and not covering everything (I could use Arel also...not my bag though) - this worked for me
Now my delta indexing is less than 1 second again - coming down from 5 minutes a time....
I dont have LIMIT or HAVING in my sql_joined_fields - so this above does not consider this - so for my situation it works - but it will break otherwise with either of the aforementioned clauses