JavaScript
Search Engine

Site Map

Home
Example Site
Simplified
Advanced
Create Index
Using Wizard
Editing Code
search.html
Configuration
Search This Site
Conditions of Use
Contact
E-mail

 

Click here for important news about the JavaScript Search Engine

Editing the Code by Hand

You may wish to edit the code by hand.  This is quicker in some situations such as when there is only a small amount of text on each page to index.  If there is lots of text you will find it much quicker to use the Form Wizard to strip the text from web pages.

Here is an example line of code that will be entered into the search.html.  The line has wrapped for ease of visuals - remember that the code must always be placed on one line!

page[1]=["http://www.server.com/somepage.html","Page title","Brief page description","Detailed page text"]

There are 4 items in the [ square brackets ]. Each item must be in "quotes" and separated by, a comma.

If any the items have quotes then you must preface the " with a \.  For instance if the title of the web page was The "Home" Page then you would have to enter The \"Home\" Page.  If you are using the \ character then you must also preface it with another \.  For example c:\windows will become c:\\windows.  The Form Wizard does all this automatically!

The four items are:

  • URL:  The full path to the page including the protocol (ie http://).  You can use a relative path although the search results will not be so clear.

  • Title:  The title of the page. This will be displayed first in any search entries.

  • Description:  A brief description of the web page. This is similar to the textual description you see in full search engines.  This description is usually encoded in a <META DESCRIPTION> tag that is read by many search engines.

  • Body Text:  The actual text of your web page.  You do not have to include all of it.  For instance you may not want all the text to be accessible through the search engine. Or you may want to minimise the size of the index.