Windows indexing service

Source: Internet
Author: User
Yesterday, a colleague wanted to know windows full-text search, but he had never used it before. So yesterday he spent some time learning about Indexing Service and programming.

1. To use the Windows full-text search service, you must first ensure that "Index Service" is installed in "Add/delete Programs \ Add/delete Windows Components ":
Then you can use the Indexing Service, including programming.

After the Index Service is installed, you can find the Index Service in "Computer Management \ service and application \" and set and manage it:


By default, two catalogs, system and web, are used to create and maintain local files and local website indexes. Each catalog contains multiple directories and a set of properties.

2. Documents, programming references, and code snippets related to Windows indexing service can be found in msdn. The following links are provided:

Http://msdn.microsoft.com/library/default.asp? Url =/library/en-US/dnanchor/html/indexserv. asp

Http://msdn.microsoft.com/library/default.asp? Url =/library/en-US/indexsrv/html/ixrefobj_3skz.asp 3. because indexingservice APIs are provided in the form of COM components, to call related APIs in a program, you must first add references to the following Type Library:

API Reference Library
Admin helper Indexing Service Administration Type Library 1.0 Ciodmlib
Query helper Ixsso control library Cisso
ADO Micorsoft ActiveX Data Objects (ADO)VersionLibrary, whereVersionIs one of the available versions. ADODB

The following is a programming object for setting and managing the Indexing Service:

Object Name Description
Adminindexserver Manages Indexing Service. allows access to all the functionality provided by the Microsoft Management Console (MMC) snap-in.
Catadm Manages the collection of scopes for a catalog.
Scopeadm Manages an individual scope.

The following is a programming object for full-text search through indexingservice:

Object Name Description
Query Manages the query definition and result-set creation and navigation.
Utility Helpful utilities for managing the queries and result sets.

The msdn document provides some simple sample code, including VBScript, JScript, Visual Basic, Visual C ++, and Visual J ++. net code.

4. If you want to use the Indexing Service in the. NET environment, you also need to reference the above three COM components:
Then you can call the API through the class encapsulated by InterOP in the code. The following is a sample code that implements the simple search function:
Complete sample code download: http://phoebusd.mofile.com/4484472520119593/7410790504088141/2/0B459B9BE5C0E179512B394A987B482E/FulltextSearchSample.rar

The program running interface is as follows:


The above is just a simple introduction to the indexing service, and I have attempted to write a very simple example. You are welcome to talk about it and hope you can advise me :)

Related Article

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.