We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4310
    • 2,310 Posts
    I use a custom snippet to generate some of the page content.
    AjaxSearch does not return any results for that content, only the hard coded page content.
    Is this normal? Or am I doing something wrong?
    I’m using MODx 0.9.6RC1 and AjaxSearch 1.6
    My search call is
    [!AjaxSearch? &AS_showResults=`1` &AS_landing=`8` &showMoreResults=`1` &moreResultsPage=`8` &addJscript=`0` &extract=`1`!]
    which is in a chunk in a tv in the template (I have tried it directly in the tv and the template, but no difference)
    My result page call is
    [[AjaxSearch? &AS_showResults=`1` &addJscript=`0` &AS_showForm=`0`&ajaxSearch=`0`]]
    on an uncached page
    Any help would be greatly appreciated!
    David
      • 25663 MODX Staff
      • 12,272 Posts
      Hi Bunk58. What does the custom snippet do? I believe that our search will only return results that are actually stored on the page. So if it’s pulling, for example, RSS feeds from somewhere and displaying those, it’ won’t search the RSS feed content. I don’t thing it would search in the rendered output of @BINDINGs either for that matter.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 4310
        • 2,310 Posts
        Hi Ryan,
        The snippet just pulls some info from a table in the DB (image location, description, title etc) and then puts it in a div on the page.
        I noticed when I run the search for the word "message" it doesn’t show the result from the contact form called via the eform snippet, even thoughthe word "message" is displayed on the page.
        It seems to me that anything not hard coded into the page is being missed by the search!
        All the content is being displayed via the
        [*content*]
        tv in the template.
        Is it my implementation?
        Regards
        David
          • 1511
          • 144 Posts
          I believe that happens due the fact that the template for the eForm snippet is a chunk. And AS does not search the chunk content.
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Indeed, how could it? There is no way of knowing what page uses what chunk. The same with snippets.
              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
              • 1511
              • 144 Posts
              The search engine should render the pages and check the content. smiley
              But that cannot be achieved via a SQL query. And it would be slow.
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                Exactly; it would have to parse and render then search every document! What if you have hundreds or even thousands of pages? Better to use a google search.

                  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
                  • 33992 ☆ A M B ☆
                  • 455 Posts
                  hi,
                  excuse me, i have a problem with ajax search in 0.9.5.
                  when i search, an error apears.

                  the error:

                  (please excuse me again, this image is too big for forum but i wanted to show you the error message well.)
                  because of it, the search of my site somtimes works and sometimes show error.
                  please help me.

                  Regards
                  AHHP
                    God loves me. 【ツ】


                    MODX.ir (Persian Support)

                    Boplo.ir/modx/ (Persian)
                    • 4310
                    • 2,310 Posts
                    Thanks for the comments Susan & Andrazk.
                    I can now see the impossibility of what I was asking!
                    Google will only work for the pages it has already cached, which will of course may well be out of date.
                    What I have done is hidden some duplicated content on the page which shows up nicely with the search & highlighting.
                    Thanks again,
                    David
                      • 21800
                      • 174 Posts
                      hey,
                      I’ve an installation of modX 0.9.6-RC1 all set to utf8 (incl. db) with AS 1.5. It works fine so far but the div which displays the AS results does not show special chars (ü, ä, ...) propperly (i.e. über for über) but the "moreResultsPage" does. (The opposite problem I have with a 0.9.5 installation.) So searching with "ü, ä, ..." freazes the script.

                      Is someone able to help?

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