View Full Version : Highlighting not working
Eagle_f90
08-17-2005, 03:56 PM
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/
broman
08-17-2005, 05:33 PM
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.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://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 { background: #FFFF40; }</style>
</head>
<body onload="highlight()">
<div>test</div>
</body>
</html>
example url from search result
http://localhost/a.html?zoom_highlight=test
Eagle_f90
08-17-2005, 07:00 PM
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.
broman
08-17-2005, 07:30 PM
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.
Eagle_f90
08-17-2005, 07:53 PM
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.
broman
08-17-2005, 09:00 PM
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.
document.open();
document.write('<body onload=\"highlight()\">');
document.close();
In your existing navagation.css add the following line
.highlight { background: #FFFF40; }
Eagle_f90
08-17-2005, 09:28 PM
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.
broman
08-17-2005, 09:29 PM
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.
Eagle_f90
08-17-2005, 09:35 PM
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.
Eagle_f90
08-17-2005, 09:51 PM
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.
broman
08-18-2005, 12:53 AM
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.
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/search/search.cgi?zoom_query=SNES&zoom_per_page=10&zoom_and=0&zoom_sort=0
But when I search for "snes", it does not:
http://www.finalfantasyinfo.com/search/search.cgi?zoom_query=snes&zoom_per_page=10&zoom_and=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/search/search.cgi?zoom_query=test&zoom_per_page=10&zoom_and=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.
Eagle_f90
08-18-2005, 03:50 AM
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.
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.
Eagle_f90
08-18-2005, 05:10 AM
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?
I think the back button problem might be a Mozilla/Firefox bug. It also seems to only happen with your web pages - it does not occur in our tests using a simple, basic web page with the jump to highlighting script in either Firefox or IE.
It might be triggered by a combination of the highlight script, the other scripts you are using, your pragma/no-cache headers, or possibly even the Google ads.
Here's a list of possible related "back button" bugs in Mozilla (https://bugzilla.mozilla.org/buglist.cgi?query_format=specific&order=relevance+desc&bug_status=__open__&product=&content=back+button)
If someone (or Eagle_f90) can replicate this problem with a simpler web page (no other scripts or unnecessary headers), let us know.
The highlight color is specified by CSS. Your pages seem to be using several different CSS files, so you should check which one actually contains the style class for "highlight".
Eagle_f90
08-18-2005, 02:45 PM
I tested it in IE and got the same thing so it is not a firefox issue. And right now I am dealing with to much other stuff to continue dealing with this. Maybe latter in the month I will do some testing to see if I can track down this bug but for now I am just disabling highlighting and will write my own script for it later.
THanks for all the help.
The "back button" problem did not occur in IE 6.0 (on Windows XP SP2) when I last tested it here (before you disabled the highlighting). I am unable to confirm if this happened with the unmodified script or not since you only had the modified version up when I saw it. But as mentioned above, let us know if anyone can replicate this problem on a page without other scripts etc. Otherwise it can not be easily determined as to which script is actually causing the problem (as is the nature of Javascripts).
Powered by vBulletin® Version 4.1.12 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.