delete_all is failing with v1.2.0

miika's Avatar

miika

Aug 27, 2018 @ 09:03 AM

Hi there,

So we are experiencing the same problem as described here: http://support.flying-sphinx.com/discussions/problems/29662-tsindex-gives-argumenterror-wrong-number-of-arguments-given-1-expected-0

Then again we are tied to:
ruby 2.3.4
rails 5.1.1
gem 'thinking-sphinx' ~> 3.3.0
gem 'flying-sphinx' ~> 1.2.0

Any way to get this patch to v1.2? Or workaround by forking git repo and creating branch with patch?

  1. Support Staff 1 Posted by Pat Allan on Aug 27, 2018 @ 12:02 PM

    Pat Allan's Avatar

    Hi Miika

    Ideally, I’d recommend upgrading thinking-sphinx to v4.0.0 and flying-sphinx to 2.1.2, because that’s going to be far more reliable with Rails 5.x. The changelogs and release notes are pretty thorough about any potential issues:
    https://github.com/pat/thinking-sphinx/blob/develop/CHANGELOG.markdown <https://github.com/pat/thinking-sphinx/blob/develop/CHANGELOG.markdown>
    https://github.com/pat/thinking-sphinx/releases/tag/v3.4.0 <https://github.com/pat/thinking-sphinx/releases/tag/v3.4.0>
    https://github.com/pat/thinking-sphinx/releases/tag/v4.0.0 <https://github.com/pat/thinking-sphinx/releases/tag/v4.0.0>
    https://github.com/flying-sphinx/flying-sphinx/blob/develop/CHANGELOG.markdown <https://github.com/flying-sphinx/flying-sphinx/blob/develop/CHANGELOG.markdown>

    Particularly in the case of flying-sphinx, I would expect upgrading to be a pretty simple affair. TS might be a little more complicated depending on how you’re using it.

    The flying-sphinx 1.x releases currently support Rails 2.x-4.x, and nominally 5.x, but as you’ve found out, this only works to a point. The patch supplied in the other conversation you’ve linked to will break Rails 2.x support - which I know is not really a big deal, but I’d rather keep the 1.x releases of flying-sphinx happy with those old Rails versions.

    Certainly, as a workaround you could fork flying-sphinx and apply this commit, and then you’ve got a version that works for you without going through the upgrading:
    https://github.com/flying-sphinx/flying-sphinx/commit/e1a1af4de52aa36600dcf543b5cac598856f42e1 <https://github.com/flying-sphinx/flying-sphinx/commit/e1a1af4de52aa36600dcf543b5cac598856f42e1>

    But from a long-term perspective, upgrading the gems is definitely the better approach if you’ve got the time.

    If you get stuck with any of this, do let me know.

    Regards,


    Pat

  2. 2 Posted by miika on Aug 27, 2018 @ 12:46 PM

    miika's Avatar

    Thanks for the quick reply!
    I went with the fork option for now... was stuck for a while (not running "bundle install" locally to generate a new Gemfile.lock before pushing to Heroku). But I think it's working now.

    Off-topic and maybe a dumb question but on Heroku is fs:index and ts:index aliases? Should one prefer one over the other? Thanks again.

  3. Support Staff 3 Posted by Pat Allan on Aug 27, 2018 @ 12:56 PM

    Pat Allan's Avatar

    It’s not a dumb question at all!

    If you’re using flying-sphinx 1.x or earlier, then you should use `fs:index`. It’s only since v2 that `ts:index` performs as expected no matter where you’re running it. Really, I should have taken this approach from the very beginning, because it’s been a source of confusion for a long time.

    But yes: flying-sphinx < v2: use `fs:index`. flying-sphinx >= v2: use `ts:index`.

  4. 4 Posted by miika on Aug 27, 2018 @ 01:17 PM

    miika's Avatar

    Wow, thanks for the heads up!
    Really glad I asked :)

Reply to this discussion

Internal reply

        No formatting (switch to Markdown)

        Already uploaded files

        • error.png 13.8 KB

          You can attach files up to 10MB

            If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

              Keyboard shortcuts

              Generic

              ? Show this help
              ESC Blurs the current field

              Comment Form

              r Focus the comment reply box
              ^ + ↩ Submit the comment

              You can use Command ⌘ instead of Control ^ on Mac