SimpleSearch

SimpleSearch is an easy way to use vector search and traditional text matching to search your dataset. It also supports filtering, sorting and aggregating results.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
required
length ≤ 240

ID of dataset

Body Params
string

Search for documents that contain this query string in your dataset. Use fieldsToSearch parameter to restrict which fields are searched.

"tele" matches "Television", "This television is an excellent product…" 

Example: "tele" 
queryConfig
object

Configuration for traditional search query.

vectorSearchQuery

Prioritise the result list of documents based on semantic similarity to "query" provided here.

For example if field "animaltype_vector_" contains encoded vector values for "cat", lion, "dog","bird", and "query" is set to "kitten", documents with "cat", "lion" will be returned first in the results list. 

It can be an object or a list of objects. 

 

Example payloads: 

{"field":"animaltype_vector_","query":"kitten"} 

[ 

{"field":"animaltype_vector_","query":"kitten","weight":1","model":"text"}, {"field":"animaltype_vector_","query":"https://www.dogimage.com/dogimage.png","model":"image","weight":2} 

] 
instantAnswerQuery
object
fieldsToSearch
array

A list of fields to search using the "query" parameter.

Each item can be field name as a string, or an object with 'field' as field name and optional parameters such as field weight.

Default behaviour is to search all fields. 

Example: ["name",{"field":"favourite_color","weight":0.2}] 
fieldsToSearch
integer

Page of results to return.
Returns results from position pagepageSize to (page+1)pageSize

Default: 0 

Example: 3 
integer

Page size of results to return.
Returns results from position pagepageSize to (page+1)pageSize

Default: 10 

Example: 25 
number

Only return documents with a _relevance above this threshold.

Example: 0.3
boolean
Defaults to true

Add _relevance field to each document containing the documents relevance based on the search criteria.

Example: true
boolean
Defaults to false

Add _dataset field to each document containing the documents parent dataset. Useful when searching multiple datasets at once.

Example: false
boolean

Use the datasets schema to remove parameters that are unsafe before making a request.

For example, fieldsToAggregateStats only supports numeric fields. if this flag is set, all non numeric fields will be removed from fieldsToAggregateStats.

Example: true
sort
object

Prioritise results based on integer, float and boolean fields values. Can sort ascending or descending.

Example 1: {"on_sale":"desc"} 

Example 2: {"price":"asc"} 
includeFields
array of strings

Only return fields of documents listed in this array.

Example: ["name","description_vector_"]
includeFields
excludeFields
array of strings

Don't return fields of documents listed in this array.

Example: ["name","description_vector"]
excludeFields
boolean

Set to true to return all vector fields. includeFields / excludeFields has priority over this rule.

Example: true / false
textSort
object

Prioritise results based on integer, float and boolean fields values. Can sort ascending or descending.

Example 1: {"on_sale":"desc"} 

Example 2: {"price":"asc"} 
fieldsToAggregate
array

Control which fields aggregate data will be generated for. Aggregate data will appear in the "aggregates" property of the response body.

Each list element can be a string like "name" or a dictionary like {"field":"name","resultsSize":11} 

Default: [] 

Example: ["name","price","likes_cats",{"field":"color","resultsSize":20}] 
fieldsToAggregate
fieldsToAggregateStats
array

Control which fields aggregate stats data will be generated for. This includes, min value, max value, average value, and document counts per interval within the dataset.

Aggregate data will appear in the "aggregateStats" property of the response body. 

Each list item can be: 

 a string stating which field to aggregate stats on 

An object containing "field" to pick a field, and "interval" to control the range of each bucket when counting documents:  

For example, if we had products {"price":50},{"price:"150"},{price:"180"},{"field":"price","interval":100}  would split results into 2 buckets. 

Default: [] 
Example: ["postcode",{"field":"price","interval":10}] 
fieldsToAggregateStats
filters
array of objects

Only Include results that match on this list of filters.

"match" property of filters requires "field" to control which field to match on, and an array of items in "value" to dictate exact match values. 

"range" property of filters requires "field" to control which field to match on, and "greaterThan" and/or "lessThan", which must be a number or a date string.

"wildcard" property of filters requires "field" to control which field to match on, and an array of items in "value" to control wildcard match pattern. It may include * to match any string of characters, and ? To match one character. 

"or" property of filters requires either: a list of ( subfilters / list of subfilters) etc. [{"match":...},[{"match":...},{"range":...}]].At least one of the subfilters must evaluate to true. If a subfilter is an array, it performs an AND over the sub-sub-filters. For example, [filter1,[filter2,filter3]] is equivalent to filter1 OR (filter2 AND filter3). 

Example: 
[ 

  { 

    "match":{ 

      "field":"name", 

      "value":["television"] 

    } 

  }, 

  { 

    "wildcard":{ 

      "field":"name", 

      "value":["television*"] 

    } 

  }, 

 

  { 

    "range":{ 

      "field":"price", 

      "greaterThan":5.5, 

      "lessThan":20 

    } 

  }, 

  { 

    "range":{ 

      "field":"postcode", 

      "greaterThan":2000 

    } 

  },   

  { 

    "match":{ 

      "field":"likes_dogs", 

      "value":[true] 

    } 

  }, 

  { 

    "or": [ {"match":{"field":"name","value":["dog"]}},[{"match":{"field":"name","value":["cat"]}},{"wildcard":{"field":"color","value"["orange"]}] ] 

  }, 

 

] 
filters
relevanceBoosters
array of objects

Add relevance to documents if they match conditions in this list. configure 'weight' on each condition to modify the relevance contribution.

relevanceBoosters
afterId
array

Used in future requests to retrieve items after these values in the sort order.

afterId
Response

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json