We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21417
    • 486 Posts
    Howdy,

    Ajaxsearch is awesome. I am just setting up my first usage of ajaxsearch and I am really impressed - it is great - and I am sure a snap to customise the second time round.

    I am using evo (rev 6066) with ajaxsearch 1.8.4

    I have one peculiar issue happening with my ajaxsearch and I am not sure what is causing the problem: sometimes when performing a simple search, no documents are returned and the standard (pre search) ’as_introMessage’ message appears - even though I know there a document exists with reference to that search term.

    Ajaxsearch call for the search form in the header:
    [!AjaxSearch? &ajaxSearch=`0` &AS_landing=`71` &AS_showResults=`0` &highlightResult=`0` &tplLayout=`search-form-hdr`!]
    


    Ajaxsearch call for the results page:
    [!AjaxSearch? &ajaxSearch=`0` &AS_showForm=`1` &highlightResult=`0` &tplLayout=`search-form-pg` &tplResult=`search-result` &tplResults=`search-results` &tplPaging=`search-paging` &rank=`pagetitle:50,alias:10,extract` &order=`pagetitle DESC` &grabMax=`15` &minChars=`2`!]


    Examples:
    + Searching "About" works - searching "About us" does not - it returns the ’as_introMessage’

    These quirks are happening even though:
    + Doc 17 is called About Us

    Anybody know what’s going on? This seems really weird.

    Thanks in advance.
      Web design Adelaide
      http://gocreate.com.au
      • 5811
      • 1,717 Posts
      Hi Nick,
      I will look at your post tomorrow (it’s time to sleep in France). To progress do as follow:
      Set debug=1; in the default config file. Execute a search. Download the snippets/ajaxSearch/ajaxSearch_log.txt on local.
      Open the file and search "Select :" to find the SQL request executed. Run this order thru PhpMyAdmin and let me know (tomorrow) if you find any results.
      Do like this for each searchterm discussed below.

        • 21417
        • 486 Posts
        Hey Coroico,

        Thanks for that - sleep now, code later!

        I tried following your instructions numerous times - when I get to downloading the ajaxSearch log and then search for Select:, there is no "Select:" in the log file?

        I’m not sure I follow - the sql stuff goes over my head.

        The config for Ajaxsearch is set to debug ( $dcfg[’debug’] = 1; )

        Look forward to hearing from you when you are bright and refreshed!

        Thanks Coroico.
          Web design Adelaide
          http://gocreate.com.au
          • 5811
          • 1,717 Posts
          Now I am refreshed laugh and the good answer is that when you search "about us" you don’t run any search ...
          This is why you don’t find the sql order in the log file.

          The reason is that your second word "us" has a length of two characters. Which is under the minimum length required by ajaxSearch.

          On this demo page:

          - if you try "primary school" with "one word" option selected, you get all the docs with "primary" and "school". Bof!

          - if you select "exact phrase" you got all the docs with "primary school". it’s Better!

          - if you select "primary sc" with "one word" you got this message: "At least 3 characters are required for your search term"

          I don’t get this message on your site huh


          Nevertheless if you would like allowed a 2 characters length word, see this post
            • 21417
            • 486 Posts
            Wow - thanks Coroico!

            That did the trick.

            a. added &advSearch=`exactphrase` to both of the ajaxsearch calls (really to improve the search results).
            b. in the config/default.config.inc.php file I changed the line $dcfg[’minChars’] = 3; to $dcfg[’minChars’] = 2;
            c. in the classes/search.class.inc.php file I changed the line define(’MIN_CHARS’,3); to define(’MIN_CHARS’,2);

            Thanks so much - you are amazing!

            Keep up the great work grin
              Web design Adelaide
              http://gocreate.com.au