A note about #search vs #search_each


I just “solved” an issue which I mentioned on this list many moons ago,
regarding searches somehow being serialized, such that a long search
would cause others to wait noticeably.

Anyhow, after coding both :limit and applying homegrown thread time
limit monitoring, I discovered that Searcher#search_each uses
rb_thread_critical = Qtrue whereas Searcher#search doesn’t.

I changed my code to use TopDocs and Searcher#search and viola,
concurrent searches!



This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs