Search request format

The Search API supports a number of options to finetune your search query. All options should be supplied as URL encoded HTTP GET parameters.

Example call

https://api.sooqr.com/v1/search/100000/1?q=tee&fl=id,title&fq[brand]=Sooqr

Parameters (GET)

Only the q parameter is required. All other options are optional.
Click on the linked parameter names for more information.

Parameter Type Description
q string Query string
qWildcard boolean (0/1) Sets the wildcard behaviour for queries. Defaults to On.
start integer Starting offset in the resultset
rows integer Number of results to return in resultset
Default to 10
fl string, array One or more fields to return in the resultset. By default, all available fields are returned.
facet boolean (0/1) Enables the faceting component (defaults to off)
fq array One or more filter queries. Requires faceting and the existence of a filter on the specific field.
spellcheck boolean (0/1) Enables the spellchecker component (defaults to off)
sort string, array ID of sort method, based on your mySooqr settings (default to first defined method)

Wildcards

By default, Sooqr appends a asterisk (*) to the end of your query. This triggers a so called 'wildcard search'. This means that the last word in your query also matches segments of that word. Here are a couple of examples:

Query Matches
dres dres, dress, dressing
dress dress, dressing
maxi dres maxi dres, maxi dress
But does not match: maximum dress

This behaviour can be disabled by setting qWildcard=0 in the API call. But a user is still allowed to add an asterisk to their query. This will still trigger a wildcard search. It's also possible to use multiple asterisks in one query.

Query Matches
max* dres* maxi dress, maximum dressing

Response example

{
   "items":[
      {
         "date_sooqr_last_indexed":"2015-12-03T08:46:14Z",
         "id":"408_default",
         "title":"Chelsea Tee",
         "text_text":[
            "Ultrasoft, lightweight V-neck tee. 100% cotton. Machine wash."
         ],
         "image":"https://magento-demo.sooqr.com/media/small_image/120x/m/t/mtk000t.jpg",
         "detail_url":"http://magento-demo.sooqr.com/chelsea-tee-701.html",
         "price":160,
         "index_title":"Chelsea Tee",
         "score":1.239027
      },
      {
         "date_sooqr_last_indexed":"2015-12-03T08:46:14Z",
         "id":"409_default",
         "title":"Chelsea Tee",
         "text_text":[
            "Ultrasoft, lightweight V-neck tee. 100% cotton. Machine wash."
         ],
         "image":"https://magento-demo.sooqr.com/media/small_image/120x/m/t/mtk002t.jpg",
         "detail_url":"http://magento-demo.sooqr.com/chelsea-tee-702.html",
         "price":160,
         "index_title":"Chelsea Tee",
         "score":1.239027
      }
   ],
   "metaData":{
      "numFound":6,
      "maxScore":1.239027,
      "queryTime":8,
      "start":0,
      "rows":10
   },
   "spellcheck":false,
   "facets":false
}

Response format

Items

All results are included in the items node. There a default fields, that are available in (almost) all Sooqr instances. You will find these fields for all results.

Field Type Description
date_sooqr_last_indexed date Timestamp when this result was last updated
detail_url string URL to detail page for this result
id string Unique identifier for this result
image string URL to external image
index_title string Indexed title for this result
price double Current price for this result, including discounts
normal_price double Base price for this result, without discounts
score float Item score within this search query
text_text string Description for this result
title string Display title for this result

Meta data

The metaData node contains information on the search query.

Field Type Description
numFound integer Total number of results for this query
maxScore float Maximum score within this search query. This value has no relation to scores from other search queries.
queryTime integer Number of milliseconds this query took
start integer Start offset within the resultset
rows integer Start offset within the resultset

Facet

For more information, visit the faceting component chapter.

Spellcheck

For more information, visit the spellcheck component chapter.