bonjour, je fait une recherche sur dans toutes les pages asp qui se trouvent dans un repertoir et je voudrais afficher les resultats de la recherhce, mais le probleme c que Index Server me rend toutes les pages qui ont au moins un mot parmis la chaine a rechercher alors que moi je veux seulement la pages qui auquel se trouve la phrase entiere...
voila mon code :
<% Option Explicit %>
<html>
<head>
<title>SGG PRODUITS</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" src="sgg.js"></script>
<script language="javascript">
if (navigator.appName == "Netscape"){
document.write('<link rel="stylesheet" href="sggnet.css">');
}
else{
document.write('<link rel="stylesheet" href="sgg.css">');
}
//-->
</script>
<Script language="JavaScript">
<!-- hide from browsers
function post_form_prod(par_val){
document.form1.hidctl_prod.value=par_val;
document.form1.submit();
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF" marginwidth="0" marginheight="0" leftmargin="0" topmargin="0">
<!-- HAUT DU TABLEAU -->
<script language="javascript">tophaut();</script>
<!-- DEBUT DU TABLEAU -->
<table width="780" border="0" cellspacing="0" cellpadding="0" background="img/transp.gif">
<tr>
<td width="160" valign="top">
<table width="160" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="10" valign="top"> </td>
<td width="150"> </td>
</tr>
<tr>
<td width="10" valign="top"><img src="img/home_puce_or.gif" width="7" height="7" vspace="5"></td>
<td width="150"><a href="http://217.19.54.134/sgg/fr/" class="lienactu1">Nouvelle recherche</a></td>
</tr>
<tr>
<td width="10" valign="top"> </td>
<td width="150"> </td>
</tr>
<tr>
<td width="10" valign="top"><img src="img/home_puce_or.gif" width="7" height="7" vspace="5"></td>
<td width="150"><a href="#" class="lienactu1">Rechercher un distributeur</a></td>
</tr>
</table>
</td>
<td colspan="2" valign="top">
<table width="620" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"> </td>
<td class="titre"> </td>
</tr>
<tr>
<td width="20"> </td>
<td class="titre"><font color="#2828a9">Recherche</font></td>
</tr>
<tr>
<td width="20"> </td>
<td> </td>
</tr>
<tr>
<td width="20"> </td>
<td>
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#0066CC" width="20"> </td>
<td bgcolor="#0066CC" width="480"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b><font color="#CCFFFF">RESULTATS
DE VOTRE RECHERCHE >></font></b></font> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="20"> </td>
<td>
<%
Dim strSearchPhrase
Dim objQuery
Dim objRecordSet
Dim objField
Dim ObjetUtil
' Pull the search phrase out of the request
strSearchPhrase = Request.form("searchPhrase")
' Check to see if we should return results or just the form
If strSearchPhrase <> "" and len (strSearchPhrase)>1 Then
' Create the query object
Set objQuery = Server.CreateObject("ixsso.Query")
objQuery.Query = strSearchPhrase
' objQuery.Query = SELECT ALL FROM SCOPE() WHERE size > 500000
Set ObjetUtil=Server.CreateObject("Ixsso.Util")
ObjetUtil.AddScopeToQuery objQuery,"d:\Clients\www.saint-gobain-glass.com\fichiers\fr", "Shallow"
' The name of the catalog we created in the index server GUI
objQuery.Catalog = "Web"
' Set the maximum number of records returned
objQuery.MaxRecords = 10
' Set the columns we are going to get back
objQuery.Columns = "DocTitle,vpath,filename,characterization"
' Set the sort by, which specifies which columns in the search results should be used for the sort
objQuery.SortBy = "rank[d]"
' Get the results
Set objRecordSet = objQuery.CreateRecordSet("nonsequential")
%>
<table width="500" border="0" cellspacing="0" cellpadding="0" background="img/transp.gif">
<%
' Check to see if we got any results
If objRecordSet.EOF Then
%>
<tr background="img/pix_bleu_clair.gif">
<td width="38" background="img/pix_bleu_clair.gif"> </td>
<td width="462" background="img/pix_bleu_clair.gif"> </td>
</tr>
<tr background="img/pix_bleu_clair.gif">
<td width="38" background="img/pix_bleu_clair.gif"> </td>
<td width="462" class="text" background="img/pix_bleu_clair.gif"><%Response.Write "No results found, sorry for search phrase: " + strSearchPhrase %>
</i></font></td>
</tr>
<tr background="img/pix_bleu_clair.gif">
<td width="38" background="img/pix_bleu_clair.gif"> </td>
<td width="462" background="img/pix_bleu_clair.gif"> </td>
</tr>
<tr>
<td width="462" bgcolor="#0066CC" colspan=2><img src="img/transp.gif" width="1" height="1"></td>
</tr>
<%
else
Do While Not objRecordSet.EOF
%>
<tr background="img/pix_bleu_clair.gif">
<td width="38" background="img/pix_bleu_clair.gif"> </td>
<td width="462" background="img/pix_bleu_clair.gif"> </td>
</tr>
<tr background="img/pix_bleu_clair.gif">
<td width="38" background="img/pix_bleu_clair.gif"> </td>
<td width="462" class="text" background="img/pix_bleu_clair.gif">
<%
Response.Write "<a href='" & objRecordSet("vpath") & "'>"
If objRecordSet("DocTitle") <> "" Then
Response.Write objRecordSet("DocTitle")
Else
Response.Write objRecordSet("filename")
End If
Response.Write "</a><br>"
Response.Write "<p>"
response.write("<b><i><font color=#2828a9>" & "Résumé : " & "</font></i></b>" & Server.htmlEncode(objRecordSet("characterization"))&"...<br>")
objRecordSet.MoveNext
%>
</i></font></td>
</tr>
<tr background="img/pix_bleu_clair.gif">
<td width="38" background="img/pix_bleu_clair.gif"> </td>
<td width="462" background="img/pix_bleu_clair.gif"> </td>
</tr>
<tr>
<td width="462" bgcolor="#0066CC" colspan=2><img src="img/transp.gif" width="1" height="1"></td>
</tr>
<%
loop
end if
'Set the objects to nothing
Set objQuery = Nothing
Set objRecordSet = Nothing
%>
</table>
<% else %>
<table width="500" border="0" cellspacing="0" cellpadding="0" background="img/transp.gif">
<tr background="img/pix_bleu_clair.gif">
<td width="38" background="img/pix_bleu_clair.gif"> </td>
<td width="462" background="img/pix_bleu_clair.gif"> </td>
</tr>
<tr background="img/pix_bleu_clair.gif">
<td width="38" background="img/pix_bleu_clair.gif"> </td>
<td width="462" class="text" background="img/pix_bleu_clair.gif"><%Response.Write "The Query contained only ignored words,try with another query.<br><br Result of search phrase: " + strSearchPhrase %>
</i></font></td>
</tr>
<tr background="img/pix_bleu_clair.gif">
<td width="38" background="img/pix_bleu_clair.gif"> </td>
<td width="462" background="img/pix_bleu_clair.gif"> </td>
</tr>
<tr>
<td width="462" bgcolor="#0066CC" colspan=2><img src="img/transp.gif" width="1" height="1"></td>
</tr>
</table>
<%end if%>
</td>
</tr>
<tr>
<td width="20"> </td>
<td> </td>
</tr>
</table>
</td>
</tr>
</table>
<form name="form1" action="d11.asp" method="post">
<input type="hidden" name="hidctl_prod" value="">
<input type="hidden" name="slt_fct" value="Composants de fenêtre">
<input type="hidden" name="slt_app" value="-1">
</form>
</body>
</html>