Microsoft Site Search Engine Insider (ZT)

xiaoxiao2021-03-06  41

Since our core architecture is based on XML, transplantation to a model that will use .NET Framework Web services is really simple, and these .NET Framework web services are based on new ASP technology (ASP technology Active Server Method (ASMX) page). The SEARCH architecture consists of three components: Word Parsing and VocabularyBest Betssearch ResultsSearch architecture is the same as based on ASP-based versions (see Figure 1). Let us understand each component in depth. Figure 1. After the user submits the query, (1) Put the query first to the parser (PARSER) to analyze and vocabulary analysis, (2) Pass the display terminology of the project to Best Bets, (3) ) The preferred term and the remaining item of the found item are passed to Search Results, (4) Compile the XML document generated using the XSL style sheet, (5) Submit the user's web browser. HTML. Click to zoom in. Word Parsing and vocabulary _ This is a Windows script component containing a C COM object that exposes various terms segmentation procedures for all languages ​​supported in the SEARCH. This design is essentially because the interface of the entry segmentation program is not easy to write a feet, and typically requires a package of C can be buffed (although this is a way: will explain this later). In the process of transplanting the .NET framework, we use the type list exporter (TLBIMP.EXE) on the C object, and call it through the .NET, so you can call existing COM objects. . Vocabulary Object Run XPath (Query the language of the XML document) query to map the search terms to the preferred term. It also removes interference entry and produces a formatted data structure, suitable for consumption of Best Bets and Search Results components. An important result is that this fairly complex small script is ported to C #, we can also continue to call traditional objects from it.

The following is a code sample small in Vocabulary Object: // We return an array of VocabularyObjects after parsing the user's search // text This ability to create simple typed structures in C # vastly improves // our code modularity and self-documentation Here.. is the definition of // VocabularyObject: public struct VocabularyObject {public string PREFERREDTERM; // structure memberspublic string DISPLAYTERM; public bool fOUND; public string ORIGPHRASE; public bool MULTITERM; public bool MULTIWORD; // Constructorpublic VocabularyObject (string preferredterm, bool found, string origphrase, bool multiterm, bool multiword, string displayterm) {PREFERREDTERM = preferredterm; fOUND = found; oRIGPHRASE = origphrase; MULTITERM = multiterm; MULTIWORD = multiword; dISPLAYTERM = displayterm;}.} // Example usage Because the parameters to the objects Constructor is // typed, we'll get a compiler error message if a string WASETEGER // WHERE A STRING WAS EXPECTED, for Example. this is a very nice feature // over traditional scripting environments! VocabularObject Vo ("Microsoft DirectX", True, "DX", False, False, "DirectX"); one of the NET environments is that you can create multi-data structures for the entire code. The last line above is the statement instance of how to use the code structure of these Vocabulary Object. Best Bets _ This is a small script component that provides XPath queries for localized XML documents and can generate a URL link for addiction. The XML document is loaded in the application range of each Search application instance, and can work properly and can be tightly coupled to the method of the Vocabulary object. Transplanting small scripts are 100% conversion to the .NET framework, and can utilize System.IO and XML DataNavigator classes (System.newxml namespace). This is the easiest portable component. It is almost the transition from JScript from JScript to C #. We only make some changes to the code in some places to use the new XML DataNavigator class - to query and update the .NET universal language running time part of the XML document. Search Results - This complex component is connected to Site Server 3.0 to obtain an actual page description and link matching with the customer's search query. It also contains a perfect cache algorithm.

Building a parallel solution At the time we were experiencing, we also transplanted the entire Search application to the .NET framework for ASP technology while developing Search 2.5. Since this application is to be launched before the PDC date and transplant it to .NET, turn hours, we decided to launch these two versions at the same time, and listed at the same time. Obviously, this is a daunting task because we must manage new versions, understand all functions of the new .NET framework and new language metaphors, build servers with various software platform services, and so on. About how we make this project, there is a fun story. In order to ensure simultaneous launch of two versions (Search 2.5 and .NET frameworks, we determine which components that first grasp in the project planning phase are unchanged, which components change the most in the development process and which components are suitable for which technology and language. We It is also possible to determine the goal early, try to break down this app and transplanted according to the way customers may adopt. Because our Microsoft.com people always treat customers in conducting technical decisions and research on investment, the various problems faced, so, We break this application transplantation process into a number of parts, each part is close to the method that the customer may take. We want to ensure that every job, including the simplest port (ie, small script transplant to JScript classes) Until the maximum time and technical interests - fully utilize the C # programming language to completely transplant to .NET framework (100% manageable code space). Below is some of our steps we take to respond to this challenge: First, we will mainly The ASP page is converted to ASP . Initially, we call the small script through the .NET Reflection technology so that we can call typical COM objects through the query type library. Important knowledge: We start from the programming model with ASP (where , Data, business logic, and representation are all mixed), then use ASP to fully object to the method, and finally data separation, programming, and UI. Second, handle the simplest small script and transplant it. Bestbets The simplest components do not rely on COM components. We decided to use System.IO, XML Data Navigator, and C # programming languages ​​as DLL transplants. We want to completely transplant this component to the controlled environment and make it fully utilized XML Data Navigator. Important: We learned NewXML namespace. At the same time, we removed .NET Reflection when porting components. This way we can call these components in this manner. Then we handle the vocabulary small script. This component In the intermediate of this application in complexity and code line. It consists of a small script that contains business and text parsing rules for Search, and calls C components. We created the purpose of this component to pack The COM is a boot call of the breakprow. This component has the greatest advantage in the movement to the controlled space. This complex component is all transplanted to the .NET framework and C # programming language. This requires some techniques, because it contains more complex Function logic and need to take advantage of a custom COM object. But this is not too difficult. The next step will abandon C packaging and call this Some interfaces. Important: We have changed the function and logic to benefit from the key advantage of C # such as the type of security. When using JScript, developers must remember the type (integer, string) of each variable. C # will do this for you.

转载请注明原文地址:https://www.9cbs.com/read-74876.html

New Post(0)