begin process at 2012 05 28 00:29:01
  Trouver un code source :
 
dans
 
Accueil > Forum > 

Archive ASP & ASP.NET

 > 

Archives ASP & ASP.NET

 > 

IIS et l'ASP

 > 

Limiter une recherche dans Index Server


Derniers messages déposésPoser une question dans le forum ou lancer une discussion

Limiter une recherche dans Index Server

vendredi 2 avril 2004 à 16:17:52 | Limiter une recherche dans Index Server

crack_xp

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>
samedi 3 avril 2004 à 01:43:08 | Re : Limiter une recherche dans Index Server

fabrice69

Administrateur CodeS-SourceS
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___)


Cette discussion est classée dans : set, server, recherche, objquery, write


Répondre à ce message

Sujets en rapport avec ce message

**URGENT**Probleme avec RecordCount [ par N.BERRA ] Salut a tous,Je fais afficher dans une page des données que je vais chercher dans une base SQLServerConnection OK!Affichage OK!<img src=/imgs2/smile_a fichier texte, permission & hebergeur [ par phildarvador ] Salut à tous,j'ai une page asp qui ecrit dans un fichier texte des données d'une table. Jusqu'ici, tout va bien, mais que sur win98/pws. sur win2000/i Fichiers externes au site web [ par gg16819 ] Bonjour,Je souhaiterais lister le contenu d'un dossier situé sur un poste externe au site web.Pour cette opération avec du dossier local, j'utilise le Supprimer un fichier [ par damdam2782 ] Bonjour j'ai besoin de savoir comment supprimer un fichier, en fait j'ai déjà fait plusieurs tentatives, mais aucune ne fonctionne, le fichier ne s'ef ADODB.Command error '800a0bb9' [ par kikinouGIP ] Bonjour tlmd'une page asp j'appelle une proc stockée sql serveret j'ai une erreur de type ADODB.Command error '800a0bb9' .*******Voici mon code :**** update db.. [ par gwiedd ] je risque d'etre un peu long pardon ..voila mon probleme je recup des variable d'un formulaire et les affiche avant update, toutes les données sont b SQL Server et requete avec une date [ par ludo82 ] Bonjour,Je suis entrain de développer un agenda d'événement avec un moteur de recherche ou l'on eu faire un recherche en spécifiant une date.Le problè Index server et documents sur cdrom [ par pestounette ] Bonjour,J'ai un soucis : je dois effectuer une recherche plein texte sur des fichiers situés sur un cd. J'ai créé un catalogue avec index server, mais Erreur sur une requête paramétrée [ par guillem69 ] Bonjour, A l'execution de ma requête, je tombe sur le message d'erreur :"Microsoft OLE DB Provider for ODBC Drivers error '80040e21' [Microsoft][ODBC Update [ par malhivertman1 ] qq peut-il me dire pourquoi mon update ne march pa?idlog = Session("idlog") ' connexion Set Conn = server.CreateObject ("ADODB.connection")Conn.Open "


Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Mai 2012
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

Consulter la suite du CalendriCode

Photothèque

A découvrir



 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,390 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales