[thelist] site search question

Shashank Tripathi sub at shanx.com
Tue Jul 2 22:22:01 CDT 2002


Hi Meredith,

  > I'm looking for a site search script that will yield results with
  > anchors, meaning that when you click on a resulting link, you'll be
  > taken directly to an anchor within an html doc, whether it's halfway
  > down the page or whatever.


You mean these anchors will be generated at run time, based on the search
keywords? If that is what you are looking for, I have been there before and
we settled for highlighting the documents. This is because sometimes the
anchor could be right down at the bottom

In general though, if you want highlight AND anchors, then the same code
(regexp most likely) that is used for highlighting the text in a page
dynamically based on keywords can be used to make dynamic anchors as well.
Basically, onLoad of the document, you would change the location.href to
something like "this.html#anchorname" instead of "this.html". The
"anchorname" was dynamically generated while drawing the page. (How about if
there are more than one mentions? Is there a way for them to navigate to the
next anchor? This is where highlighting for instance is very very useful).

You can download any freebie search engine script and try this on. For
instance, of you use PHP, mnogoSearch (http://www.mnogosearch.org/)...

Hope this is useful,
Shanx




More information about the thelist mailing list