Skip to content

Commit

Permalink
update docs and podspec
Browse files Browse the repository at this point in the history
  • Loading branch information
thehung111 committed Feb 7, 2017
1 parent bde9be5 commit 8d77355
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Example/Example/SearchViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ class SearchViewController: UIViewController, UITextFieldDelegate, SwiftHUEColor
params!.fl = ["im_url"] // retrieve image url. By default the API only return im_name if does not specify fl parameter
params!.limit = 15 // display 15 results per page

// params?.facets = ["price", "brand"]
// params?.facetsLimit = 10
// params?.facetShowCount = true

ViSearch.sharedInstance.colorSearch( params: params!,
successHandler: {
(data : ViResponseData?) -> Void in
Expand All @@ -162,7 +166,7 @@ class SearchViewController: UIViewController, UITextFieldDelegate, SwiftHUEColor
}
else {
// perform segue here
//dump(data)
// dump(data)
self.recentResponseData = data

DispatchQueue.main.async {
Expand Down
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
- 6.2 [Filtering Results](#62-filtering-results)
- 6.3 [Result Score](#63-result-score)
- 6.4 [Automatic Object Recognition Beta](#64-automatic-object-recognition-beta)
- 6.5 [Facets Filtering](#65-facets-filtering)
7. [Event Tracking](#7-event-tracking)

---
Expand Down Expand Up @@ -564,6 +565,41 @@ params.detection = "bag";

The detected product types are listed in `product_types` together with the match score and box area of the detected object. Multiple objects can be detected from the query image and they are ranked from the highest score to lowest. The full list of supported product types by our API will also be returned in `product_types_list`.

### 6.5 Facets Filtering

You can get the facet results by sending a list of fields to enable faceting on. Here are some limitations on the request:

- Facet fields need to be marked as `searchable` on ViSenze dashboard.
Text field is not supported as facet field even it is `searchable`.
System will return value range, the min, max value for numerical fields which are in ‘int’, ‘float’ type.

- Only facet values that exist in current search results will be returned. For example, if your search results contain 10 unique brands, then the facet filters will return the value for these 10 brands.

- Facet value list is ordered by the item count descendingly.
When the value is set to all (facets = *), all the searchable fields will be used as facet fields.

Name | Type | Description
--- | --- | --- |
facets | array | List of fields to enable faceting.
facets_limit | Int | Limit of the number of facet values to be returned. Only for non-numerical fields.
facets_show_count | Boolean | Option to show the facets count in the response.

```swift
params?.facets = ["price", "brand"]
params?.facetsLimit = 10
params?.facetShowCount = true

// view facet results
ViResponseData.facets

// numerical facet would have a min and max
// ViFacet.min , ViFacet.max

// string fields would have a count (if facetShowCount is set )
// ViFacet.items

```

## 7. Event Tracking

### Send Action For Tracking
Expand Down
2 changes: 1 addition & 1 deletion ViSearchSDK.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Pod::Spec.new do |s|


s.name = "ViSearchSDK"
s.version = "1.1.0"
s.version = "1.2.0"
s.summary = "A Visual Search API solution (Swift SDK)"

s.description = <<-DESC
Expand Down

0 comments on commit 8d77355

Please sign in to comment.