PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

Performing a selective search.

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

  • Performing a selective search.

    I am using the CGI version of ZoomSearch V5 for my Web site. My web site has the following directory structure:
    - A, B, C, D and E (these are folders that conatins HTML files and subfolders within them.)
    - The "search.cgi" file sucessfully searches for keywords in all files within folders A, B, C, D and E.

    I am looking for this customization:

    I want to be able to provide an user with options to select folders of their choice for searching from a single search page. For example, a user should be able to search only folders A and E. This should be done by providing check boxes (A through E) to the user who can then selct and unselect before running the search.

    The search results should be provided on that single search page.


    How do I do this?

    Thanks,
    K

  • #2
    Categories?

    I believe the "Categories" feature will help me do this. I shall read up on this and post back questions, if any.

    Thanks,
    K

    Comment


    • #3
      The "Categories" feature does spring to mind, and likely do what you want if you setup a category for each individual page. But it is a little unusual to be wanting Zoom to search within one single page.
      --Ray
      Wrensoft Web Software
      Sydney, Australia
      Zoom Search Engine

      Comment


      • #4
        My mistake that I wasn't clear. I don't mean search within one single page. What I meant was I wanted one search page to offer the different search options and display the search results on that same search page.

        "Categories" served my cause perfectly. Yoo hoo!!

        Cheers,
        K

        Comment


        • #5
          Two questions.

          Now, I have 5 categories for searching: A, B, C, D and All.

          1. Is there a way to implement logic such that "All" check box gets unchecked if I check A, B, C or D?
          2. Is there a way to remember a user's previous category? That is, right now, when I go to the search page ("search.cgi"), the "All" check box is always checked by default. If I unselect it, and run a search by checking "B", then the next time I go to search page ("search.cgi"), "B" should be selected instead of "All".

          Regards,
          K
          Last edited by kutra; Jul-01-2008, 06:48 PM.

          Comment


          • #6
            Originally posted by kutra View Post
            1. Is there a way to implement logic such that "All" check box gets unchecked if I check A, B, C or D?
            Not without additional JavaScripting. We generally avoid providing JS due to support issues with code that can conflict with other Javascripts on the page. Here is a previous discussion on this topic:
            http://www.wrensoft.com/forum/showthread.php?t=1601

            Originally posted by kutra View Post
            2. Is there a way to remember a user's previous category? That is, right now, when I go to the search page ("search.cgi"), the "All" check box is always checked by default. If I unselect it, and run a search by checking "B", then the next time I go to search page ("search.cgi"), "B" should be selected instead of "All".
            By default, it will remember the selected option if you have just done the search (i.e. it will display the options selected for the current search). But if you mean for it to remember search options over sessions (e.g. you do a search, leave the page, possibly goto another website/close the browser, and then revisit the search page) then that would not be possible without adding scripting to use and store cookies on the end-user's computer (which we do not do).
            --Ray
            Wrensoft Web Software
            Sydney, Australia
            Zoom Search Engine

            Comment


            • #7
              Thanks for the links, Ray. I was able to implement the JavaScript solution.

              I am running into a new issue. I have created my own search page called search_page.html that is almost identical to search_template.html (generated by default by CGI search). The difference is that I used the code to add a search box to my search_page.html from http://www.wrensoft.com/zoom/support...tml#searchform. Everything works great, including Categories.

              I modified the heading in search_page.html to say "Search" instead of the default "Search this site". This is correctly displayed when I access search_page.html. However, when the search results are displayed, I believe a different template is used because the heading changes to the default "Search this site". Any idea how to fix this?

              Thanks,
              K

              Comment


              • #8
                to search_template.html (generated by default by CGI search).
                The CGI script itself doesn't generate the search_template.html file.

                Search.CGI will always use the file search_template.html as the template file. You should add your changes to this file rather than making a new one (which will be ignored).

                Comment


                • #9
                  Originally posted by wrensoft View Post
                  The CGI script itself doesn't generate the search_template.html file.

                  Search.CGI will always use the file search_template.html as the template file. You should add your changes to this file rather than making a new one (which will be ignored).
                  Thanks for your post. However, I am using my own search page called search_page.html because I have added custom JavaScript code to the check boxes. When any check box other than "All" is checked, then "All" gets unchecked.

                  I cannot see the HTML code in search_template.html where I can add my custom Javascript code.

                  ++++++++++++++++++++++++++++++++++++++++++++++++++ ++++

                  Basically, this is the JavaScript function and the custom JavaScript code that I am using in my own search page called search_page.html:

                  ...
                  function unCheckOnlyAll()
                  {
                  document.searchForm.zoom_catAll.checked=false;
                  }
                  ...
                  ...
                  <form method="get" name ="searchForm" action="search.cgi" class="zoom_searchform">
                  ...
                  ...
                  Category: <ul>
                  <li><input type="checkbox" name="zoom_catAll" value="-1" checked="true">All</input></li>
                  <li><input type="checkbox" name="zoom_cat" value="0" onClick="unCheckOnlyAll()">MSDL (exclude References)</input></li>
                  <li><input type="checkbox" name="zoom_cat" value="1" onClick="unCheckOnlyAll()">Web SDK Reference</input></li>
                  <li><input type="checkbox" name="zoom_cat" value="2" onClick="unCheckOnlyAll()">Visualization SDK Reference</input></li>
                  <li><input type="checkbox" name="zoom_cat" value="3" onClick="unCheckOnlyAll()">Intelligence Server Reference</input></li>
                  </ul>
                  ...
                  ...
                  </form>


                  How do I implement the above logic in search_template.html instead of my own search page called search_page.html? If I open search_template.html, I do not see the HTML for the form.

                  Regards,
                  K
                  Last edited by kutra; Jul-08-2008, 10:00 PM.

                  Comment


                  • #10
                    Originally posted by kutra View Post
                    How do I implement the above logic in search_template.html instead of my own search page called search_page.html? If I open search_template.html, I do not see the HTML for the form.
                    The same way you implemented the Javascript and search form in your own page. That is, you simply add the HTML and JS into "search_template.html". It is a HTML page like any other with the exception that it contains a marker <!--ZOOMSEARCH--> where the search results will appear. You can disable the search form generated by the CGI from the "Search page" tab of the Configuration window. For the "Search form" dropdown option, select "Do not generate".
                    --Ray
                    Wrensoft Web Software
                    Sydney, Australia
                    Zoom Search Engine

                    Comment

                    Working...
                    X