TITLE
    Mac OS 8.5: Modifying Number of Hits from Sherlock Search
Article ID:
Created:
Modified:
58163
10/22/98
10/22/98

TOPIC

    When doing an Internet search using Sherlock, I notice the number of hits returned varies depending upon the search engine used. The number of hits also seems to be less than if I do the search at the web site itself rather than through Sherlock. Why is this?


DISCUSSION

    The Search Internet feature in the Sherlock application allows users to perform Internet searches using one or more Internet search engines. The Sherlock application itself contains no information about the exact data formats expected or generated by individual Internet search engines; when accessing any particular Internet search site, the Sherlock application uses a search plug-in file that describes the data formats both expected by the site for queries and produced by the site in its responses to queries.

    Within the plug-in for a specific search engine are parameters for, among other things, the maximum number of hits returned on a search. If the plug-in specifies the maximum number of hits returned, that value can be altered by modifying the plug-in using your favorite text editor.

    In most search plug-ins, the number of hits is signified by the "nh" input name. nh specifies the number of hits that should be returned in a response to a query. In the example below, the number of hits to be returned from a search is 25.

    <input name="nh" value="25">

    Not all search engines use the "nh" to signify the maximum number of hits returned on a search. For example, the Excite search plug-in uses "perPage" instead. Changing the value from "perPage" to some number will return up to that number of hits.

    <input name="perPage" value="perPage">

    For a plug-in which does not specify a value, it is possible to add one but you will need to first determine what input name is used to signify the maximum number of hits. To find the input name, begin by logging into the search engine through the web, we will use Lycos for this example. On the Lycos home page click on Pro Search and set the number of hits to be returned at 30, this number will be easy to recognize in the URL.

    Perform a search on any topic. Once the search finishes, look in the URL string in your browser for the number of hits you selected, in this case, 30. That number will be preceeded by some text then the ampersand symbol (&). You will need the text back to the ampersand to enter into the Sherlock plug-in for that search engine.

    In this case, Lycos uses "maxhits" as the term for the number of hits returned in a search. Now you are ready to edit the search plug-in. Open the Lycos plug-in in your text editor. You will see a number of lines beginning with <input name=... You will be creating one more line which should be exactly as follows:

    <input name=maxhits value=30>

    Close and save the Lycos plug-in and now when you search Lycos from Sherlock, the maximum number of hits returned will be 30.

    More information regarding the modification, and creation of Sherlock search plug-ins can be found on the Sherlock web site; http://www.apple.com/sherlock . Clicking the Developer button will bring you to more detailed information relating to plug-in development and/or modification.


Document Information
Product Area: Mac OS System Software
Category: Mac OS 8.5
Sub Category: System Software Components

Copyright © 2000 Apple Computer, Inc. All rights reserved.