HOWTO: Query for META Properties That Contain Dash Characters

ID: Q223298


The information in this article applies to:


SUMMARY

It is not possible to define a property in a Search catalog that contains a dash "-" character in the name. If a document defines a property that contains a dash, it is possible to reference this property via a name that does not contain a dash.


MORE INFORMATION

Consider the following META tag:


<meta name="corp-sponsor" content="Microsoft"> 
If an HTML file containing this META tag is cataloged by Search, you can find the document with the following query:

@meta_corp-sponsor Microsoft 
In order to search for and retrieve a document property in Search, it is necessary to add that property to the Search schema and mark the property with the Index and Retrieve flags. It is not possible to define a property in Search with a dash ("-") character in the name.

The following steps enable the searching and retrieval of the META property defined by the above META tag.
  1. Add the property to the Site Server Schema with the following settings:


  2. 
    Property name:  corp_sponsor
    Property set:   HTML Meta
    Property ID:    corp-sponsor
    Type:           string
    Index:          yes
    Retrieve:       yes 
  3. Rebuild the Search catalog.


  4. Define a column for the Query object, which references the META property:
    
    Q.DefineColumn "corp_sponsor = d1b5d3f0-c0b3-11cf-9a92-00a0c908dbf1 corp-sponsor" 
    The column can also be defined in the Definecolunms.txt file (see REFERENCES below)


  5. Add the column to the Query Object columns collection:


  6. 
    Q.Columns = "DocTitle, DocAddress, Description, corp_sponsor"  
    You can now search for the corp-sponsor property with the following syntax:
    
    @corp_sponsor Microsoft 
    You can also display the value of corp-sponsor by referencing corp_sponsor in the record set returned by the Query object:
    
    <a href="<% = RS("DocAddress")%>"><% = DocTitle %></a> corp-sponsor = <% = RS("corp_sponsor")%><br> 
Pay very close attention, when working with the instructions above, to the difference in placement between corp-sponsor and corp_sponsor.


REFERENCES

Site Server Documentation - "Columns Derived from META Tags"

Additional query words:


Keywords          : prodsitesrv3 
Version           : winnt:3.0
Platform          : winnt 
Issue type        : kbhowto 

Last Reviewed: July 8, 1999