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
    The version 1.7 of AjaxSearch is now available in the repository. Enjoy of this new version, which includes all the fixes and features delivered on the forum since the version 1.6.
      • 30552
      • 75 Posts
      Coroico,

      I haven’t upgraded to version 1.7 yet, but just wanted to say that I have a problem. It’s the same one I referenced on page 24 of this forum. I thought it was all fixed, and it is for me on Firefox and IE 6, but the same problem happens for my client who is using IE 7.

      Does 1.7 introduce a fix for it that you know of?

      Thanks!

      Edit: I have another problem too. The AjaxSearch call in my template causes a message to pop up on my secure pages: This page contains both secure and nonsecure items. It goes away if I kill AjaxSearch, but I’m wondering what is responsible for that issue.
        • 20508
        • 157 Posts
        Quote from: transeffect at Jan 09, 2008, 06:47 PM

        Edit: I have another problem too. The AjaxSearch call in my template causes a message to pop up on my secure pages: This page contains both secure and nonsecure items. It goes away if I kill AjaxSearch, but I’m wondering what is responsible for that issue.

        Kind of related, Google’s old Analytics does the same thing. There is information information about it here: http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=55483. Not sure if that will help you to identify the problem at all.
          • 30552
          • 75 Posts
          Quote from: msflux at Jan 09, 2008, 07:06 PM

          Quote from: transeffect at Jan 09, 2008, 06:47 PM

          Edit: I have another problem too. The AjaxSearch call in my template causes a message to pop up on my secure pages: This page contains both secure and nonsecure items. It goes away if I kill AjaxSearch, but I’m wondering what is responsible for that issue.

          Kind of related, Google’s old Analytics does the same thing. There is information information about it here: http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=55483. Not sure if that will help you to identify the problem at all.

          I appreciate the response and the hint, and the site does, in fact, use Google’s old Analytics, but that was the first thing I ruled out. Thing is, as far as I can tell, AjaxSearch is making the call to javascript files as relative URLs, which should place the https:// in there automatically, but I guess I will change them in the snippet to be absolute URLs, even though I hate to do that. I’ll come back and let everyone know how it works out.

          Has this never been an issue before, just because everyone’s smarter than I? smiley
            • 5811
            • 1,717 Posts
            Hi transeffect

            I haven’t upgraded to version 1.7 yet, but just wanted to say that I have a problem. It’s the same one I referenced on page 24 of this forum. I thought it was all fixed, and it is for me on Firefox and IE 6, but the same problem happens for my client who is using IE 7.
            Does 1.7 introduce a fix for it that you know of?


            The trouble with IE 7 comes from the usage of the const javascript assignment.
            const is a Mozilla-specific extension, it is not supported by IE

            I have corrected the js/ajaxSearch.js and uses a var assignment instead of a const assignment.
            I have updated the repository. Sorry for those who have already downloaded the zip file.

            Regarding javascript, yes the url is relative. You can change:
            var _base = ’assets/snippets/ajaxSearch/’;
            and set your absolute url. All the includes files are relatives to _base
            In the 1.6 version, all the files were already declared with relative url

            I have added in the readme file a new note: How change the location of the ajaxSearch Snippet to take into account your remarks.
            Thanks for your quick feedback
              • 30562
              • 99 Posts
              Hi, MsFlux.

              I have checked up work for AS 1.7 (on local Web-server, coding UTF-8, IE6, Windows XP SP2). Ajax Search works successfully with english words. And it only finds russian words, but does not highlight them.
              AS-parameters are following (default.config.php):

              <?php
              // Use the following syntax $param = ’value’;
              $version = ’1.7’;
              $debug = ’0’;
              $as_language = ’russian-UTF8’;
              $opacity = ’1’;
              $stripHtml = ’1’;
              $stripSnip = ’1’;
              $stripSnippets = ’1’;
              $useAllWords = ’1’;
              $searchStyle = ’partial’;
              $minChars = ’4’;
              $ajaxMax = ’6’;
              $showMoreResults = ’1’;
              $moreResultsPage = ’8’;
              $extract = ’1’;
              $extractLength = ’300’;
              $ajaxSearchType = ’0’;
              $docgrp = ’’;
              $highlightResult = ’1’;
              $listIDs = ’’;
              ?>

              Where is an error?

              More accurate information.

              1. For English words (both option $ajaxSearchType = ’ 0 ’ - search "with the button" and ($ajaxSearchType = ’ 1 ’) - "Live" search).

              1.1. If the found words are in the same register or not-equal register as text in the found document (page), words are highlighted in the drop-down menu. OK.
              Ex.: search string text "Home" - web-page contents "Home" - we shall see highlighted "Home" in drop-down menu.
              1.2. If the found words are in other register (not-equal) in comparison with the found web-page text:
              Ex.: search string text "hoMe" - document contents "Home" - words are highlighted in the drop-down menu. OK.
              1.3. And is nothing highlighted on found web-page if we pass from the menu under the direct link.
              If we pass from the menu under the link "Click here to view all results" highlight on found documents is present for english words.

              2. For Russian words (both option $ajaxSearchType = ’ 0 ’ and $ajaxSearchType = ’ 1 ’).
              2.1. If the found words are in the same register as text in the found document, words are highlighted in the drop-down menu. OK.
              Ex.: search string text "Домик" - web-page contents "Домик" - we shall see highlighted "Домик" in drop-down menu.
              2.2. And is nothing highlighted on found web-page if we pass from the menu under the direct link.
              If we pass from the menu under the link "Click here to view all results" highlight on found documents is present for russian words. But notstable: words are highlighted for one pages, for others - are not.
              2.3. If the found words are in other register (not-equal) in comparison with the found web-document text:
              Ex.: search string text "Домик" - document contents "дoмик" - we shall see only link to found document.
              2.4. And is nothing highlighted on found web-page if we pass from the menu under the direct link.
              If we pass from the menu under the link "Click here to view all results" highlight on found documents is not present for russian words as well.


              Excuse me for my imperfect english.
              Thanks.
                • 5811
                • 1,717 Posts
                Hi traveller,

                Don’t worry about your english. As my native language is the French, i am also not fluent in English too wink

                1/ for information, in the config file, the initialisation of the following parameters are useless:
                $version = ’1.7’;
                $stripHtml = ’1’;
                $stripSnip = ’1’;
                $stripSnippets = ’1’;
                $searchStyle = ’partial’;
                $docgrp = ’’;
                $highlightResult = ’1’;

                The version of the snippet can’t be changed, the default strip parameters are all always set to 1 and can’t be changed, the searchStyle is set always to ’partial’ and the docgrp depend only of the document configuration (docgrp) and of the web user permissions. The default highlight value is 1.

                2/ to avoid to highligth menu items (not sure that it’s what you want), you can adjust and precise the highlighted part of your document by the below way: in highligth plugin change the line 53:
                  $body = explode("<body>", $output); // break out the head
                by
                  $body = explode('<!--highlight-->', $output); // break out the page

                and then adds <!--highlight--> in your template to frame the part of your page you want highlight the search results. It could be around [*content*] for example as follow (tested. Extract of a my own template grin ):
                <div id="content">
                <!--highlight-->
                	<div id="colOne">
                       [*content*]
                	</div>
                <!--highlight-->
                </div>
                or with the modxhost.tpl (not tested):
                      <!--highlight-->
                      <div id="left">
                        <div id="left-inner">
                          <div id="content">
                            <div class="post">
                              <h2>[*longtitle*]</h2>
                              [*#content*] </div>
                            <!-- close .post (main column content) -->
                          </div>
                          <!-- close #content -->
                        </div>
                        <!-- end left-inner -->
                      </div>
                      <!-- end left -->
                      <!--highlight-->
                With that you will be sure that the items of your menu will not be taken into account by the highlight plugin.

                3/ 1.3. And is nothing highlighted on found web-page if we pass from the menu under the direct link.
                If we pass from the menu under the link "Click here to view all results" highlight on found documents is present for english words
                .

                When you click on "Click here to view all results", you generate a new page ($moreResultsPage) where all the search terms found are framed by highlightClass css tags. These css tags are used by the highligth plugin to highligth them on fly, when you call the page thru the title link (in the ajax output or in the MoreResultPage).
                This highlighting can’t occur when you call your page from your menu, as the search terms aren’t framed by the highlightClass css tags. The result will be the same for english or Russian words.

                4/ 2.2. And is nothing highlighted on found web-page if we pass from the menu under the direct link.
                If we pass from the menu under the link "Click here to view all results" highlight on found documents is present for russian words. But notstable: words are highlighted for one pages, for others - are not.


                Not sure how does it work for Cyrillic letters / html entities, but are you sure, if you use tinyMCE, that the configuration tab Entity endoding is setting to "Raw" instead of "Named". If not, your characters are may be converted and then not found during the sql search. Could you check this in the html window of your document under the tinyMCE editor and if needed, change the parameter and save again your documents with the correct entity encoding.

                5/ Could you give me a page url where the ajaxSearch issues occurs. And some english and Russian search terms to find.

                Спасибо для ваших обратных связей
                  • 30562
                  • 99 Posts
                  Hi, coroico !

                  Quote from: coroico at Jan 12, 2008, 04:42 PM

                  2/ to avoid to highligth menu items (not sure that it’s what you want), you can adjust and precise the highlighted part of your document by the below way: in highligth plugin change the line 53: …
                  With that you will be sure that the header of your page and the items of your menu will not be taken into account by the highlight plugin.
                  It is a good idea.
                  Well, it’s the suitable limiter “<!--highlight-->” of a content’s subset for search as opposed to “<body>”. Thanks, I will use it.

                  Quote from: coroico at Jan 12, 2008, 04:42 PM

                  When you click on "Click here to view all results", you generate a new page ($moreResultsPage) where all the search terms found are framed by highlightClass css tags. These css tags are used by the highligth plugin to highligth them on fly, when you call the page thru the title link (in the ajax output or in the MoreResultPage).
                  This highlighting can’t occur when you call your page from your menu, as the search terms aren’t framed by the highlightClass css tags. The result will be the same for english or Russian words.
                  Do you plan to update ajax search so it would be possible to look the highlighted words from the drop-down menu?
                  It would be very useful.

                  Quote from: coroico at Jan 12, 2008, 04:42 PM

                  Not sure how does it work for Cyrillic letters / html entities, but are you sure, if you use tinyMCE, that the configuration tab Entity endoding is setting to "Raw" instead of "Named". If not, your characters are may be converted and then not found during the sql search. Could you check this in the html window of your document under the tinyMCE editor and if needed, change the parameter and save again your documents with the correct entity encoding.
                  Excuse me, where there is this adjustment ("Raw" or "Named")? What tab in Site-Configuration menu: Site, Semantic URL etc ? (I have the Russian interface of MODx back-end.)

                  Quote from: coroico at Jan 12, 2008, 04:42 PM
                  Could you give me a page url where the ajaxSearch issues occurs. And some english and Russian search terms to find.
                  Unfortunately, the site is not available. I already wrote. It’s on my local Web-server.
                  Whether should I send you some results of generation of MODx?

                  See you later!
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    Excuse me, where there is this adjustment ("Raw" or "Named")? What tab in Site-Configuration menu: Site, Semantic URL etc ? (I have the Russian interface of MODx back-end.)
                    Open the TinyMCE plugin and go to the Configuration tab. There are a number of configuration options you can set there.
                      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
                      • 30562
                      • 99 Posts
                      Quote from: sottwell at Jan 13, 2008, 03:05 AM

                      Open the TinyMCE plugin and go to the Configuration tab. There are a number of configuration options you can set there.
                      Yes, I will look, thanks.



                      Has tested once again AS 1.7.
                      Still, on separate page ($moreResultsPage) with results, when Russian words are in other register (paragraph 2.4., see above), but they are not highlighted totally. sad

                      Where to look for the problem reason?

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