Hosted search api- the easy way

Hosted search api- the easy way

Rate this article

Share this article

In this article, we will see how to implement a hosted search API using expertrec.

What is hosted search?

Hosted means- the search engine data resides in the servers of the search engine provider (in this case, expertrec’s servers). This means that all the processes (crawling, indexing and returning search results when a search query is made ) related to making search working on your website, is done on an external server. This means that your website resources are not used when a user types in the search box of your website. It is like renting an external search solution to search within your website.

What is an API? 

Technically, API is the short form of Application programming interface. In common man’s language, API is a way of communicating with any software. When you call an API (for example open the API URL in a browser, it gives some results) You can consume these results in ways you want it.

What is a hosted search API?

It simply means that an external search vendor creates a search engine for you that is residing in his servers and he gives access to your search engine results whenever you call his API.

You can use these results to build your own search engine. You can choose either the default search engine template or  or you can build your own search engine user interface. you can also control the search engine ranking  and add custom rules using the hosted search API.

 

Here is a snapshot of expertrec’s hosted search API. hosted search api

There are two different kinds of hosted search APIs.

  1. Custom search hosted API (for content websites)
  2. E-commerce search autocomplete API.
  3. E-commerce search results page API.

Custom search hosted API-

The results of this API call would be in JSON format. The API Call format is

https://searchv7.expertrec.com/v6/search/{org_id}/?q={keyword}&page={pagination}&size={number_of_search_results}

Expertrec site search API parameters-

  1. org_id- Your unique ID that identifies your website/ websites.
  2. q- Keyword.
  3. page- pagination
  4. size- number of search results to be displayed.

E-commerce autocomplete API- 

https://searchv7.expertrec.com/v6/suggestion/api_key/?q={search_query}&ssize={suggestion_size}&psize={popular_products_size}&csize={category_size}
  1. api_key– Can be obtained from your control panel (uniquely identifies your website).
  2. q-search query (example- apple)
  3. ssize– number of search suggestions (numeric value)
  4. psize-number of popular products.(numeric value)
  5. csize– number of categories to be displayed.

Hosted e-commerce search results API

https://searchv7.expertrec.com/v6/search/api_key/?q={search_query}&size={number_of_search_results}&page={pagination}&fq={facet_query}&nf={numeric_search_filters}&sort={sort_search_results}
  1. api_key– Can be obtained from your control panel (uniquely identifies your website).
  2. q-search query (example- apple)
  3. size– number of search results (example -15)
  4. page – pagination (example -0, 1, 2…10)
  5. fq– facet query (example- fq=category:”Apple”) the facet of filter the user clicks on.
  6. nf- numeric filter query( for price range filters. example- price:400-1000)
  7. sort-sort search results (example: score:desc (for descending (high to low) and score:asc (for ascending(high to low))hosted search api

Add Search to your Wordpress Website

 

Are you showing the right products, to the right shoppers, at the right time? Contact us to know more.
You may also like