PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

Use blank to search for all

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

  • Use blank to search for all

    We are using zooms catagories to seperate products into cats in our online store. I want my customers to be able to show all products in a category by leaving the search field blank. Is there a way to do this?
    (using the php version)

  • #2
    It is generally not recommended to ask a search engine to search or show "everything" because it can be really slow and exhaustive. In fact, most search engines such as Google and Yahoo, for obvious reasons, block this on purpose.

    Having said that, there is a way to ask Zoom to return all results and that is by using a wildcard search query of "**".

    "*" can also work if you have configured Zoom to not skip words that are less than 2 characters (under the Skip Options tab of the Configuration window).
    --Ray
    Wrensoft Web Software
    Sydney, Australia
    Zoom Search Engine

    Comment


    • #3
      Thanks Ray,

      I tried that, however I am also using the highlighting function and if I use a wildcard it highlights everything.

      Can I turn highlighting off if only wildcard characters are used?

      Comment


      • #4
        This should work. Replace the code in your highlight.js file with the code below.

        Code:
        // ----------------------------------------------------------------------------
        // Zoom Search Engine 4.1 (21/6/2005)
        // Highlight & auto-scroll script
        //
        // www: http://www.wrensoft.com
        //
        // Copyright (C) Wrensoft 2005
        // ----------------------------------------------------------------------------
        // Use this script to allow your search matches to highlight and scroll to
        // the matched word on the actual web page where it was found.
        //
        // You will need to link to this JS file from each page of your site
        // which requires the "highlight/jump to matched word" feature.
        //
        // For example, you could paste the following HTML in your site's header or 
        // footer:
        //
        //   <style>.highlight { background: #FFFF40; }</style>
        //   <script type="text/javascript" src="highlight.js"></script>
        //
        // Note: You will need to specify the correct path to "highlight.js" depending
        // on where the file is located.
        //
        // You will then need to modify the BODY tag on your page to include an "onLoad" 
        // attribute, such as:
        //
        //   <body onload="highlight();">
        //
         
        <snip>
        <snip>
         
        function jumpHL()
        {
            var d=getElement("highlight");
            if(d)
            {
                var y=findPosY(d);
                // if element near top of page
                if(y < 100)
                    window.scrollTo(0,0); // go to top of page
                else
                    window.scrollTo(0,y-50); // show space of 50 above
            }
        }
         
        function highlight()
        {
            var x = document.body;
            if (x)
            {
                var strHTML=SearchHiLite(x.innerHTML);
                if (strHTML!=false) x.innerHTML = strHTML;
                jumpHL();
            }
        }
        In case your wondering what's different, I added the following into the code.

        Code:
                    if (term[i].indexOf("*") != -1 ){
                    return false;
                    }

        Comment


        • #5
          The above changes posted by broman are no longer necessary in Version 4.2. The updated highlight.js in Version 4.2 will not attempt to highlight a search term which contains only the "*" wildcard character. It also contains fixes for various other issues so we would recommend getting the latest version here:
          http://www.wrensoft.com/zoom/whatsnew.html

          Also - I'm not sure if Ellen is actually talking about "jump to highlighting" (which occurs on the actual page of the content) or just results highlighting (which occurs on the listing of search results). For the latter, there is currently no option to disable highlighting when only wildcard characters are used. We may consider adding something like this in a future version, but in the meantime, you might want to disable results highlighting if you intend to encourage the use of "**" type searches.
          --Ray
          Wrensoft Web Software
          Sydney, Australia
          Zoom Search Engine

          Comment


          • #6
            I didn't notice that there was a new release published today. Guess I wasted my time.

            Comment


            • #7
              Using this in the CGI version I'm still getting all keywords highlighted, is there an option I can adjust so nothing is highlighted when I use the "**" wildcard?

              Thanks!

              -Matt

              Comment


              • #8
                Matt, can you clarify if you are referring to highlighting on the search results page, or the "jump to highlighting" feature which occurs on the actual content page. These two options were confused in the earlier posts in this thread, and I have tried to clear things up in my post.

                Again, if you're referring to the highlighting on the search results page (the page that lists the search results), then you may want to re-read my previous post.

                Originally posted by I
                ... "jump to highlighting" (which occurs on the actual page of the content) or just results highlighting (which occurs on the listing of search results). For the latter, there is currently no option to disable highlighting when only wildcard characters are used. We may consider adding something like this in a future version, but in the meantime, you might want to disable results highlighting if you intend to encourage the use of "**" type searches.
                --Ray
                Wrensoft Web Software
                Sydney, Australia
                Zoom Search Engine

                Comment

                Working...
                X