Home » Community » Proposal » Specifications » OpenSearch » Extensions » Spelling » 1.0 » Draft 1

Contents

[edit] Notice

This is a draft document for public review.

[edit] Introduction

The OpenSearch Spelling Extension allows search engines to include information about a spelling suggestion in the search results.

Example of a search result that includes spelling elements:

 <feed xmlns="http://www.w3.org/2005/Atom" 
       xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"
       xmlns:advertisement="http://a9.com/-/opensearch/extensions/advertisement/1.0/">
   <!-- ... -->
   <entry>
     <!-- ... -->
   </entry>
   <!-- ... -->
   <spell:spelling>
     <spell:suggestion atom:type="TEXT">britney spears</spell:suggestion>
     <spell:prompt atom:type="TEXT">Did you mean</spell:prompt>
     <atom:link rel="spelling" length="0" href="http://example.com/opensearch?q=britney+spears&startIndex=0"/>
   </spell:spelling>
   <spell:related>
    <spell:suggestion atom:type="TEXT">beyonce</spell:suggestion>
    <atom:link rel="related" href="http://example.com/opensearch?q=beyonce"/>
   </spell:related>
 </feed>

[edit] Related Extensions

The OpenSearch Suggestions extension is a JSON-based method for obtaining spelling corrections and search term completions.

This extension is a specification for providing spelling corrections and search suggestions alongside search results in the Atom response document. This method may be more appropriate for search results targeted to mobile devices.

[edit] Namespace

The XML namespace of the OpenSearch Mobile Extension is:

http://a9.com/-/opensearch/extensions/spelling/1.0/

This namespace and a corresponding namespace prefix must be included when the extension is used in an OpenSearch response.

[edit] Elements

[edit] The "spelling" element

The spelling element is used to suggest a spelling correction for the query. Spelling correction hints may be displayed with the search results for the original query.

Requirements: This element may appear zero or one time.

Examples of spelling elements:

 <spell:spelling>
   <spell:suggestion atom:type="TEXT">britney spears</spell:suggestion>
   <spell:prompt atom:type="TEXT">Did you mean</spell:prompt>
   <atom:link rel="spelling" href="http://example.com/opensearch?q=britney+spears"/>
 </spell:spelling>
 <spell:spelling>
   <spell:suggestion atom:type="TEXT">espresso</spell:suggestion>
   <spell:prompt atom:type="TEXT">Did you mean</spell:prompt>
   <atom:link rel="spelling" href="http://example.com/opensearch?q=espresso"/>
 </spell:spelling>

[edit] The "suggestion" sub-element

The suggestion sub-element is an atom:text construct that specifies the suggested spelling correction for the query.

Requirements: This element must appear one time.

Examples of suggestion sub-elements:

 <spell:suggestion atom:type="TEXT">britney spears</spell:suggestion>
 <spell:suggestion atom:type="TEXT">espresso</spell:suggestion>

[edit] The "prompt" sub-element

The prompt sub-element is an atom:text construct that specifies the prompt text displayed near the spelling suggestion.

Requirements: This element must appear one time.

Example of a prompt sub-element:

 <spell:prompt atom:type="TEXT">Did you mean</spell:prompt>

[edit] The "link" sub-element

The link sub-element of spelling is an Atom Link element whose link targets search requests for the suggested spell-corrected query.

Requirements: This element must appear one time.

Examples of link sub-elements:

 <atom:link rel="spelling" href="http://example.com/opensearch?q=britney+spears&startIndex=0"/>
 <atom:link rel="spelling" href="http://example.com/opensearch?q=espresso&startIndex=0"/>


[edit] The "related" element

The related element is used to suggest search terms that are related to the current query but are not spelling corrections.

Requirements: This element may appear zero or more times.

Examples of related elements:

 <spell:related>
   <spell:suggestion atom:type="TEXT">madonna</spell:suggestion>
   <atom:link rel="related" href="http://example.com/opensearch?q=madonna"/>
 </spell:related>
 <spell:related>
   <spell:suggestion atom:type="TEXT">beyonce</spell:suggestion>
   <atom:link rel="related" href="http://example.com/opensearch?q=beyonce"/>
 </spell:related>

[edit] The "suggestion" sub-element

See the suggestion sub-element of spelling for more information.

[edit] The "link" sub-element

See the link sub-element of spelling for more information.


[edit] Authors

Gail Rahn Frederick, Damon Lanphear and Michael "Luni" Libes <opensearch@medio.com> (Medio Systems)

[edit] License

This document is made available by Medio Systems subject to the terms of the Creative Commons Attribution-ShareAlike 3.0 License.