<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> <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>
<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>