We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5811
    • 1,717 Posts
    Following this post : Capturing failed search criteria..., with the version 1.8.2 (or may be 1.9) in development, described here, I prepare a new feature for AjaxSearch: AjaxSearch logging & the AjaxSearch logs manager module

    The goals of this new feature are to:
    - keep an eye on what users are searching for in order to help you manage your home page and navigation in general.
    - extract the most used search terms that could be use as meta tag keywords for ranking
    - catch the end-user comment regarding unsuccessfull searches
    - detect unsuccessfull searches and may be incorrect AS snippet call wink and play again them

    The detailed specifications are listed below. You could run a first implementation step here.

    Thanks for your suggestions, advices or feedbacks about this feature.


    ==== Capturing failed search criteria and search logs - AJAXSEARCH-3

    &asLog - ajaxSearch log [ 0 | 1 | 2 ]

    0 : disallow the ajaxSearch log recording (default)
    1 : failed search requests are logged
    2 : all ajaxSearch requests are logged

    The user searches are stored in the database table $modx_table_prefix."ajaxsearch_log"
    These data are not for the end user only for the site administrator.

    Informations stored per each search are the following:

    - id : internal id of the search request
    - searchstring : the search terms used for the search
    - nb_results : number of results found
    - results : document ids found
    - as_call : ajaxSearch snippet call used
    - as_select : select statement used (could be directly re-used thru phpmyadmin)
    - date : date and hour of the request
    - comment : user comment regarding the search
    - ip : user IP

    The table could be drop without any impacts on the AjaxSearch behaviour. Simply, if the asLog parameter is set and the table inexisting, the table is rebuilt.


    A module will be provided later to manage these search datas. But we could imagine the following features:
    - drop the table
    - delete (successfull, unsuccessfull, all) searches executed before a specific date
    - delete (successfull, unsuccessfull, all) searches executed before N days
    - give me as meta tag keywords, the N most used (successfull, unsuccessfull) search terms
    - replay a specific search with a new debug level

    I plan to add a "did you find what you are looking for?" comment available for the user to catch the reasons of unsuccessfull (or successfull but not relevant) search. The user comment will be added into the table with the other data.

    So, around comments, we could add the following features in the ajaxSearch log manager:

    - delete uncommented (successfull, unsuccessfull, all) searches
    - filter view with commented (successfull, unsuccessfull, all) searches
      • 25663 MODX Staff
      • 12,272 Posts
      Very nice work coroico. You might want to talk to Bob to implement a few anti-bot measures from SPFform to prohibit this from becoming another Spam source. (But please not captcha!) Keep up the great work. smiley
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 5811
        • 1,717 Posts
        Since the last post I have added the catch of the user comment. You could run this feature with the ajax mode or the non-ajax mode of AjaxSearch.

        For instance try "africa" or anything else on this page or "guatemala" or anything else on this one. After commenting the results, you could see your commented search requests logged on this page.

        All the pages of the 1.8.2 demo site provide the logging of the search and the catch of a user comment.


        I will add an anti-bot measure in the next step. Thanks for your feedbacks about this feature described with 1.8.2 here.
          • 5811
          • 1,717 Posts
          Is the ajaxSearch loging and the catch of user comment a feature really requested by most of you ?
          As I got only one feedback from Ryan, I am a bit sceptic on the interest of this feature. Thanks to leave your feedback on the interest of this new possible feature.
            • 7231
            • 4,205 Posts
            I am interested in this feature. To have a search log and recent searches feature is very cool. I have been busy with a few projects that are not using AS so I have not had a chance to think about it much, but I think it would be a great feature.
              [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

              Something is happening here, but you don't know what it is.
              Do you, Mr. Jones? - [bob dylan]
              • 33337
              • 3,975 Posts
              coroico, I like what I read, and I am also interested.

              We’ve been working on a site with lots of data, and since I said "lots" the search results are pretty scattered. So by using the log feature we can better adjust the search like you wrote in your first post, and that will add a BIG value to what we can deliver to end user in regard to user experience.

              ... and that is only 1 aspect, I can think of immediately smiley
                Zaigham R - MODX Professional | Skype | Email | Twitter

                Digging the interwebs for #MODX gems and bringing it to you. modx.link
                • 30223
                • 1,010 Posts
                Although I don’t have a use for it right now I see this as a very valuable addition, certainly for larger sites. I can even see a application of the successful search data for "auto suggestions" in the search box at some time.
                  • 32873
                  • 9 Posts
                  I would appreciate that feature as well! Just what I was looking for!;)

                  Please implement this to AjaxSearch!
                    • 2740
                    • 95 Posts
                    Being able to record the search logs is very important, thank you for implementing it in AjaxSearch.

                    What is the command to produce a list of the search logs as produced on www.modx.wangba.fr/index.php?id=298?
                      • 5811
                      • 1,717 Posts

                      More information on this demo page.

                      With As 1.8.4 / 1.8.5, the list of the demo site is produced by using the snippet Db2Form:

                      [!Db2form? &table=`modx_ajaxsearch_log` &type=`select` &order_by=`id DESC` &per_page=`10` &title=`AjaxSearch logs`!] 
                      

                      With the version AS 1.9.0 a module is provided, to list (in the manager), the search requests run by user.