crack_xp
Messages postés91Date d'inscriptionsamedi 28 février 2004StatutMembreDernière intervention25 janvier 2007
-
2 avril 2004 à 16:17
cs_fabrice69
Messages postés1765Date d'inscriptionjeudi 12 octobre 2000StatutMembreDernière intervention11 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 :
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 "
"