User tests: Successful: Unsuccessful:
Smart Search right now has no own logging, but instead uses the crappy logging of com_search, which itself is from Mambo times... The logging of com_search only logs the search term and the number of times that it was searched for and while there is an idea that it should log the statistics separately for both com_search and com_finder, it can't even distinguish between the two...
Anyway, this PR is based on issue #17437 and for now immitates the logging of com_search. In the component configuration I renamed the option to enable the logging to something that is a bit more descriptive. Then I added a new table for the logging data and in that table we now store the search term, the query object, the number of times this specific search was executed (including the filter settings), the number of given results for this and an md5sum to compare searches easily.
In the backend we have a new view, copied over from com_search mainly and updated to com_finder, that displays the statistics. At the top we have a button to reset these stats.
This PR implements the statistics that are part of com_search in com_finder, so that we can drop com_search and I would call this PR ready for now. In a second step, I would like to improve the FinderIndexerQuery class and the display of the stats to also display the filters of that search query and the language. But to be honest, I don't know how to display this nicely right now and I wanted to get this PR out there. So that would be part of another PR.
@alikon Can you check if I did the Postgres queries right? I didn't test those and just modeled them after the other queries that we have so far.
This removes a blocker for #20637
Status | New | ⇒ | Pending |
Category | ⇒ | SQL Administration com_admin Postgresql com_finder Language & Strings Front End Installation |
Labels |
Added:
?
?
|
This is mainly code copied from current com_search. Is it required that all of this is updated to the latest code or can we keep it the way it is right now and merge this?
I know you wrote, you will work more in this in other PR, but you can update the code with this move, and then work more easily in the update you want to do. No problem, if you prefer to wait.
@carlitorweb Please make sure that you have the latest version of 4.0-dev before applying this PR. It seems as if you don't have the latest updates that I did to com_finder lately.
Yes, I have the last version of 4.0-dev branch. No problem with that.
After i applied the last change, i got this:
Argument 1 passed to Joomla\Component\Finder\Site\Helper\FinderHelper::logSearch() must be an instance of Joomla\Component\Finder\Site\Helper\FinderIndexerQuery, instance of FinderIndexerQuery given, called in ..components\com_finder\View\Search\HtmlView.php on line 163
By the way, now I have the option working well, in the admin side. No more the message I had before. Sorry for this, was a mistake when I merge you PR
Sorry, a typo-fix was not commited. Fixed that one. Please test again.
Also, every time you enter in the Statistics
view the message Notice - Gathering statistics enabled
show up. I suggest to you if the option is On
no show this message, is unnecessary in my opinion
@carlitorweb Since the statistics gathering can potentially create a lot of entries in the table, there should be a notice either way, both when it is on and when it is off. That was at least the reasoning for this in the logging in com_search.
@Quy fixed.
@Hackwar can you confirm, this warning:
Warning: count(): Parameter must be an array or an object that implements Countable in ..components\com_finder\View\Search\HtmlView.php on line 163
happen only to me in the frontend? Maybe is something similar of what I had yesterday, that is why I ask.
@carlitorweb I can not confirm that error message. Please don't use the pulltester for this.
I have tested this item
Fix year in filename 4.0.0-2918-06-06.sql
Then, my local environment no was so crazy when I had this warning ;) .
I have tested this item
I have tested this item
@carlitorweb can you please retest?
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
Ready to Commit after two successful tests.
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-07-07 18:25:45 |
Closed_By | ⇒ | wilsonge | |
Labels |
Added:
?
|
I got this on the frontend:
Warning: count(): Parameter must be an array or an object that implements Countable in ..components\com_finder\View\Search\HtmlView.php on line 163