This article was previously published under Q185985
This article has been archived. It is offered "as is" and will no longer be updated.
By default, you cannot include META information in query results fromIndex Server version 2.0. This article shows how you can both query METAinformation and show this information in the result sets using ActiveServer Pages (ASP).
First the META information must be cached by Index Server. To do this, open the Index Server Management Console, and go to the property list for the content that has been indexed.
If there are entries in the HTML document such as:
<meta name="animal" content="Elephant">
Then in the Properties list there should be an entry for "animal" under the Property Column, with a Property set of:
(The above is the globally unique identifier [GUID] for all META information.)
Right-click this entry, and then select Properties.
Check the option to cache this value. Set the Data Type to VT_LPWSTR. The default size should be acceptable for most string types.
To commit these changes, right-click Properties in the left panel and select Commit.
Re-scan the directories with the HTML files that have the META information required.
To build an ASP to use this information, you must first define a Column using Q.DefineColumn. This requires the GUID given above.
To query just the META information, the query string must be preceded with @metaname (in this example @animal). This forces Index Server to query only the META information.
A sample ASP that uses this information follows. Remember to replace allincidences of "animal" with your own Meta Tag Name. Note that theQ.DefineColumn line is continuous with the line containing the GUID:
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <% set Q = Server.CreateObject ("IXSSO.Query") Q.DefineColumn "animal (DBTYPE_WSTR) = 'append to above d1b5d3f0-c0b3-11cf-9a92-00a0c908dbf1 animal" Q.Query = "@animal Elephant" Q.Columns = "animal" set RS = Q.CreateRecordSet("sequential") %> <title>Sample Search</title> </head> <body> <p> <% Do While Not RS.EOF %> <p> <b>Type of animal: </b><%= RS("animal") %> </p> <% RS.MoveNext Loop %> </p> </body> </html>