We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2901
    • 277 Posts
    Hi all

    in one of my installations AjaxSearch is not listing web links, even when they are set searchable. Is there a way I can include web links in the search results?

    EVO 1.0
    AjaxSearch 1.8.3

    Tanks a lot
      • 5811
      • 1,717 Posts
      If a link contains a term, it can be found by the search. But by default the defaultStripOutput function strip all the html tags before to set up the extract. This avoid to display partially a html tag broken by the extract function.

      To display the links, use your own stripOutput function and increase the extract length to be sure to keep all the html tag.
        • 2901
        • 277 Posts
        the problem is that also the titles from the web links are not shown. It is as if all documents which are of type web link are excluded from the search. But the checkbox searchable is selected.
          • 5811
          • 1,717 Posts
          Apologies, I didn’t understand your first remark.

          By default the parameter &hideLink=`1`, which means that Modx reference documents are not searchable (even if the checkbox searchable is selected)
          If you would like add the reference documents as searcheable, add &hideLink=`0` in your snippet call or change your configuration file.

          ---- &hideLink [0 | 1] : Search in content of type reference   (optional)
          
                  - 0 : search in content of document AND reference type
                  - 1 : search only in content of document type (default)
            • 2901
            • 277 Posts
            Thanks

            I have added
             &hideLink=`0`


            but no change. These web links are sorted by tags via ditto, but I believe this should work anyhow.
              • 5811
              • 1,717 Posts
              - add $debug=1; in your configuration file
              - run a search (only one)
              - open the ajaxSearch_log.txt file created in the ajaxSearch folder
              - go at the bottom of the file and copy the sql order (from the SELECT line to the ORDER line) and paste this order in a sql window of PhpMyAdmin on your database.

              Are the weblinks found by the sql request ?

              - don’t forget to reset to 0 the debug parameter wink

                • 2901
                • 277 Posts
                Hi coroico

                finally got the time to try debug. Debug does not work I get a parse error, there is no log file created.

                « MODx Parse Error »
                MODx encountered the following error while attempting to parse the requested resource:
                « PHP Parse Error »
                 
                PHP error debug
                  Error: 	fopen(/var/www/vhosts/agile.ch/httpdocs/assets/snippets/ajaxSearch/classes/../ajaxSearch_log.txt) [function.fopen]: failed to open stream: Permission denied	 
                  Error type/ Nr.: 	Warning - 2	 
                  File: 	/var/www/vhosts/agile.ch/httpdocs/assets/snippets/ajaxSearch/classes/ajaxSearchDebug.class.inc.php	 
                  Line: 	31	 
                  Line 31 source: 	$this->asDbgFd = fopen(AS_DBGFILE,'w+'); 	 
                 
                Parser timing
                  MySQL: 	0.0047 s	(4 Requests)
                  PHP: 	0.0912 s	 
                  Total: 	0.0959


                so I am not sure what this is.
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  The script doesn’t have write permissions for that file. Go in with your FTP client and change its permissions to world writable.
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org