A prototype XML based web search engine
Keywords: Zipcode:
Enter search terms, Zip-code is optional and may contain a wildcard '*'
This example provides XML access to Thunderstone's Website Catalog of more than 40 million sites. You may view the XML output in a browser by using the form above, but the in order to access it with the correct MIME type an application would fetch results with a URL of the following form:
http://search.thunderstone.com/texis/xsearch/web.xml?q=QUERY&z=ZIP

where QUERY is the search you'd like to do
and   ZIP is an optional parameter to restrict answers to a Zipcode prefix.   

This is the Texis Webscript source code for this application.
Hyperlinks in the code will take you to the manual for that function.

Thunderstone: Texis Web Script Source Viewer
Texis Web Script source code for: http://search.thunderstone.com/texis/nonprox/xsearch/
Note: Click on links to view the documentation for HTML tags which are special to the Vortex compiler.
<script language=vortex>
<db=/usr2/nwalker>
<timeout=6></timeout>

<!-- Do a search ------------------------------------------------------------->

<a name=web>
<?xml version='1.0' ?>
<s xmlns:s="s">
<schema>                                 <!-- show schema header -->
<apicp denymode 0>                       <!-- disable pedantic protection -->
<apicp eqprefix "">                      <!-- disable the thesarus -->
<sql "set likeprows=20"></sql>           <!-- We'll never want more than 20 -->
<sql "set likepindexthresh=10000"></sql> <!-- Flatline at 10,000 answers -->
<sql "set likepallmatch=1"></sql>        <!-- only answers with all keywords -->
<sql "set indexreadbufsz=32768"></sql>
<$null ="">                              <!-- NULLify empty SQL clauses -->
<sandr '[^\alnum\*\-\"]+' ' ' $q><$q=$ret> <!-- clean trash from  the query -->

<results>
   <qstring>$q</qstring>
   
   <sql ROW max=20  "select $$rank rank,Site,Title,Abstract,Company,City,State,Zip,Category,Confidence,Rating
                	  from sites1
                	  where Company\Site\City\State\Zip\Title\Category\Abstract\Body
                	  likep $q
                	  ">

      <sitematch>	
	<rank>$rank</rank>
	<site>http://$Site/</site>
	<org><fmt "%H" $Company></org>
	<if $City neq "">
	   <city>$City</city>
	</if>
	<if $State neq "">
	   <state>$State</state>
	</if>
	<if $Zip neq "">
	   <zip>$Zip</zip>
	</if>
	<abs><fmt "%H" $Abstract></abs>
	<if $Category neq "">
	   <cat><fmt "http://search.thunderstone.com/texis/websearch?c=%U" $Category></cat>
	   <catcon>$Confidence</catcon>
	</if>
	<rating>$Rating</rating>
      </sitematch>
   </sql>
   
   <matchcount>$indexcount</matchcount>
</results>
</s>
</a>

<!-- Spit out the XML schema ------------------------------------------------->

<a name=schema>
<!-- <?xml:namespace name="urn:uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882/" as="s"/?> -->
<s:schema id='WebsiteCatalog'>
  <elementType id="qstring">
    <description>Query string presented to the database</description>
    <string.ansi/>
  </elementType> 
  <elementType id="rank">
    <description>Relevance rank value range 0-1000 </description>
    <int/>
  </elementType>
  <elementType id="site">
    <description>Web site</description>
    <uri/>
  </elementType>
  <elementType id="org">
    <description>Owner of the domain name </description>
    <string.ansi/>
  </elementType>
  <elementType id="city">
    <description>City of registration </description>
    <string.ansi/>
  </elementType>
  <elementType id="state">
    <description>State of registration </description>
    <string.ansi/>
  </elementType>
  <elementType id="zip">
    <description>State of registration </description>
    <string.ansi/>
  </elementType>
  <elementType id="hname">
    <description>Title of the site or hit </description>
    <string.ansi/>
  </elementType>
  <elementType id="abs">
    <description>Content abstract for a hit</description>
    <string.ansi/>
  </elementType>
  <elementType id="cat">
    <description>Primary category assigned to this site </description>
    <uri/>
  </elementType>
  <elementType id="catcon">
    <description>Confidence in the category: range 0-100 </description>
    <int/>
  </elementType>
  <elementType id="rating">
    <description>Probability that site contains adult content: range 0-1000 </description>
    <int/>
  </elementType>
  <elementType id="matchcount">
     <description>Number of records matching this query </description>
     <int/>
  </elementType>
  <elementType id="sitematch">
    <description>Structure of a matching site </description>
    <element type="#rank"/>
    <element type="#site"/>
    <element type="#org"/>
    <element type="#city"   occurs="OPTIONAL"/>
    <element type="#state"  occurs="OPTIONAL"/>
    <element type="#zip"    occurs="OPTIONAL"/>
    <element type="#hname"/>
    <element type="#abs"/>
    <element type="#cat"     occurs="OPTIONAL"/>
    <element type="#catcon"  occurs="OPTIONAL"/>
    <element type="#rating"/>
  </elementType>
  <elementType id="results">
    <description>Structure of result set</description>
    <element type="#qstring"/>
    <element type="#sitematch" occurs="ZEROORMORE"/>
    <element type="#matchcount" />
  </elementType>
</s:schema>
</a>


<a name=main>
<html><head><title>Thunderstone XML Search Engine Prototype</title></head>
<body bgcolor=white>
<tt><b>A prototype XML based web search engine</b></tt>
<form method=get action=/texis/xsearch/web.txt>
<table border=0>
  <tr>
  </tr><tr>
   <td>Keywords:<input name=q size=25></td>
   <td>Zipcode:<input name=z size=5></td>
   <td><input type=submit value=search></td>
  </tr><tr>
    <td colspan=3>Enter search terms, Zip-code is optional and may contain a wildcard '*'</td>
  </tr>
</table>
<explain>
<p>
<tt>
This is the <a href=http://www.thunderstone.com/vortexman/>Texis Webscript</a> source code for this application.<br>
Hyperlinks in the code will take you to the manual for that function.<br>
</tt>
</form>
<urlcp reparentmode abs>
<fetch "http://www.thunderstone.com/texis/demos/dox/hysource.html?demo=http://search.thunderstone.com/nonprox/xsearch.vor">
<sandr ">><NOINDEX>=!</NOINDEX>*</NOINDEX>" "" $ret>
<send $ret>
</a>

<a name=box><table border=1><tr><td bgcolor=#c0c0c0></a>
<a name=/box></tr></td></table></a>

<a name=explain>
<box>
This example provides XML access to Thunderstone's Website Catalog
of more than 40 million sites. You may view the XML output in a
browser by using the form above, but the in order to access it
with the correct MIME type an application would fetch results
with a URL of the following form:
<pre>
http://search.thunderstone.com/texis/xsearch/web.xml?q=QUERY&z=ZIP

where QUERY is the search you'd like to do
and   ZIP is an optional parameter to restrict answers to a Zipcode prefix.   
</pre>
</box>
</a>
</script>

Back to the Code Example List

The Source Viewer is also a Code Example.
Click Here to see its source.
Copyright © 1992-1999 Thunderstone Software