a***@gmail.com
2007-03-13 17:20:15 UTC
When attempting to search directory names with the aspx page below, it
searches for 3-5 minutes and then returns no records even when I input
known valid search criteria. I've tested it on another machine and it
works flawlessly. I'm guessing that something is not configured
correctly on my production box? Any ideas on what I might be
missing? I've set filterdirectories to 1 in the registry and cached
directory in the catalog properties.
default.aspx
-------
<%@ Page Language="VB" AutoEventWireup="true"
CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/
TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Style="Z-INDEX: 102;
left: 10px; position: absolute; top: 10px"
Text="GF# to locate:"></asp:Label>
<asp:TextBox id="TextBox1" style="Z-INDEX: 101; LEFT: 103px;
POSITION: absolute; TOP: 10px" runat="server" Width="83px"></
asp:TextBox>
<asp:Button id="Button1" style="Z-INDEX: 103; LEFT: 131px;
POSITION: absolute; TOP: 40px" runat="server"
Text="Search"></asp:Button>
<asp:GridView ID="GridView1" runat="server" Style="left:
10px; position: absolute;
top: 70px" AutoGenerateColumns="false"
EmptyDataText="No Records found!">
<Columns>
<asp:TemplateField HeaderText="GF">
<ItemTemplate>
<%# getgf(eval("url")) %>
</ItemTemplate>
</asp:TemplateField>
<asp:HyperLinkField DataNavigateUrlFormatString="http://
imagestore{0}" HeaderText="Filename"
Datatextfield="filename" DataNavigateUrlFields="url"
target="pdfdetails"/>
</Columns>
</asp:GridView>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1"
runat="server" ControlToValidate="TextBox1"
ErrorMessage="You must enter a GF#..." Style="z-index:
110; left: 10px; position: absolute;
top: 65px" Width="158px" SetFocusOnError="True"></
asp:RequiredFieldValidator>
<iframe name="pdfdetails" id="pdfdetails" style="left: 200px;
width: 700px; position: absolute; top: 10px; height: 800px"></iframe>
</div>
</form>
</body>
</html>
------
default.aspx.vb
-----
mports System.Data
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim strCatalog As String
' Catalog Name
strCatalog = "web"
Dim strQuery As String
strQuery = "Select DocTitle,Filename,Size,vpath,PATH,URL from
SCOPE() where path like '" & "%" & TextBox1.Text & "%" & "'"
' TextBox1.Text is word that you type in the text box to query
by using Index Service.
'
Dim connString As String = "Provider=MSIDXS.1;Integrated
Security .='';Data Source='" & strCatalog & "'"
Dim cn As New System.Data.OleDb.OleDbConnection(connString)
Dim cmd As New System.Data.OleDb.OleDbDataAdapter(strQuery,
cn)
Dim testDataSet As New DataSet()
cmd.Fill(testDataSet)
' Bind DataGrid to the DataSet. DataGrid is the ID for the
' DataGrid control in the HTML section.
Dim source As New DataView(testDataSet.Tables(0))
GridView1.DataSource = source
GridView1.DataBind()
End Sub
Public Function getgf(ByVal urlpath As String) As String
Dim urlpathlen
Dim urlpathlastslash
urlpathlen = Len(urlpath)
urlpath = Right(urlpath, urlpathlen - 1)
urlpathlastslash = InStr(urlpath, "/")
urlpath = Left(urlpath, urlpathlastslash - 1)
Return urlpath
End Function
End Class
------
searches for 3-5 minutes and then returns no records even when I input
known valid search criteria. I've tested it on another machine and it
works flawlessly. I'm guessing that something is not configured
correctly on my production box? Any ideas on what I might be
missing? I've set filterdirectories to 1 in the registry and cached
directory in the catalog properties.
default.aspx
-------
<%@ Page Language="VB" AutoEventWireup="true"
CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/
TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Style="Z-INDEX: 102;
left: 10px; position: absolute; top: 10px"
Text="GF# to locate:"></asp:Label>
<asp:TextBox id="TextBox1" style="Z-INDEX: 101; LEFT: 103px;
POSITION: absolute; TOP: 10px" runat="server" Width="83px"></
asp:TextBox>
<asp:Button id="Button1" style="Z-INDEX: 103; LEFT: 131px;
POSITION: absolute; TOP: 40px" runat="server"
Text="Search"></asp:Button>
<asp:GridView ID="GridView1" runat="server" Style="left:
10px; position: absolute;
top: 70px" AutoGenerateColumns="false"
EmptyDataText="No Records found!">
<Columns>
<asp:TemplateField HeaderText="GF">
<ItemTemplate>
<%# getgf(eval("url")) %>
</ItemTemplate>
</asp:TemplateField>
<asp:HyperLinkField DataNavigateUrlFormatString="http://
imagestore{0}" HeaderText="Filename"
Datatextfield="filename" DataNavigateUrlFields="url"
target="pdfdetails"/>
</Columns>
</asp:GridView>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1"
runat="server" ControlToValidate="TextBox1"
ErrorMessage="You must enter a GF#..." Style="z-index:
110; left: 10px; position: absolute;
top: 65px" Width="158px" SetFocusOnError="True"></
asp:RequiredFieldValidator>
<iframe name="pdfdetails" id="pdfdetails" style="left: 200px;
width: 700px; position: absolute; top: 10px; height: 800px"></iframe>
</div>
</form>
</body>
</html>
------
default.aspx.vb
-----
mports System.Data
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim strCatalog As String
' Catalog Name
strCatalog = "web"
Dim strQuery As String
strQuery = "Select DocTitle,Filename,Size,vpath,PATH,URL from
SCOPE() where path like '" & "%" & TextBox1.Text & "%" & "'"
' TextBox1.Text is word that you type in the text box to query
by using Index Service.
'
Dim connString As String = "Provider=MSIDXS.1;Integrated
Security .='';Data Source='" & strCatalog & "'"
Dim cn As New System.Data.OleDb.OleDbConnection(connString)
Dim cmd As New System.Data.OleDb.OleDbDataAdapter(strQuery,
cn)
Dim testDataSet As New DataSet()
cmd.Fill(testDataSet)
' Bind DataGrid to the DataSet. DataGrid is the ID for the
' DataGrid control in the HTML section.
Dim source As New DataView(testDataSet.Tables(0))
GridView1.DataSource = source
GridView1.DataBind()
End Sub
Public Function getgf(ByVal urlpath As String) As String
Dim urlpathlen
Dim urlpathlastslash
urlpathlen = Len(urlpath)
urlpath = Right(urlpath, urlpathlen - 1)
urlpathlastslash = InStr(urlpath, "/")
urlpath = Left(urlpath, urlpathlastslash - 1)
Return urlpath
End Function
End Class
------