We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2364
    • 73 Posts
    If you had problems with search not latin symbols (cyrillic In my case), offer my decision.
    Replace in file AjaxSearch.js line ~111:
    		search: s, 

    with
    		search: unescape( encodeURIComponent( s ) ), 

    and line ~140:
        $('current-search-results').setHTML(decodeURIComponent(request));

    with
        $('current-search-results').setHTML(decodeURIComponent( escape( request ) ));


    Only it works in Firefox 1.5, Internet Explorer 6.0.2900.2180, Opera 9.0.8502, Camino 1.0.2, Safari 2.0.4
      • 25663 MODX Staff
      • 12,272 Posts
      I’m assuming it also works in Firefox 2.0.x and IE 7, too?
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 2364
        • 73 Posts
        Quote from: rthrash at May 31, 2007, 07:50 AM

        I’m assuming it also works in Firefox 2.0.x and IE 7, too?
        Yes, of course smiley
        Works in Firefox 1.5, Internet Explorer 6.0.2900.2180, Opera 9.0.8502, Camino 1.0.2, Safari 2.0.4 and higher.
          • 10313
          • 375 Posts
          Hello.

          I got a little (hope so) problem with this snippet. I’m using modX 0.9.5 and updated AjaxSearch to the current version 1.6.

          I added

          [!AjaxSearch? &ajaxSearch=`0` &AS_landing=`30` &AS_showResults=`0`!]


          to my template and on page ID 30 I added

          [!AjaxSearch? &AS_showResults=`1` &AS_showForm=`0` &showMoreResults=`1`!]
          to the content. I intentionally deactivated ajaxSearch because it’s my first steps with this snippet. So now to my problem: The search does not find any results. I have tried many different searches but they all lead to nothing. At last, I think that it finds nothing for nothing is outpu. The source just shows a

          <div id="ajaxSearch_output" style="opacity:0;"> </div>

          Well, that opacity:0 is interesting, but this is not the problem yet.

          Can anybody help me here? BTW: all pages of my site are currently set to be "searchable".

          Thanks and greetings from the "Bierstadt Einbeck" in Germany
          Martin
            • 21800
            • 174 Posts
            Always there is the problem with AS and special chars - utf-8 (atma’s patch doesn’t work for me)

            is it AS or the server config?

            my personal dilemma is that my knowledge of IT at this time does not allow to move the AS coders or my hoster to act.

            With a search the PHP request header allows utf8 und ISO-8859-1. The response header only delivers ISO-8859-1. DB config is like this:
            collation_connection utf8_general_ci ok
            collation_database utf8_general_ci ok
            collation_server latin1_swedish_ci huh
            I’m not allowed to change server configs. The Hoster surely doesn’t want to ("latin1_swedish_ci is a standard config in europe." he says).

            One could say it is better to search the way FlexSearch for example does (that meens to change AS for more flexibility with hosters).

            By the way: With &ajaxSearch=`0` search finds but is case sensitiv i. e. "über" doesn’t find "Über" (in my 0.9.6 install).
            Though modX is mostly an ingenious tool in my eyes (3. install), ...
              • 2364
              • 73 Posts
              Quote from: nos at Jun 01, 2007, 10:20 AM

              Always there is the problem with AS and special chars - utf-8 (atma’s patch doesn’t work for me)

              is it AS or the server config?

              Maybe you help this:
              add in file AjaxSearch.inc.php after
              $selected = mysql_select_db($database, $db) or die ("Cannot select database (connectForAjax)");

              similar code (this in my case)
              mysql_query("SET CHARACTER SET utf8;");
                       mysql_query("SET NAMES 'utf8';");
                       mysql_query("SET character_set_results = 'utf8';");
                       mysql_query("SET collation_connection = 'utf8_general_ci';");

                • 22303 MODX Staff
                • 10,725 Posts
                Good call atma. I thought this had been updated, but apparently not. You only need the first call BTW:
                mysql_query("SET CHARACTER SET utf8;");

                See more information regarding this at http://dev.mysql.com/doc/refman/5.0/en/charset-connection.html; and in particular, this section describes how SET CHARACTER SET works...
                SET CHARACTER SET is similar to SET NAMES but sets character_set_connection and collation_connection to character_set_database and collation_database. A SET CHARACTER SET x statement is equivalent to these three statements:

                SET character_set_client = x;
                SET character_set_results = x;
                SET collation_connection = @@collation_database;

                I’ll make sure and get AjaxSearch updated and into the 0.9.6.1 release.
                  • 20289
                  • 958 Posts
                  This issue will be lost here, anybody made a bug/suggest yet?
                    [img]http://i10.tinypic.com/52c4eir.gif[/img][/td]
                    [td][Wiki] [Persian support forum]
                    [SVN] [RTL SVN Branch] [bugs] [FishEye+Crucible] [Learn MODx!] | [My Google Code]
                    [font=tahoma][برای دسترسی به راهنمای فارسی به [url=http://www.modxcms.ir]
                    • 19033
                    • 892 Posts
                    Dear All,

                    I thank your great work, Ajaxserch.

                    > Dear MotSmart.
                    I have also same trouble with strange black box under the search box.
                    I think that Ajaxsearch do not work with to that state.
                    I checked about this trouble in detail.
                    The result, AjaxSearch has some trouble with CACHE, I think.

                    I tried the the following:

                    First, create a simple document like the following.
                    <html>
                    <head>
                    </head>
                    <body>
                    <div id="search">[!AjaxSearch? ajaxSearch=`1` &addJscript=`1`!]</div>
                    </body>
                    </html>

                    The template of document is blank.
                    Document cache is "YES".

                    Access to the page which created the above.
                    At first, Ajaxsearch would work normally.

                    And again, access to this page (not REROAD).
                    (The word "Search here..." will appear in textbox).

                    In this situation, AjaxSearch do not work.

                    Next, Clear cache in the manager.
                    Again, access to this page.
                    AjaxSearch works.

                    The same phenomenon is caused in the sample web site.
                    Then, the strange black box will appear under the search box with IE(6).

                    Sincerely yours,
                    ---*---*---*---*---*---
                    P.S.
                    If document cache is "NO", this issue would not be caused.
                      • 20289
                      • 958 Posts
                      Combination of ATMA and MEGU solutions worked like a charm for me... many thanks
                        [img]http://i10.tinypic.com/52c4eir.gif[/img][/td]
                        [td][Wiki] [Persian support forum]
                        [SVN] [RTL SVN Branch] [bugs] [FishEye+Crucible] [Learn MODx!] | [My Google Code]
                        [font=tahoma][برای دسترسی به راهنمای فارسی به [url=http://www.modxcms.ir]

                      This discussion is closed to further replies. Keep calm and carry on.