Limiter une recherche dans Index Server

crack_xp Messages postés 91 Date d'inscription samedi 28 février 2004 Statut Membre Dernière intervention 25 janvier 2007 - 2 avril 2004 à 16:17
cs_fabrice69 Messages postés 1765 Date d'inscription jeudi 12 octobre 2000 Statut Membre Dernière intervention 11 décembre 2013 - 3 avril 2004 à 01:43
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>



<!-- HAUT DU TABLEAU -->
<script language="javascript">tophaut();</script>
<!-- DEBUT DU TABLEAU -->
<table width="160" border="0" cellspacing="0" cellpadding="0">
----, </td>
,

----

,
Nouvelle recherche,

----

,
,

----

,
Rechercher un distributeur

</td>
<td colspan="2" valign="top">
Recherche,

----

,
,

----

,
<table width="500" border="0" cellspacing="0" cellpadding="0">
----, </td>
RESULTATS
DE VOTRE RECHERCHE >>

</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")

%>



<%
' Check to see if we got any results
If objRecordSet.EOF Then
%>
----

,
,

----

,
<%Response.Write "No results found, sorry for search phrase: " + strSearchPhrase %>
,

----

,
,

----

,

<%
else
Do While Not objRecordSet.EOF
%>
----

,
,

----

,
<%

Response.Write ""
If objRecordSet("DocTitle") <> "" Then
Response.Write objRecordSet("DocTitle")
Else
Response.Write objRecordSet("filename")
End If
Response.Write "
"

Response.Write ""

response.write("" & "Résumé : " & "" & Server.htmlEncode(objRecordSet("characterization"))&"...
")

objRecordSet.MoveNext

%>

,

----

,
,

----

,

<%
loop
end if

'Set the objects to nothing
Set objQuery = Nothing
Set objRecordSet = Nothing

%>

<% else %>
<%Response.Write "The Query contained only ignored words,try with another query.

,

----

,
,

----




<%end if%>



</td>
</tr>
<tr>
<td width="20"> </td>
<td> </td>
</tr>
</table>
</td>
</tr>
</table>
<form name="form1" action="d11.asp" method="post">



</form>

</html>

1 réponse

cs_fabrice69 Messages postés 1765 Date d'inscription jeudi 12 octobre 2000 Statut Membre Dernière intervention 11 décembre 2013 5
3 avril 2004 à 01:43
Tu trouveras sans doute la réponse dans cet articles ou les liens fournis :
- http://www.asp-php.net/tutorial/asp.net/indexingservices.php

Romelard Fabrice (Alias F___)
0
Rejoignez-nous