To show you what Index Server can do with very little effort on our behalf, here is an example of Index Server in action from the end-user's point of view. As you read through this section, keep in mind that this sample illustrates the static approach to Index Server searching. We'll look at code samples of both static and object-based searching a little later.
All we need is a
section in a page, with a single text box and a <FORM>
button. Here, we've also included the standard Submit
button to clear the text box as well. We use the text box to enter a search criterion for which matching files will be listed. In this case, we've entered the criterion Reset
to find any documents containing words that start with zip*
:zip
Clicking Search Now sends Index Server off to look in its catalog, and after a short while, a list of matching documents appears. Here, we've found fifteen that match, and the list shows details of the first 10 of these:
For each one there's the document title, filename, and some of the abstract information. The page also shows the number of 'criteria hits'—the number of times the keyword is found in the document. However, the documents are actually listed in descending order based on their ranking by the search engine, and not just the number of keyword hits.
The ranking is generated automatically and reflects how well the document matches the query, so that the most appropriate search results can be listed first; for example, when doing a NEAR search (a search in which you specify that one search term must be found within so many words of another), the ranking is affected by the proximity of the keywords, and not just by their frequency.
The role of rank in search results can also be affected by how you initialize the objects that you use to perform the search. For example, of you use the
object, which is examined later in this chapter, you can specify how documents are sorted, in which case the rank of a document within the search is not relevant to the document's position in the list of documents resulting from the search.Query
There's also the size, in bytes, of the document, and the date and time it was last updated. At the bottom of the page is a button where we can show the next page of results. Notice that it "knows" that there are only five more to look at. Clicking it displays the next page with the title 'Documents 11 to 15':
At the bottom of this page is a message confirming that there are no more matches, and some controls that allow us to perform a new search. One of the strengths of Index Server is that there are several ways we can specify the documents we want to find. The default, which we've been using here, is to search for the text in the content of the document.
For the code that drives the search illustrated here, see the section 'How to Perform Static Queries' later in this chapter.