BlogEngine.NET Architecture and source Code Analysis series Part5: Object Search

Source: Internet
Author: User
Tags blogengine

Ipublishable and search

From the beginning of this article I will introduce some knowledge of the field or give some reference articles for you to read, we do not need to dig deep into these areas of knowledge, as long as the general understanding of it can be, which for our analysis blogengine.net will have a great help. In this article I would like to introduce you to the blogengine.net of the search part of the implementation and support the corresponding standards.

Explain in your own words what an open search is

Open search should also be a standard, now it is more and more popular, remember the first time I saw this dongdong is in the CodeProject. You must have noticed that little toolbar in the upper-right corner of IE7,

We can choose a search provider there, for example: Google, when we enter information to return to the page will be found to jump to the Google results page. So how do you get the information for the provider? How does ie know to go to Google's page? The original is through a standard XML file, the specific format of this file can refer to CodeProject open search file Http://www.codeproject.com/info/OpenSearch.xml, when the

<link rel="search" type="application/opensearchdescription+xml" title="CodeProject" href="http://www.codeproject.com/info/OpenSearch.xml"></link>

This code adds to an HTML head, opens the HTML in the browser and then finds the open search file inside, and then adds a provider to the widget, and when we enter the information in the toolbar and return to the corresponding results page, You can see that this XML file acts as a kind of intermediate bridge. This function requires not only the support of the browser, but also the Web site itself to provide the appropriate support, which is open search. This is similar to the RSS feed discovery mechanism in IE7.

So how do you implement open search support in blogengine.net?

Go to BlogEngine.NET's homepage to view the generated HTML source code we'll see

<link type="application/opensearchdescription+xml" rel="search" title="Name of the blog" href="http://hostname/opensearch.axd" />,

Here's a request for Opensearch.axd, see web.config we notice that Opensearch.axd is handing over BlogEngine.Core.Web.HttpHandlers.OpenSearchHandler processing, this XML is through an HTTP Handler to generate the. In the head of the HTML source we find a lot of *.axd references, which are actually handled using custom HttpHandler, which I will explain in subsequent articles. The XML generated from Opensearchhandler we can see that the URL to perform the search is (like Google's processing) http://hostname/search.aspx?q={searchterms}, Searchterms is the input part, the specific search by the page search.aspx call the core layer of internal logic to complete.

The main part of internal logic ipublishable and search implementation analysis

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.