PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

Zoom Search API

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Zoom Search API

    I tried out the Zoom Search tool and use the CakePHP framework on a regular basis. After generating the PHP search files, it worked great standalone. While that was great, it did not allow me to output the content in modular pieces within the context of the framework, to work with my applications... for instance a modular implementation could look like:

    Code:
    // include and initialize the zoom search class
    include('zoomsearch.php');
    $zoomsearch = new ZoomSearch();
    
    // each piece of the zoom search results could be accessed like this
    echo $zoomsearch->title;
    echo $zoomsearch->description;
    echo $zoomsearch->results;
    This would allow for a much more flexible output and would be perfect in the context of MVC frameworks such as CakePHP. In Zoom Search's current implementation, I would have to bend the code heavily to get the output to fit within the context of the framework.

    This change would mean a lot, considering it would allow me and others to leverage framework templating and view helpers, rather than being tied to Zoom Search's way of templating.

    Thanks for your help!

  • #2
    You can include Zoom on an existing PHP page with this code.
    <?php virtual("search.php"); ?>

    See also this page about adding PHP to the search page.

    If you want to manipulate the results down at the field level, then you can use CSS to make a significant number of changes.

    Or another option would be to use the Zoom CGI option and ask it to return results to your PHP code in XML format. Once in XML format you can do pretty much anything you want to the results.

    Comment


    • #3
      Currently search.php dumps out all of the output using the print() method. This does not work within the context of frameworks, since the standards behind most frameworks say that functions should return a value, not automatically output stuff without you specifically telling it to.

      That is why I proposed the code that I did. Make sense?

      The code I suggested was also modular, meaning you can output each piece where and how you want to - instead of forcing a default template that has no ability to be customized without hacking the core search.php file. I realize the fonts and colors can be customized, but not where the pieces of information are placed and laid out on the page.

      Comment


      • #4
        While I realise your proposal was just an example, it is too simplistic. There is actually a lot of other information outputted in the search results (e.g. spelling suggestions, recommended links, number of matches, etc..). A real implementation would look a lot more messy.

        Also only about 5% of our customers are good enough PHP programmers to make use of what you are suggesting. And those good programmers can quickly edit our search.php script to get any result they want (as we supply the source in clear text). Or they use the CGI.

        It makes more sense to us to use the standard XML format for returning search results, which is what we did with the more powerful CGI option.

        In V6 of Zoom (under development) the template is also significantly more flexible.

        While conceptually I can see the appeal from a programmers point of view in turning Zoom into an object / component, however I don't think the net practically benefit to our users will be high.

        Also remember that we support Javascript, ASP, CGI as well as PHP. And we want to keep the methodology as similar as possible across the scripts.

        Comment


        • #5
          Yahoo Search BOSS's approach is to return the results in XML, allowing you to customize the data in any way. I just decided to switch to that service because it fits the level of customization I need.

          Comment


          • #6
            Yes, as already pointed out, we have supported XML for some years now as well.

            Comment


            • #7
              From our Features page:

              XML/RSS output (OpenSearch™ compatible)
              Option to display search results in OpenSearch compatible XML/RSS output. Allows you to post-process the search results via your own scripts, or provide RSS feeds for end-users, as well as the myriad of OpenSearch solutions becoming available online. Available for CGI option only.
              More information in this previous discussion thread.

              Also see Chapter 2.10 in the Users Guide.
              --Ray
              Wrensoft Web Software
              Sydney, Australia
              Zoom Search Engine

              Comment

              Working...
              X