We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10896
    • 76 Posts
    I have two questions about AjaxSearch or maybe they are requests for future development for AjaxSearch

    1.) Is there a way to pass the search query (to the results page) in the url as a GET var? That way we can see what’s being searched for.
    2.) Is there a way to customize the output of the search results page. I’m thinking like WayFinder have a chunk that can be called that will be the search results item.

    Thanks!
      • 10896
      • 76 Posts
      ampkk

      I was looking through the earlier posts in this thread and found that you can modify this file

      assets/snippets/AjaxSearch/includes/templates.inc.php

      to change your results output. Maybe this will allow you to add the long title.

      I will be modifying it to tweak my search results too.

      Hopefully at somepoint this can be a set of parameters that can be set as chunks like WayFinder. That would be excellent.
        • 1921
        • 32 Posts
        That did it gl330k. Thanks! I ended up adding the [+as.longtitle+] to the text part of the link. And made it so the search results would open in a new page, eliminating the need to refresh everytime you go back to the original search page.

        //Template for each search result
        	'result' => '
        		<div class="[+as.resultClass+]">
        			<a class="[+as.resultLinkClass+]" href="[+as.resultLink+]" target="_blank">[+as.longtitle+] | [+as.pagetitle+]</a>
        			[+as.description+]
        			[+as.extract+]
        		</div>',
          • 1535
          • 84 Posts
          Hello.

          Is there a way to add stuff to the search algorithm?. I have a snippet that returns html from database queries and I would like to be able to search on these returns.

          I guess it would require performing all the database queries and caching them for search somehow, but I thought I’d ask if someone has done something similar.

          Cheers,


          Andreas
            • 25307
            • 114 Posts
            example?
              • 1535
              • 84 Posts
              Not sure what kind of example you are looking for, but here is a screenshot of some data returned from an OsCommerce database that I’d like to be able to search on.

              As I think more about this, I expect it to be difficult to achieve this from within MODx.

              Maybe I can hook into the OsCommerce search...

              If I am overlooking something or if someone has experience with this they would like to share, it would be great.

              Cheers,

              Andreas
                • 20751
                • 122 Posts
                Hi,

                On a matter I posted on earlier in this thread, I’ve managed to get ajaxsearch to search both private and public documents bu changing this line of code in AjaxSearc.inc.php

                $qry_sql = "sc.privateweb = 0 AND ";


                to

                $qry_sql = "sc.privateweb >= 0 AND ";


                grin
                  • 7455
                  • 2,204 Posts
                  is there an otion to exclude css pages?


                  I think not so I will edit the script so it will not list css/txt doctype documents. same goes for javascript documents I think?

                  ok I changed line 176 in AjaxSearch.inc.php from:
                  		$sql .= $qry_sql . "sc.published = 1 AND sc.searchable=1 AND sc.deleted=0;";
                  

                  to:
                  		$sql .= $qry_sql . "sc.published = 1 AND sc.searchable=1 AND sc.deleted=0 AND sc.contentType='text/html';";
                  

                  now it only searches for documents that are html/text documents

                  works great

                  Greets Dimmy


                  Dimmy
                    follow me on twitter: @dimmy01
                    • 25307
                    • 114 Posts
                    Quote from: AndreasT at Aug 30, 2007, 10:12 AM

                    Not sure what kind of example you are looking for, but here is a screenshot of some data returned from an OsCommerce database that I’d like to be able to search on.

                    As I think more about this, I expect it to be difficult to achieve this from within MODx.

                    Maybe I can hook into the OsCommerce search...

                    If I am overlooking something or if someone has experience with this they would like to share, it would be great.

                    Cheers,

                    Andreas

                    Best bet is almost certainly going to be to write your own, here’s a nice tutorial - I’m pretty sure this is the same tutorial that the AjaxSearch snippet was based on.

                    link -> http://orderedlist.com/articles/howto-animated-live-search/

                    Good luck.
                      • 1535
                      • 84 Posts
                      Thanks for the tip, Robot.

                      I’ll give it a shot. smiley


                      Cheers,

                      Andreas

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