Document Searching
-
I am trying to find some direction on document searching. We have a Desktop application (VB.NET) and I want to incorporate document searching into the application. The application runs on a terminal server and accesses a standalone SQL server. I am currently looking into using the Indexing Service on a file server to index the documents(and possibly Exchange)) and then I will query the catalog(s), either directly from my application or, from my SQL server. When searching this topic I find that almost all of the discussions/examples revolve around web sites and searching web content. There seems to be no mention of doing this for a desktop application. Am I on the right track? Any pointers on: -Querying index catalogs (VB.Net)? -Running SQL queries on remote index servers -Performance. -Other options...
-
I am trying to find some direction on document searching. We have a Desktop application (VB.NET) and I want to incorporate document searching into the application. The application runs on a terminal server and accesses a standalone SQL server. I am currently looking into using the Indexing Service on a file server to index the documents(and possibly Exchange)) and then I will query the catalog(s), either directly from my application or, from my SQL server. When searching this topic I find that almost all of the discussions/examples revolve around web sites and searching web content. There seems to be no mention of doing this for a desktop application. Am I on the right track? Any pointers on: -Querying index catalogs (VB.Net)? -Running SQL queries on remote index servers -Performance. -Other options...
Hello, I'm not completely sure to what you mean, but if your looking for a way to search for items in a directory (both network drive or local drive) you can use the following code:
Dim filenames = My.Computer.FileSystem.GetFiles("C:", FileIO.SearchOption.SearchAllSubDirectories, "*.txt")
For Each filename As String In filenames
messagebox.show(filename)
Next'NOTE if your system gives errors add the following line on top of your class: Imports System.IO
this example will look for .txt files on your c drive and display each of there file paths in a messagebox. since this function uses the windows search function it will work faster if you got your drives indexed. also narrowing down your search path will speed things up. for querying things from a SQL database you can just push a query text to the server while declaring it as a "SqlCommand" (dont forget to add Imports System.Data.SqlClient on top of your code). here[^] is a tutorial. its for ado.net but it works the same in a vb.net desktop application.
-
Hello, I'm not completely sure to what you mean, but if your looking for a way to search for items in a directory (both network drive or local drive) you can use the following code:
Dim filenames = My.Computer.FileSystem.GetFiles("C:", FileIO.SearchOption.SearchAllSubDirectories, "*.txt")
For Each filename As String In filenames
messagebox.show(filename)
Next'NOTE if your system gives errors add the following line on top of your class: Imports System.IO
this example will look for .txt files on your c drive and display each of there file paths in a messagebox. since this function uses the windows search function it will work faster if you got your drives indexed. also narrowing down your search path will speed things up. for querying things from a SQL database you can just push a query text to the server while declaring it as a "SqlCommand" (dont forget to add Imports System.Data.SqlClient on top of your code). here[^] is a tutorial. its for ado.net but it works the same in a vb.net desktop application.
-
No, I want to be able to search content. I want to have a form in my application where the user types search terms and I return a list of documents that the content thereof matches the search criteria.
You mean content from inside the document? like a word or sentence?
-
You mean content from inside the document? like a word or sentence?
Yes. I have Index Server cataloging the content already and I have a test windows app that queries the content of the catalog using OLEDB. This works fine when I run it on the index server. The problem is that I can't access the catalog from another machine. Is there an easier way???
-
Yes. I have Index Server cataloging the content already and I have a test windows app that queries the content of the catalog using OLEDB. This works fine when I run it on the index server. The problem is that I can't access the catalog from another machine. Is there an easier way???
So basically what you now have is a database with the cataloged content of all the items? Then i think the best way to go is to indeed use that database. If its a oledb you should be able to access it trough code. if it gives errors check if the permissions of the database allow a external user to read from it. And that there isnt a firewall blocking your path.
-
I am trying to find some direction on document searching. We have a Desktop application (VB.NET) and I want to incorporate document searching into the application. The application runs on a terminal server and accesses a standalone SQL server. I am currently looking into using the Indexing Service on a file server to index the documents(and possibly Exchange)) and then I will query the catalog(s), either directly from my application or, from my SQL server. When searching this topic I find that almost all of the discussions/examples revolve around web sites and searching web content. There seems to be no mention of doing this for a desktop application. Am I on the right track? Any pointers on: -Querying index catalogs (VB.Net)? -Running SQL queries on remote index servers -Performance. -Other options...
Hey, Sorry for the double awsner but i ran into this today
Dim filenames = My.Computer.FileSystem.FindInFiles("C:\", "text you want to find", True, FileIO.SearchOption.SearchAllSubDirectories)
arguments: 1. root folder, 2. searched text, 3. ignore capital, 4. seachoption. returntype: a array of file locations (string)