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

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- 

  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

  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

 


muthali ganesh

Muthali loves writing about emerging technologies and easy solutions for complex tech issues. You can reach out to him through chat or by raising a support ticket on the left hand side of the page.