We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13560
    • 5 Posts
    It looks like ajax search didn’t recognize dynamic content.
    I have some snippets in use. But i can not search and find the text coming from the snippets.
    Is there a trick or isn’t it possible?

    Thx Jan
      • 5811
      • 1,717 Posts
      AjaxSearch do the search in the tables site_content (Content) and site_templatevar_content_values (TV).
        • 13560
        • 5 Posts
        thx
          • 31290
          • 37 Posts
          So is there a way to make AjaxSearch index content coming from snippets?
            • 5811
            • 1,717 Posts
            So is there a way to make AjaxSearch index content coming from snippets?
            Not with the current version (1.8.1).

            A solution could be :
            1/avoid to strip snippet calls (cached or uncached call) read from the content field
            2/ analyse the snippet call in order to get the snippet name and snippet parameters
            3/ on fly, change the id of the current document by the id of the document analysed
            4/ execute the snippet and get the output : $output = $modx->runSnippet($snippet_name, $snippet_params);
            5/ restore the content id of the document where the search occurs
            5/ replace the snippet call by the output inside the content value
            6/ search into this "interpreted" content value, the search terms requested

            This is not simple, not implemented. And I am not sure that it could be work tongue

            Is the indexing of the snippet output an important feature, requested by lot of people ?
              • 25663 MODX Staff
              • 12,272 Posts
              That would be very much like an enterprise search solution where the actual rendered pages were indexed (think Google). Would be quite cool indeed, but a lot of work.
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 29774
                • 386 Posts
                One easy solution might be to use a Google Custom Search Engine to index the rendered output of your site, and then generate a JSON or RSS feed in response to a search query using a Yahoo Pipe, and format as you wish - eg:

                http://ouseful.wordpress.com/2008/10/18/getting-an-rss-feed-out-of-a-google-custom-search-engine-cse/

                Could this be an option within Ajaxsearch?
                  Snippets: GoogleMap | FileDetails | Related Plugin: SSL
                  • 31290
                  • 37 Posts
                  @Coroico

                  I think it would be in the interest of everyone to have as much of the content on their site indexed as possible. If making snippets indexed would make them that much closer, I think a large percentage of the people would appreciate this upgrade. There are a lot of sites that use snippets to generate most content on their site. If none of that is searchable, it makes that content nearly useless.

                  Especially since, now, people are becoming lazier and lazier when it comes to actually browsing a site, their first instinct is to search rolleyes

                  PS, I love AjaxSearch, and so do my co-workers using the site I designed!
                    • 5811
                    • 1,717 Posts
                    @VanMeter

                    I Understand the request (much of content indexed). But I probably speak too quickly. tongue
                    if it possible on fly to convert the snippet call by the content output, the main difficulty is too find the document which contains the search terms.

                    If the search terms are into the part provided by the output of the snippet, the mysql statement into the site_content table don’t find the search terms undecided
                    So to do a search into all the documents needs to parse all the documents, insert the results into a temporary table and then do a mysql select search. Not sure that it will be performant.
                    A better solution should be to implement a full text search: when a page is saved, you perform a full text indexing. Each term indexed are stored with his location into a specific table. And when you search a term, you browse this indexed table to find the result.