pat / thinking-sphinx

Sphinx/Manticore plugin for ActiveRecord/Rails
http://freelancing-gods.com/thinking-sphinx
MIT License
1.63k stars 468 forks source link

fixes a weird bug: search.total_pages is always 1 #1213

Closed nagybence closed 2 years ago

nagybence commented 2 years ago

under manticore 4.2.0 the pagination doesn't work because the search function returns total_pages = 1 every time

2.7.4 :001 > @books = Book.search('test', per_page: 5)
2.7.4 :002 > @books.total_count
 => 220 
2.7.4 :003 > @books.total_pages
 => 1 

search.meta => {"total"=>"5", "total_found"=>"220", "time"=>"0.000", "keyword[0]"=>"test", "docs[0]"=>"220", "hits[0]"=>"302"}

i think my fix solves this problem and doesn't generate another :)

pat commented 2 years ago

Thanks for this fix! I've been trying to get Manticore 4.2 compiling reliably on my machine - thus far, the daemon crashes during the TS test suite. But glad to have this fix merged in!

pat commented 2 years ago

Hmm, I may end up rolling this back, given Manticore 4.0 doesn't seem to like it - I'm wondering if this is actually a bug in Manticore itself?

akostadinov commented 9 months ago

If anybody cares about pagination, maybe chime in the manticore issue (manticoresoftware/manticoresearch#912) and add any input. I try to convince them to make total compatible with sphinx or add another entry that shows the same information that we presently see in sphinx. But they seem to be reluctant. And if I'm the only interested person, they might be right. So if anybody cares about manticore and pagination, probably your input would be useful.

Trevor-0995 commented 8 months ago

why are they reluctant about letting spinx join their software if the information that it can give would be useful to them? just knowing what it can gather for us it seems like we could use Metadata as well for information on any data we can use.