Search

Search Client

Also you can search for records using our search client library which helps to reduce overheads of creating JSON request
Read more here

Attributes

Field Type Description Default Value
searchFields [array, optional] Search would be applied on the fields defined here. For instance - Name, Price, Category can be made searchable fields
textFacets [array, optional] Text facets to be retrieved. For each of the retrieved facets (eg. color; size; brand), the response will contain a list of facet values (red, blue; small, large; zara…) and associated count of records for that facet value. You would be require to configure facets on the SearchTap dashboard for the collection before fetching its data. If not configured, you would receive an error.

"textFacets": ["vendor","category"]
                    
textFacetFilters [optional] Further refine your search results by defining specific values of a text facet. For instance, if you wish to show results for specific brands only (zara & tommy hilfiger) while applying the facet 'Brand' - use following syntax. The default behavior is to apply no filters.

"textFacetFilters": {
  "vendor": ["parle","britania"],
  "category": ["biscuit","snacks"]
 }
 
numericFacets [optional] Numeric facets as the name suggests, are facets with numeric values (eg. price, age). .numericFacets let's you define the ranges you want to show to the end user along with count of records in that range. You can use the same to create a histogram slider for your front-end UI. You would be require to configure facets on the SearchTap dashboard for the collection before fetching its data. If not configured, you would receive an error. The default behavior is to not fetch any numeric facet value.

"numericFacets": {
  "price": ["[0,100)","[200,300)"]
  }
                           
numericFacetsFilters [optional] Let's you define a lower and an upper bound value for a numeric facet to fetch results lying within the range. The default behavior is to apply no filter.

"numericFacetFilters": {
  "price": ["[0,100)"],
  "discount": ["[0,10)","[10,60)"]
}         
                         
filter [String, optional] Define criteria to further refine your search results. For instance, you can choose to remove Out of Stock" items from the search result page or show only the discounted products with 10% off or more by using following syntax. You can also combine multiple filter conditions by using keywords such as AND, OR, NOT. Feel free to group conditions using brackets (...)
geo [optional] geo Search is a way to refine search results by distance around a given lat, lng co-ordinates. The function is defined as - searchClient.geo(lat,lng, radius), where lat is latitude, lng is longitude and radius is the maximum radius to search around the position (in meters). When provided .geo(...) filter, results are sorted distance wise from the provided lat,lng, upto the radius provided. All results beyond the provided radius are removed from the results. If no radius is provided, results will not be limited but still be sorted on basis of distance from provided lat,lng. The default behavior is to not apply any geo filter.
skip [number, optional] It is used in pagination to bypass a specified number of search results and then return the remaining results. The default value set for skip is 0. 0
count [number, optional] Defines how many results you want to fetch for the given search query. The default value is 30. 30
facetCount [number, optional] Defines the number of items you want to fetch for a defined facet. 100
sort [array, optional] It can be used to further sort the results. For example - Price low to high would display results starting from low price value to high.
typoTolerance [number, optional] Results with typos can also be shown in search results. By default, search queries with only 1 typo will be fetched. queries with only 1 typo will be fetched.
groupBy [string,optional] Get aggregated search results based on specified field critera

"groupBy": "vendor"                    
                    
groupCount [number,optional] Max records under single group

"groupCount": 2
                    

Search records

POST https://<app-unique-id>.fast.searchtap.net/v2

Sample Bodyview raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{
"query": "",
"fields": [
"f3",
"f4"
],
"textFacets": [
"vendor",
"category"
],
"searchFields": [
"title",
"price"
],
"filter": "",
"sort": [
"price",
"discount"
],
"skip": 0,
"count": 30,
"collection": "",
"facetCount": 100,
"groupCount": 2,
"typoTolerance": 1,
"textFacetFilters": {
"vendor": [
"parle",
"britania"
],
"category": [
"biscuit",
"snacks"
]
},
"numericFacets": {
"price": [
"[0,100)",
"[200,300)"
],
"discount": [
"[0,10)",
"[10,60)",
"[60,100)"
]
},
"numericFacetFilters": {
"price": [
"[0,100)"
],
"discount": [
"[0,10)",
"[10,60)"
]
},
"groupBy": "vendor"
}
Response JSONview raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{
"query": {
"query": "yourQuery",
"fields": [
"*"
],
"textFacets": null,
"highlightFields": null,
"searchFields": null,
"filter": null,
"sort": null,
"skip": 0,
"collection": "UNIQUECOLLECTIONID",
"facetCount": 100,
"count": 10,
"groupBy": null,
"groupCount": -1,
"typoTolerance": 1,
"textFacetFilters": {

},
"numericFacets": {

},
"numericFacetFilters": {

},
"filters": [

],
"geo": null
},
"results": [

],
"textFacets": {

},
"numericFacets": {

},
"responseTime": 3,
"totalHits": 0
}