开发者

Autocomplete in opensearch

开发者 https://www.devze.com 2023-02-09 12:49 出处:网络
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.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消