|
Configuring the JavaScript Search Engine It is possible to change the format of the output the JavaScript Search Engine produces. This is done by altering some values below your page indexes. If you view the source of the search.html file you will see this:
Show Detailed Output This can be set to true or false. If it is true then a quote is displayed of every occurrence of the search word in the body text. If the word is found in the title, description or URL then no quotes are displayed. ShowDetailedOutput = true
ShowDetailedOutput = false
Show Quote Count This can be set to true or false. If it is true then the number of times the search word has been quoted in the content is displayed. If the word is found in the title, description or URL then no quotes are displayed. ShowQuoteCount = true
ShowQuoteCount = false
Sort Results This can be true or false. It is normally desirable to sort the matched pages into order of relevance. The default is to list the pages at the top where the search word was found in the title, description or URL, followed by the pages where the word was found in the body text (content). You can override this by setting this value to false. The pages will be listed in the order they appear in the indexes. By doing this you can place what you think the most important pages are at the top of the returned results. Sort Order If you have set Sort Results to true then the order of matched pages is taken from these four variables. By changing these you can modify what you feel should be placed at the top of the results page. The default order is to list in order of title, description and URL, followed by the pages where the word was found in the body text (content). This can be seen from the default values of
To change the sort order you must alter the numbers. There must always be four numbers 1, 2, 3 and 4. Change the variable of the number you want to have most important to 1, the next important to 2 etc. If I wanted to change to sort order so that pages where the word is only in the content are listed first, then URL matches, then title matches and finally description matches, then the code would be as follows:
See the Advanced Example for a demonstration of alternative sort orders. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||