Implement full-text Indexing Based on ms index server.

Source: Internet
Author: User

One thing that has been depressing recently. There are articles of MB in the knowledge base on your machine. All of them have been sorted out in different directories. If you have encountered a problem in the past, find the collected articles directly. There were too many articles later. Then I thought it was too slow to find F3. So I want to make a full-text index. The reason for being depressed is not a technical problem. There are too many methods.
The full-text index of Oracle is put aside first. Because I hate fat stuff. Although I had to use it for mixed meals in the past.

The next step is ms SQL server's full-text search and index server.

In order to make a decision, I first propose two requirements.
1. It is required that the Knowledge Base be split by time and directory later. 2. Support for word, xls, txt, ppt, and html.3. support for aspx and pdf.

Requirement Analysis: because many of my knowledge bases are not on my own machine, I often take them home in a flash. However, if you want to press the directory, you often encounter issues that do not know which articles have not been split before. Therefore, each time is complete. Waste. However, it cannot be implemented in SQL server. Each differential backup score is based on the first full backup score. If there is this differential backup score = the first full backup score + the first N slave scores, that's fine. And many articles are HTML. With images. In SQL server, there is a one-to-many problem. It cannot be solved. And put it in the database. After the volume increases, it cannot be directly found on the hard disk or be invisible. Very uncomfortable.

Therefore, index server is selected.

Implementation process:
A: Create an index server. Needless to say, everyone on Earth knows this. Generally, XP is installed. Enable the service.
(Note: The index server has two catalogs by default. I think it is useless for a web. Another system. All your hard disks are included. So if you are not careful, you will find that the hard disk will become less GB in the future. So I deleted all the default catalogs. Create a clean one by yourself .)

Process
⒈ Start the index on the Windows 2000 Server.

By default, the Computer Management icon is located in the management tool group. The right side of the window provides information about the current server
Existing index information. By default, two indexes are available: System and Web.

To create a new index, right-click the Index Service or the panel on the right, and select create catalog.

The add catalog dialog box is displayed. Specify the index name and click the Browse button to select a location. The indexing service does not start indexing immediately. A message box is displayed
Click OK to continue. To achieve optimal performance, the indexing service can be deployed on a hard disk isolated from the Web server.

Catalog specifies the index directory, right-click the newly created catalog name, and select Properties from the pop-up menu. The Dialog Box 2 is displayed.

The first tab displays the content you just entered. Select the Web site you want to index from the WWW server drop-down list in the second tab trace.

The Catalog has the created catalog. Now you can select the directories you want to include in the index.

In fact, after the creation, you can use MS to query the default search page.

B: write your own code.
1. Using index server can be achieved through html pages. Use minispy to check the page of MS to find out where the HTML is stored. It is implemented using activex.
2. Of course, it can also be implemented using asp. At IIS4.0, query. asp used the index server DEMO in the IIS sample. However, it is said that IIS5.0 MS has removed it. However, you can find the query. asp file on drive C. I have never seen query. asp in iis 4.0, so it is hard to determine this.
3. Write it once using asp.net.


Private void BT_Search_Click (object sender, System. EventArgs e)
{
String constr = "PROVIDER = MSIDXS; data source = KB ";
OleDbConnection con = new OleDbConnection (constr );
Try
{
OleDbCommand cmd = new OleDbCommand ();
Cmd. Connection = con;
Cmd. CommandText = "SELECT Rank, FileName, Create, Access, Path from scope () where CONTAINS ('" + TB_Text.Text + ""')";
OleDbDataAdapter da = new OleDbDataAdapter ();
Da. SelectCommand = cmd;
Con. Open ();
DataSet ds = new DataSet ();
Da. Fill (ds );
DataGrid1.DataSource = ds;
}
Catch (Exception E)
{
.
}
Finally
{
Con. Close ();
}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.