? ? ? Pending

User tests: Successful: Unsuccessful:

avatar Hackwar
Hackwar
6 Jun 2018

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

avatar Hackwar Hackwar - open - 6 Jun 2018
avatar Hackwar Hackwar - change - 6 Jun 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 6 Jun 2018
Category SQL Administration com_admin Postgresql com_finder Language & Strings Front End Installation
avatar Hackwar Hackwar - change - 6 Jun 2018
Labels Added: ? ?
avatar carlitorweb
carlitorweb - comment - 18 Jun 2018

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

avatar Hackwar
Hackwar - comment - 18 Jun 2018

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?

avatar carlitorweb
carlitorweb - comment - 18 Jun 2018

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.

avatar Hackwar
Hackwar - comment - 18 Jun 2018

@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.

avatar carlitorweb
carlitorweb - comment - 18 Jun 2018

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

avatar carlitorweb
carlitorweb - comment - 18 Jun 2018

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

add104e 19 Jun 2018 avatar Hackwar Typo
avatar Hackwar
Hackwar - comment - 19 Jun 2018

Sorry, a typo-fix was not commited. Fixed that one. Please test again. ?

avatar carlitorweb
carlitorweb - comment - 19 Jun 2018

I still got:
Warning: count(): Parameter must be an array or an object that implements Countable in ..components\com_finder\View\Search\HtmlView.php on line 163

The statistic works fine. But as you can see, the Results column only show 1, because the warning I put you above.

screenshot_20180619170512

avatar carlitorweb
carlitorweb - comment - 19 Jun 2018

Also, every time you enter in the Statisticsview 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

avatar Hackwar
Hackwar - comment - 20 Jun 2018

@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.

avatar carlitorweb
carlitorweb - comment - 20 Jun 2018

@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.

avatar Hackwar
Hackwar - comment - 20 Jun 2018

@carlitorweb I can not confirm that error message. Please don't use the pulltester for this.

avatar carlitorweb
carlitorweb - comment - 20 Jun 2018

Thank @Hackwar . Yes, I just end the test without patchtester and no get the warning. Sorry for boring with this, I just start to get the idea when use or not the patchtester

avatar carlitorweb carlitorweb - test_item - 20 Jun 2018 - Tested successfully
avatar carlitorweb
carlitorweb - comment - 20 Jun 2018

I have tested this item successfully on 8ed03d7


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/20681.

avatar Quy
Quy - comment - 21 Jun 2018

Fix year in filename 4.0.0-2918-06-06.sql

avatar Hackwar
Hackwar - comment - 21 Jun 2018

@Quy fixed the bugs.

avatar carlitorweb
carlitorweb - comment - 26 Jun 2018

Then, my local environment no was so crazy when I had this warning ;) .

avatar carlitorweb
carlitorweb - comment - 26 Jun 2018

All work ok now.
screenshot_20180626154336

avatar carlitorweb carlitorweb - test_item - 26 Jun 2018 - Tested successfully
avatar carlitorweb
carlitorweb - comment - 26 Jun 2018

I have tested this item successfully on 780205e


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/20681.

avatar TobsBobs
TobsBobs - comment - 7 Jul 2018

screen shot 2018-07-07 at 15 47 32

avatar TobsBobs
TobsBobs - comment - 7 Jul 2018

I have tested this item successfully on 7eeab91


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/20681.

avatar TobsBobs TobsBobs - test_item - 7 Jul 2018 - Tested successfully
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 7 Jul 2018

@carlitorweb can you please retest?

avatar carlitorweb
carlitorweb - comment - 7 Jul 2018

I have tested this item successfully on 7eeab91


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/20681.

avatar carlitorweb carlitorweb - test_item - 7 Jul 2018 - Tested successfully
avatar franz-wohlkoenig franz-wohlkoenig - change - 7 Jul 2018
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 7 Jul 2018

Ready to Commit after two successful tests.

avatar wilsonge wilsonge - change - 7 Jul 2018
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: ?
avatar wilsonge wilsonge - close - 7 Jul 2018
avatar wilsonge wilsonge - merge - 7 Jul 2018

Add a Comment

Login with GitHub to post a comment