Querying for Document Properties

In addition to document contents, Index Server also indexes document properties. These properties usually correspond to standard ActiveX properties such as Title and Author. Index Server also indexes particular HTML tags, such as <META>, <TITLE>, and so on as individual properties. Properties represent another type of important document data that users may want to search for.

To search for documents written by a certain author
  1. In the left frame of the Sample HTM/IDQ/HTX Search Form, click Advanced ASP Sample in the left frame of the browser.
  2. Click Clear to clear any text from all boxes in the form.
  3. In the Document author box, type the name Thompson.
  4. Click the Execute button.
  5. Index Server looks for all documents authored by someone whose name contains the word Thompson. Because the Enter your query box is blank, Index Server ignores the contents of the document and looks only at the Author property.

  6. Scroll down to see the query results.
  7. Scroll back up, and click Clear.
  8. In the Document author box, type Thompson or Steve.
  9. This query looks for all documents that contain either Thompson or Steve in the Author property. Property queries support all the standard content Boolean operators such as AND, NEAR, and OR.

  10. Click Execute to see the results.

You can manipulate query forms to view results in different ways. In the next test drive, you will send the same query as in the previous procedure, but you will sort the results differently.

To change how results are sorted
  1. In your preferred text editor, open the Advquery.asp file.
  2. Search for the following line:
  3. 
    <INPUT TYPE="HIDDEN" NAME="SortBy" VALUE="rank[d]">
    

    The value of SortBy is "rank[d]". This value sorts the hits in descending order.

  4. Change this value to "rank[a]". The line should read as follows:
  5. 
    <INPUT TYPE="HIDDEN" NAME="SortBy" VALUE="rank[a]">
    

  6. Save the Advquery.asp file.
  7. In the Advanced ASP Sample, click Clear, and in the Document author box, type Thompson or Steve.
  8. Click Execute.
  9. Note that the same results are returned because the text in the Document author box is the same as before. This time, however, the results are sorted by the Author property value in ascending order (rank[a]). Because the Document author box contains text only and does not differentiate between first and last names, Index Server does a simple text-based sort. That is why the document written by Kathleen Thompson (Ixserver.doc) appears before the one written by Steve Ross (Ixserver.xls).

  10. In the Advquery.asp, restore the value of SortBy to descending order (rank[d]), save the file, and exit the text editor.

In the next test drive, you will see that Index Server can search simultaneously for content and author.

To search for text and author
  1. In the Advanced ASP Sample, click Clear.
  2. In the Enter your query box, type query features.
  3. In the Document author box, type Barnes.
  4. Click Execute to see the results.
  5. Index Server looks for all documents that contain the words query features, where the author of the document is Barnes. As you can see, Index Server finds the one document that matches these two search restrictions, Ixserver.ppt.


© 1997 by Microsoft Corporation. All rights reserved.

Comments: