Add suggestion URL for custom search engine in chrome

前端 未结 2 1202
时光取名叫无心
时光取名叫无心 2021-02-06 04:48

I have a local search engine backed by a elasticsearch and a thin nodejs API for search. I want to be able to search those documents from Google Chrome (builds available from Go

2条回答
  •  半阙折子戏
    2021-02-06 05:36

    I finally found the solution.

    The opensearch.xml document reference can be used as a link in the head section of the HTML page. It contains two URL schemes, one for search results and other for suggestions.

    The details can be found here: Opensearch Document Specs.

    As soon as I updated my index.html and opened the page in Chrome, Chrome automatically added a new search engine. It didn't show that there is a suggestions URL under Settings > Manage search engines.

    Next, I chose my engine as the default search engine by clicking on Make Default and done! Now I can see all the search suggestions in the omnibox without using a keyword.

提交回复
热议问题