|
![]() |
名片设计 CorelDRAW Illustrator AuotoCAD Painter 其他软件 Photoshop Fireworks Flash |
|
<html><head><title>Microsoft Index Server: 查询语言</title> <SCRIPT LANGUAGE="JavaScript"> TempString = navigator.appVersion if (navigator.appName == "Microsoft Internet Explorer"){ // Check to see if browser is Microsoft if (TempString.indexOf ("4.") >= 0){ // Check to see if it is IE 4 document.writeln(\\\'<link rel="stylesheet" type="text/css" href="/iishelp/common/coua.css">\\\'); } else { document.writeln(\\\'<link rel="stylesheet" type="text/css" href="/iishelp/common/cocss.css">\\\'); } } else if (navigator.appName == "Netscape") { // Check to see if browser is Netscape document.writeln(\\\'<link rel="stylesheet" type="text/css" href="/iishelp/common/coua.css">\\\'); } else document.writeln(\\\'<link rel="stylesheet" type="text/css" href="/iishelp/common/cocss.css">\\\'); </script> <META NAME="DESCRIPTION" CONTENT="Tells how to refine searches by using complex queries"></head> <body bgcolor="#FFFFFF" text="#000000"> <font face="宋体"> <h1><a name="QueryLanguage">查询语言</a></h1> <p>通过在查询表格中键入单词或短语,然后单击按钮执行查询,就可以在 Web 站点中搜索任意的单词或短语(例如,查询表格示例中的“执行查询”按钮)。本节将介绍以下主题: </p> <ul> <li><strong><a href="#Operators">逻辑和相近运算符</a>:</strong>显示如何通过插入逻辑和相近运算符执行更精确的查询。</li> <li><strong><a href="#Wildcards">通配符</a>:</strong>帮助您查找包含与所给单词相似的单词的页。</li> <li><strong><a href="#FreeTextQueries">自由文本查询</a>:</strong> 说明如何基于短语的意思来表述一个查询,而不是用精确的单词。</li> <li><strong><a href="#VectorQueries">矢量空间查询</a>:</strong>解释如何获得与单词和短语列表匹配的查询结果。</li> <li><strong><a href="#PropertyValueQueries">属性值查询</a>:</strong>告诉您如何查询文件的属性值。</li> <li><strong><a href="#Examples">查询示例</a>:</strong>给出各种查询的示例。</li> <li><strong><a href="#PropertyNamesList">属性名列表</a>:</strong>列出和说明可用于查询的属性名。</li> </ul> <p>搜索产生一个文件列表,这些文件中包含某个单词或短语(不管单词或短语出现在文件中的任何地方)。下面列表给出表述查询的规则:</p> <ul> <li>连续的单词作为短语对待,它们在匹配文档中必须以一样的顺序出现。</li> <li>查询不区分大小写,因此可以用大写或小写键入查询。</li> <li>可以搜索任何单词,但不包括在例外列表中列出的单词(对于英语,包括 <em>a</em>、<em>an</em>、<em>and</em>、<em>as</em> 和其他一些单词), 它们在查询中将被忽略。</li> <li>在例外列表中的单词在短语中将作为占位符对待,用来进行相似查询。例如,假如查询“Word for Windows”,结果将给出“Word for Windows”和“Word and Windows” ,因为 <em>for </em> 是一个在例外列表中出现的虚词。</li> <li>标点符号在搜索时将被忽略,如句号 (.)、冒号 (:)、分号 (;) 和逗号 (,)。</li> <li>要在查询中使用特别对待的字符,如 &、|、^、#、@、$、(、),请用引号 (“) 将查询括起来。</li> <li>要搜索包含引号的单词或短语,请先用引号把整个短语括起来,并用两遍引号括住想用引号括起来的单词。例如,“World-Wide Web or ““Web””” 将搜索 <em>World-Wide Web or “Web”</em>。</li> <li>可以插入<a href="#Operators">逻辑运算符</a>(<strong>AND</strong>、 <strong>OR</strong> 和 <strong>NOT</strong>)以及<a href="#Operators">相近运算符</a> (<strong>NEAR</strong>) 来指定附加的搜索信息。</li> <li><a href="#Wildcards">通配字符</a> (*) 可以用所给前缀匹配单词。查询 esc* 可以匹配词条 “ESC”、“escape” 等等。</li> <li><a href="#FreeTextQueries">自由文本查询</a>可以不按查询语法指定查询。</li> <li>可以指定<a href="#VectorQueries">矢量空间查询</a>。</li> <li>可以执行 ActiveX™ (OLE) 和文件属性的<a href="#PropertyValueQueries">属性值查询</a>。</li> </ul> <h1><a name="Operators">逻辑和相近运算符</a></h1> <p>逻辑和相近运算符可以创建更精确的查询。</p> <table border="1" cellpadding="4" cellspacing="1" width="100%"> <tr> <th align="Left" valign="bottom" bgcolor="#C0C0C0" width=33%>搜索目标</th> <th align="Left" valign="bottom" bgcolor="#C0C0C0" width=33%>示例</th> <th align="Left" valign="bottom" bgcolor="#C0C0C0" width=33%>结果</th> </tr> <tr> <td valign="top">同一页中同时包含两个词条</td> <td valign="top"><code>access and basic</code><br> <strong>―</strong>或<strong>―</strong><br> <code>access & basic</code></td> <td valign="top">包含单词“access”和“basic”的页。</td> </tr> <tr> <td valign="top">同一页中包含两个词条之一</td> <td valign="top"><code>cgi or isapi</code><br> <strong>―</strong>或<strong>―</strong><br> <code>cgi | isapi</code></td> <td valign="top">包含单词“cgi”或“isapi”的页。</td> </tr> <tr> <td valign="top">包含第一个词条,但不包含第二个词条</td> <td valign="top"><code>access and not basic</code><br> <strong>―</strong>或<strong>―</strong><br> <code>access & ! basic</code></td> <td valign="top">包含单词“access”,但不包含单词“basic”的页。</td> </tr> <tr> <td valign="top">不匹配某个属性值的页</td> <td valign="top"><code>not @size = 100</code><br> <strong>―</strong>或<strong>―</strong><br> <code>! @size = 100</code></td> <td valign="top">大小不是 100 字节的页。</td> </tr> <tr> <td valign="top">同一页中同时包含两个词条,且互相靠近</td> <td valign="top"><code>excel near project</code><br> <strong>―</strong>或<strong>―</strong><br> <code>excel ~ project</code></td> <td valign="top">包含互相靠近的单词“excel”和“project”的页。</td> </tr> </table> <p>提示:</p> <ul> <li>可以在查询表达式中加入括弧,表达式中带括弧的部分比查询的其他部分先执行。</li> <li>使用双引号 (“) 可以指明逻辑或 <strong>NEAR</strong> 运算符要害字在查询中需要忽略。例如,“Abbott and Costello”将匹配包含该短语的页,而不是匹配符合该逻辑表达式的页。作为运算符,单词 <em>and</em> 在英语中是一个虚词。</li> <li><strong>NEAR</strong> 运算符与 <strong>AND</strong> 运算符相似, <strong>NEAR</strong> 也返回一页中两个单词都包含的页。但是,<strong>NEAR</strong> 和 <strong>AND</strong> 运算符不同之处在于,<strong>NEAR</strong> 要看单词是否靠近。也就是说,包含搜索单词较近的页的等级将大于或等于单词相隔较远的页的等级。假如搜索的单词相隔大于 50 个单词,该页将定为等级零</li> <li>在内容查询中,<strong>NOT</strong> 运算符只能用在 <strong>AND</strong> 运算符之后,它仅用来排除匹配前面内容约束的页。对于属性值查询,<strong>NOT</strong> 运算符可以不与 <strong>AND</strong> 运算符一起使用。</li> <li><strong>AND</strong> 运算符的优先级高于 <strong>OR</strong>。例如,下面的前三个查询相等,但第四个不同:<br> a AND b OR c<br> c OR a AND b<br> c OR (a AND b)<br> (c OR a) AND b</li> </ul> <p><strong>注重</strong> 在所有语言中,符号(&、|、!、 ~)与英语要害字 <strong>AND</strong>、<strong>OR</strong>、<strong>NOT</strong> 和 <strong>NEAR</strong> 的作用一样(Index Server 支持)。假如浏览器被设置为下列六种语言,本地化的要害字也可以使用。</p> <table border="1" cellpadding="4" cellspacing="1" width="100%"> <tr> <th align="Left" valign="bottom" bgcolor="#C0C0C0" width="40%">语言</th> <th align="Left" valign="bottom" bgcolor="#C0C0C0" width="60%">要害字</th> </tr> <tr> <td valign="top">德语</td> <td valign="top"><strong>UND</strong>、<strong>ODER</strong>、<strong>NICHT</strong>、<strong>NAH</strong></td> </tr> <tr> <td valign="top">法语</td> <td valign="top"><strong>ET</strong>、<strong>OU</strong>、<strong>SANS</strong>、 <strong>PRES</strong></td> </tr> <tr> <td valign="top">西班牙语</td> <td valign="top"><strong>Y</strong>、<strong>O</strong>、<strong>NO</strong>、<strong>CERCA</strong></td> </tr> <tr> <td valign="top">荷兰语</td> <td valign="top"><strong>EN</strong>、<strong>OF</strong>、<strong>NIET</strong>、 <strong>NABIJ</strong></td> </tr> <tr> <td valign="top">瑞典语</td> <td valign="top"><strong>OCH</strong>、<strong>ELLER</strong>、<strong>INTE</strong>、<strong>NÄRA</strong></td> </tr> <tr> <td>意大利语</td><td><strong>E</strong>、<strong>O</strong>、<strong>NO</strong>、<strong>VICINO</strong></td> </tr> </table> <p><strong>注重</strong> NEAR 运算符只能用于单词或短语。</p> <h1><a name="Wildcards">通配符</a></h1> <p><a name="Wildcards">通配符可以帮助您查找包含与所给单词相似的单词的页。</a></p> <table border="1" cellpadding="4" cellspacing="1" width="100%"> <tr> <th align="Left" valign="bottom" width=33% bgcolor="#C0C0C0"><a name="Wildcards">搜索目标</a></th> <th align="Left" valign="bottom" width=33% bgcolor="#C0C0C0"><a name="Wildcards">示例</a></th> <th align="Left" valign="bottom" width=33% bgcolor="#C0C0C0"><a name="Wildcards">结果</a></th></tr> <tr> <td valign="top"><a name="Wildcards">具有一样前缀的单词</a></td> <td valign="top"><a name="Wildcards"><code>comput*</code></a></td> <td valign="top"><a name="Wildcards">包含前缀为“comput”的单词的页,例如“computer”、“computing”等等</a>。</td> </tr> <tr> <td valign="top"><a name="Wildcards">基于同一个本词的单词</a></td> <td valign="top"><a name="Wildcards"><code>fly**</code></a></td> <td valign="top"><a name="Wildcards">包含基于一样本词“fly”的单词的页,例如“flying”、“flown”、“flew”等等</a>。</td> </tr> </table> <h1><a name="FreeTextQueries">自由文本查询</a></h1> <p><a name="FreeTextQueries">在自由文本查询中,查询引擎查找与单词或短语最佳匹配的页。这种查询匹配意思,而不是精确的单词。在自由文本查询中,逻辑、相近和通配运算符都将被忽略。自由文本查询以 $contents 为前缀。</a></p> <table border="1" cellpadding="4" cellspacing="1" width="100%"> <tr><th align="Left" valign="bottom" width=33% bgcolor="#C0C0C0"><a name="FreeTextQueries">搜索目标</a></th> <th align="Left" valign="bottom" width=33% bgcolor="#C0C0C0"><a name="FreeTextQueries">示例</a></th> <th align="Left" valign="bottom" width=33% bgcolor="#C0C0C0"><a name="FreeTextQueries">结果</a></th> </tr> <tr> <td valign="top"><a name="FreeTextQueries">匹配自由文本的文件</a></td> <td valign="top"><a name="FreeTextQueries"><code>$contents how do I print in Microsoft Excel? </code></a></td> <td valign="top"><a name="FreeTextQueries">提到 printing 和 Microsoft Excel 的页。</a></td> </tr> </table> <h1><a name="VectorQueries">矢量空间查询</a></h1> <p>查询引擎支持矢量空间查询。矢量查询返回匹配单词和短语列表的页,每页的排列指明了页面与查询匹配的程度。</p> <table border="1" cellpadding="4" cellspacing="1" width="100%"> <tr> <th align="Left" valign="bottom" width=33% bgcolor="#C0C0C0">搜索目标</th> <th align="Left" valign="bottom" width=33% bgcolor="#C0C0C0">示例</th> <th align="Left" valign="bottom" width=33% bgcolor="#C0C0C0">结果</th></tr> <tr> <td valign="top">包含指定单词的页</td> <td valign="top"><code>light, bulb</code></td> <td valign="top">包含与搜索单词最匹配的单词的文件</td> </tr> <tr> <td valign="top">包含加权的前缀、单词和短语的页</td> <td valign="top"><code>invent*, light[50], bulb[10], "light bulb"[400]</code></td> <td valign="top">包含以“invent,”为前缀的单词、单词“light”、 “bulb”和短语“light bulb”的文件(词条被加权)</td> </tr> </table> <p> <!-- </p> --><br> <ul> <li>在矢量查询中的组件以逗号隔开。</li> <li>矢量查询中的组件可以用 [weight] 语法加权。</li> <li>矢量查询返回的页不必匹配查询的所有词条。</li> <li>当结果按等级排序时,矢量查询最好。</li> </ul> <h1><a name="PropertyValueQueries">属性值查询</a></h1> <p>用属性值查询,可以查找含有与所给标准相匹配的属性值的文件。可以用来查询的属性包括文件的基本信息(如文件名、文件大小)和 ActiveX 属性(包含在文档摘要中),ActiveX 属性由 ActiveX 应用程序创建并存储在文件中。</p> <p>下面是两种类型的属性查询:</p> <ul> <li><a name="PropertyValueQueries"><strong>关系属性查询</strong>包括“at”字符 (@)、</a><a href="#PropertyNames">属性名</a>、<a href="#RelationalOperators">关系运算符</a>和<a href="#PropertyValues">属性值</a>。例如,要查找大小超过一兆字节的文件,可以执行查询 @size > 1000000。</li> <li><strong>正则表达式查询</strong>包括号码符号 (#)、属性名和属性值的<a href="#RegularExpressions">正则表达式</a>。例如,要查找所有视频 (.avi) 文件,可以执行查询 #filename *.avi。正则表达式不会匹配特定的属性内容 (#contents) 和全部 (#all)。 在查询中不能检索的属性不能用于 # 查询,包括未存储在属性缓存中的 HTML META 属性。</li> </ul> <p>本节包含以下主题:</p> <ul> <li><a href="#PropertyNames">属性名</a></li> <li><a href="#RelationalOperators">关系运算符</a></li> <li><a href="#PropertyValues">属性值</a></li> </ul> <h2><a name="PropertyNames">属性名</a></h2> <p>属性名以“at”(@) 或号码符号 (#) 开头,@ 用于关系查询,# 用于正则表达式查询。</p> <p>假如未指定属性名,将假定为 <em>@contents</em>。</p> <p>所有文件中都可用的属性包括:</p> <table border="1" cellpadding="4" cellspacing="1" width="100%"> <tr> <th align="Left" valign="bottom" bgcolor="#C0C0C0" width="40%">属性名</th> <th align="Left" valign="bottom" bgcolor="#C0C0C0" width="60%">说明</th></tr> <tr> <td valign="top">All</td> <td valign="top">匹配单词、短语和任何属性</td> </tr> <tr> <td valign="top">Contents</td> <td valign="top">文件中单词和短语</td> </tr> <tr> <td valign="top">Filename</td> <td valign="top">文件的名称</td> </tr> <tr> <td valign="top">Size</td> <td valign="top">文件大小</td> </tr> <tr> <td valign="top">Write</td> <td valign="top">文件的最后一次修改时间</td> </tr> </table> <p>ActiveX 属性值也可以用于查询,绝大多数由 ActiveX 应用程序创建的 Web 站点文件可以用下列属性查询:</p> <table border="1" cellpadding="4" cellspacing="1" width="100%"> <tr> <th align="Left" valign="bottom" bgcolor="#C0C0C0" width="40%">属性名</th> <th align="Left" valign="bottom" bgcolor="#C0C0C0" width="60%">说明</th></tr> <tr> <td valign="top">DocTitle</td> <td valign="top">文档的标题</td> </tr> <tr> 返回类别: 教程 上一教程: ASP中ADODB STREAM组件的具体用法 下一教程: 无组件上传图片到数据库中 您可以阅读与"用ASP怎样编写文档搜索页面(1)"相关的教程: · 用ASP怎样编写文档搜索页面(4) · 用ASP怎样编写文档搜索页面(6) · 用ASP怎样编写文档搜索页面(5) · 用ASP怎样编写文档搜索页面(2) · 用ASP怎样编写文档搜索页面(3) |
![]() ![]() |
快精灵印艺坊 版权所有 |
首页![]() ![]() ![]() ![]() ![]() ![]() ![]() |