PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

Highlighting not working

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

  • Highlighting not working

    I have enabled both "Words matched in search results" and "Jump to match and highlight within document" and have the correct CSS code in my template but when I do a search nothing is highlighted. Is there a special <form> tag I need to add to the search form or something I am missing?

    http://www.finalfantasyinfo.com/search/

  • #2
    Re: Highlighting not working

    I can't seem to find the javascript code on your pages for the highlighting or the <style> tag. The pages that the search engine results point to all have to have use the zoom javascript code on them for the highlighting and the <stlye> tag.

    Here's the simplest form of what your pages should look like.

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http&#58;//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
    <head>
    <title>test</title>
    
    <script type="text/javascript" language="javascript" src="highlight.js"></script>
    <style>.highlight &#123; background&#58; #FFFF40; &#125;</style>
    </head>
    <body onload="highlight&#40;&#41;">
    <div>test</div>
    </body>
    </html>
    example url from search result

    http://localhost/a.html?zoom_highlight=test

    Comment


    • #3
      I do not know why your not seeing the style code but it is there on the hard code and in the browser source. I did add the .js file and the link to it to the search_template.html file but it is still not highlighting. I noticed in your example URL the query string is zoom_highlight=test but there string is no where in the query string when searching my site.

      Edit:
      Looking over the Zoom PDF guide, again, it seams as though I need to add that code to everysingle page on my site, is this true? If so is there any other way? I do not feal like editing over 2,500 pages.

      Comment


      • #4
        Originally posted by Eagle_f90
        I did add the .js file and the link to it to the search_template.html file but it is still not highlighting
        The style code and the js file link goes on every page of your site as you mentioned in your edit except the search template.

        The code I pasted earlier represents the basics of what every page of your site (excluding the search template).

        Also, you do have the word "test" on some of your pages.

        You will have to edit every page on your site if you aren't using any includes. If you have a similar section on the page you may be able to do a mass search and replace on the files using a search and replace app from the internet, there are several out there.

        I noticed that your site responds to default.asp so I am guessing that you are using IIS on a Windows server or desktop. I would suggest using includes. Your html pages can run includes as long as they are setup to run through the asp dll. Otherwise, ues ASP pages. Then, the next time you have to do a mass update of some code, header, footer, nav or something else you can do it on one file and have it trickle down your site. If you are already using includes then you should be halfway there.

        Comment


        • #5
          I am using IIS and I can do mass search and replaces it just takes almost 2 hours to do it though the net. I have a hole lot of docs. Before I was on a dedicated server normal HTML files where not passes though asp.dll so I could not use includes and I have so many pages now I really did not want to take the time to mod all my fies to use includes when I moved to the new server. I guess for now I will not use highlights. Is there a place where I can make the suggestion to the dev team to put in a highlight option like Google uses (where you do not need special code in every page)? My old search script did this and I would like to see Zoom do it too.

          Comment


          • #6
            I think I have a solution for you that will work without touching your existing html pages. I tested it locally and it worked on IE and Firefox.

            In your existing navigation.js file add the javascript from the highlight.js file and add the following code after the highlight code.

            Code:
            document.open&#40;&#41;;
            document.write&#40;'<body onload=\"highlight&#40;&#41;\">'&#41;;
            document.close&#40;&#41;;
            In your existing navagation.css add the following line

            Code:
            .highlight &#123; background&#58; #FFFF40; &#125;

            Comment


            • #7
              I moved the code over and added the document.write code but no information is added to my documents. The body tags is still a base <body> tag.

              Comment


              • #8
                Originally posted by Eagle_f90
                I moved the code over and added the document.write code but no information is added to my documents. The body tags is still a base <body> tag.
                Actually, you won't see the new <body> tag in the view source of the browser.

                Use alert('hello'); in your code as you are putting this together to test how it's working.

                Comment


                • #9
                  Originally posted by broman
                  Originally posted by Eagle_f90
                  I moved the code over and added the document.write code but no information is added to my documents. The body tags is still a base <body> tag.
                  Actually, you won't see the new <body> tag in the view source of the browser.

                  Use alert('hello'); in your code as you are putting this together to test how it's working.
                  Hurm, I though the document.write did make what ever it writes visible in the scoure. I added the alert and it does allert. But the current search did not highlight anything so I am reindexing now. Be back in about 10 minutes after the index is done.

                  Comment


                  • #10
                    Ok, re-indexed and no lightlight. I get the alert pop but no highlight (Note I took the alert off since this is an active live site). I guess I will just have to suggest a google like highlight and hope they put it in.

                    Comment


                    • #11
                      You're not going to get that feature. If your speaking about the highlighting that appears when you have the google search toolbar installed on your computer, that is and add on that downloaded and installed as a plugin to your browser. They aren't going to make a google toolbar that every visitor of your site is going to need to install in order to use your site. Too bad you were unable to get my code to work. It should work fine.

                      Comment


                      • #12
                        Did you turn on "Support single-case languages" in the "Languages" tab of the Configuration window? Or did you modify the "settings.zdat" file?

                        It seems that highlighting is working case sensitively. This means that it only highlights when the word is in the same upper/lowercase form as the search term entered by the user.

                        For example, when I search for "SNES", it highlights the word:
                        http://www.finalfantasyinfo.com/sear...=0&zoom_sort=0

                        But when I search for "snes", it does not:
                        http://www.finalfantasyinfo.com/sear...=0&zoom_sort=0

                        Also, when I search for "test", it only highlights the word test when it is all in lowercase:
                        http://www.finalfantasyinfo.com/sear...=0&zoom_sort=0

                        Make sure you turn off "single-case languages" and that you have not modified the "settings.zdat" file. You should also make sure that you re-uploaded all Zoom related files after indexing - if you are manually uploading using an external FTP client other than Zoom, then you may have a mix of files from different indexing sessions online.

                        It also seems like you have not properly enabled "Jump to highlighting" (or perhaps you've disabled it since your original post). See this page for more information on how to implement it:
                        http://www.wrensoft.com/zoom/support/highlighting.html

                        Yes, it is necessary to add a line to every page that you want "jump to highlighting" to occur on. For any medium to large sized website, you should already have a mechanism in place to allow you to do something like this - otherwise, what do you do when you need to add an item to the navigation menu, for example? Common methods include SSI (server side includes) and the use of Library/Assets in programs such as Dreamweaver.

                        Google only performs on-page highlighting with the Google Toolbar (if you have this installed) and when they display their cached copy of webpages. It makes little sense for us to provide cached webpages, or a toolbar. If you want to manually highlight the words coming from a link off Google's search results, you would also need to add Javascript to each page of your website.
                        --Ray
                        Wrensoft Web Software
                        Sydney, Australia
                        Zoom Search Engine

                        Comment


                        • #13
                          I see what your talking about now, and my problem was the case of the query word. Will try disabling the "Support single-case languages". I also really do not want a jump to highlight. I just want the words in the document to be hightlighted like good does, but not jumped to. If I want the highlighting on the document do I just need the CSS code or do I still need the Javascript? I really do not want the jumping.

                          As I explained above I can make changes to the menu it just takes a long time because of the limitations of my first server when this site was made I could not use SSI for the nav menu. Now there are to many docs to really replace them with a SSI.

                          Edit: Looking at the config, the jump and highlight was turned off. I know I turned it on for one indexing but I must have forgoten to save the config. Reindexing with it enabled. And I will lookthough the Javascript to figure out if I can disable the jumping.

                          Comment


                          • #14
                            It looks like it is working as expected now.

                            The "jump to highlighting" script highlights the text on the page, and also "jumps" or scrolls the browser window to the first occurance of the word. There is no built-in option to disable the "jumping" but you can modify the script if you choose to do so, at your own risk. Note that we can not provide support for modified scripts.
                            --Ray
                            Wrensoft Web Software
                            Sydney, Australia
                            Zoom Search Engine

                            Comment


                            • #15
                              I was able to mod the JavaScript to prevent the jumping by commenting out a single line of code and everything seams to be working great now. THe only problems I have found so far are with code used in my ASP scripts that where a bit slopy on my side but nothing I can't handel my self. Thanks for all the help everyone.

                              Come to think of it there is one odd thing I noticed even with an unmodified jump script. When I click on the on a link in the search results I am unable to go back to the results using the back button in FireFox 1.0.6 looking at the history there are 2 entrys for the page I clicked on from the search results.

                              God, I do not know if it cause I am tried now but I can not seam to change the hightlight color. If I change it from the defalt to #0f1535 the hightling goes away. I notice the same issue when moding the JS file which was fixed by doing the same mod to the JS file in the main Zoom Search folder. Anyone know what might be up with the hightlight color?

                              Comment

                              Working...
                              X