RexYuan / courseNTNU

(Discontinued) NTNU course rating catalog.
The Unlicense
1 stars 0 forks source link

Toward a Better Search Engine 更好的搜尋引擎 #17

Open RexYuan opened 8 years ago

RexYuan commented 8 years ago
  1. Google Chrome Omnibox Tab to Search feature
  2. Check invalid search and prevent SQL Injection
  3. SQL style query search (e.g. - for without)
RexYuan commented 8 years ago

2. First of all, this catches all ASCII symbols.

[!-\/:-@[-`{-~]
RexYuan commented 8 years ago

1. How-to

RexYuan commented 8 years ago

1. 參考 Dictionary.com 的 source code 注意到這行

<link rel="search" type="application/opensearchdescription+xml" href="http://dictionary.reference.com/opensearch_desc.xml" title="Dictionary.com"/>

進入 http://dictionary.reference.com/opensearch_desc.xml 內容是

<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>Dictionary.com</ShortName>
<Description>Look it up at Dictionary.com</Description>
<Image height="16" width="16" type="image/x-icon">
http://static.sfdict.com/en/i/dictionary/newserp/favicon.ico
</Image>
<Url type="text/html" method="get" template="http://dictionary.reference.com/browse/{searchTerms}?r=75&src=ref&ch=dic"/>
</OpenSearchDescription>

詳情見 Open Search 的 Doc