Autocomplete in opensearch
I have done autocomplete functionality for opensearch using WCF. But we are using 3.5, so I now need to achieve the same witho开发者_开发技巧ut using WCF.
Any idea or please send me any useful link.
My scenario is when I type name, it should fetch related name from db and display. I have a webmethod to fetch data from db. All I need is how to mention the template in opensearch.xml. I was mentioning wcfservice.
please help me
You need the following syntax in your search.xml file:
<Url type="application/x-suggestions+json" template="http://www.example.com/searchcontroller/{searchTerms}"/>
If someone starts typing in fre the method on the search controller that looks for suggestions should then return a JSON array of suggestions in this format:
["fre", ["frequent", "freeze", "freak"]]
Have a look at Mozilla's documentation
精彩评论