ExpertRec Search API (2.0.0)

Download OpenAPI specification:Download

Introduction

ExpertRec search API can be used to integrate search into your blog, website, e-commerce store, mobile app, backend server, etc.

API key

The API key is a unique identifier for a website/market place. It is generated during the search setup process. A sample API-key would look like- ccdb9cb6-5380-11e8-a8e3-12b6486824f4. It can be obtained in the ExpertRec control panel.

Search Response

  • 0len - number of docs returned in response.
  • 1query - searched query.
  • fq - filter query, send in query parameter is used to restrict result. e.g, fq=brand:Google Pixel&fq=brand:OnePlus these filter will restrict results to brand Google Pixel and OnePlus. Filter query can be applied to any field provided to the search index.
  • sfacets - sfacets can be used to display filter in user interface and can be selected by the user. Sfacets give distinct tuple {name, count, selected} for each field specified as a facet. Fields for sfacets is configured in control panel under Search Ranking -> factes. Selected sfacets value can be sent in filter query (fq) to nerrow down search result. E.g., sfacets in search response for field brand will look like following -
{
  brand:[
    {"name":"Apple", "count":100, "selected":false},
    {"name":"Google Pixel", "count":75, "selected":false}, 
    {"name":"OnePlus","count":60, "selected":true}
    ]
}

Here brand field has three name which can be displayed to end user for selection. Currently selected sfacet for brand is "OnePlus" this can be identifyied by selected variable which is true for "OnePlus". selected filter name must be sent in facet query parameter to filter the results e.g. if user selects additional "Google Pixel", filter query for this selection will become fq=brand:OnePlus&fq=brand:Google Pixel.

  • nf purpose of nf(numeric filter) is same as fq only difference is that nf work for ranges like price.
  • facet_interval similar to sfacet but it will give range in facet value. Facet_interval can be specified only for numeric fieldn't I put tabs in source code?s like price.
  • res it provides varius statistics like time, total search results.
  • results list of documents.

Search

Requesting search results

path Parameters
api_key
required
string

unique search index identifier e.g., ccdb9cb6-5380-11e8-a8e3-12b6486824f4

query Parameters
q
required
string

Search query

size
string
Default: "10"

Number of results expected in a page

page
string
Default: "0"

Requested page number for results

fq
string

Facet query Restrict results to matching

fq=<field_name>:<field_value>

where both field_name and field_value are url encoded

nf
string

Numeric facet query If facet is of numeric type (like a slider), results will be restricted between the min and max value specified.

nf=<field_name>:<min_value>-<max_value>

min_value and max_value are optional. e.g.,

  • For price between 500 and 20000 nf=price:500-20000
  • For Price less than 1000 nf=price:-1000
  • For Price greater than 1000 nf=price:1000-

Responses

200
get /search/{api_key}/
https://searchv7.expertrec.com/v6/search/{api_key}/
http://searchv7.expertrec.com/v6/search/{api_key}/