Adding a custom search

Bing Custom Search gives you the opportunity to add a powerful, tailored search experience to your own applications. It allows you to search specifically for topics you care about.

By using the portal at https://www.customsearch.ai/, you can create a custom view of the web.

Typical workflow

If you want to build a custom search web page, the following steps describe the typical workflow.

  1. Create a custom search instance: This can be done at the portal linked in the previous section.
  2. Add active entries: This is a list of sites that should be included in the search results.
  3. Add blocked entries: This is a list of sites that should be excluded from the search results.
  4. Add pinned entries: If any search term should have websites pinned to the top of the search result, it should be specified in the pinned entries section.
  5. Configure hosted UI: Set the layout, color theme, and other options for the hosted UI.
  6. Publish the search instance: Publish the custom search instance.

Consuming the search instance

There are three ways to consume the custom search instance.

The first, and easiest option, is to integrate a JavaScript snippet. Once you have published the search instance, you will be provided with a pre-configured JavaScript snippet, rendering the hosted UI. This can be pasted into your existing web page. This will render the search form on your website.

Another option is to link to the custom HTML site directly. This is the link used in a JavaScript snippet, but it is only used directly.

The last option is to use the REST API directly from your own code. We will not go into deeper details on this in this book.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.12.108.175