diem-project / diem

Diem CMF CMS for symfony 1.4
http://diem-project.org/
MIT License
184 stars 85 forks source link

search index malfunction -> dmSearchIndex bug #424

Closed jrencz closed 11 years ago

jrencz commented 12 years ago

I think I've found a bug in search-update task. in current 5.4.0-DEV try to run dm:search-update

note that only first 100 pages are indexed and they're run over and over again for several times.

now look into dmCorePlugin/lib/search/dmSearchIndex.php@103 - populate()

in my case forst 100 pages were run 4 times. I've got 303 pages. But i had 400 entities logged in dm:search-update Pager is by default set to 100 per page. With 303 DmPages it has 4 pages.

I also have the solution: changing line 163 form $pager->setPage($pagerPage)->init(); to $pager->setPage($pagerPage)->init(true);

removes the problem.

true argument means "force". See dmCorePlugin/lib/doctrine/pager/dmDoctrinePager.php@43 using "force" prevents from using cache.

By the way: i'm not making pull request because I want to be sure this really happens and my solution is actually a good one. Please check it in your installs and confirm.

TheCelavi commented 11 years ago

Well done! Good catch! Fix it, push it, I will merge it. The bug is confirmed, solutions is confirmed.

Thank you and sorry 4 late response.

Best, TheCelavi

TheCelavi commented 11 years ago

Notify me so I can close this one.

TheCelavi commented 11 years ago

@jrencz Dude, what about that fix? :)

jrencz commented 11 years ago

Sorry. No time untill Christmas

jrencz commented 11 years ago

done, https://github.com/diem-project/diem/pull/432