mongoid / mongoid_fulltext

An n-gram-based full-text search implementation for the Mongoid ODM.
MIT License
150 stars 66 forks source link

Indexing with timeout disabled gives an ArgumentError Exception #48

Open chasemcdo opened 2 years ago

chasemcdo commented 2 years ago

Following the documentation I am able to build an index using Artwork.update_ngram_index; however, some of the datasets I wish to query require the disablement of timeout.

Artwork.update_ngram_index(timeout: false)

Returns the following error:

(byebug) Artwork.update_ngram_index(timeout: false)
*** ArgumentError Exception: wrong number of arguments (given 1, expected 0)

I notice two declarations of update_ngram_index which could be where my issues stem from. The first doesn't appear to have been updated to take in arguments and is what my code seems to be invoking.

The second was updated to allow arguments, but doesn't seem to get invoked by my code.

I believe to have worked around this issue by directly calling Artwork.each(&:update_ngram_index) though this could be an issue with my own setup if others are not experiencing this.

dblock commented 2 years ago

Looks like we missed it. Care to PR?

This library needs a bit of work, hasn't been updated for a while. Maybe move from Travis-CI to GHA, and add support for mongoid8 first? See the last PRs on https://github.com/mongoid/mongoid-compatibility for some changes to copy-paste.