-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from thehung111/master
Add facets filtering support
- Loading branch information
Showing
11 changed files
with
172 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// ViFacet.swift | ||
// ViSearchSDK | ||
// | ||
// Created by Hung on 7/2/17. | ||
// Copyright © 2017 Hung. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
open class ViFacet: NSObject { | ||
|
||
/// facet field name | ||
public var key : String | ||
|
||
/// facet field items for string facets fields | ||
public var items : [ViFacetItem] = [] | ||
|
||
// for numeric facet, a range will be return instead | ||
public var min: Int? = nil | ||
|
||
// for numeric facet, a range with min, max will be returned insted | ||
public var max: Int? = nil | ||
|
||
public init(key: String) { | ||
self.key = key | ||
} | ||
|
||
public init(key: String, items: [ViFacetItem] ) { | ||
self.key = key | ||
self.items = items | ||
} | ||
|
||
|
||
} |
24 changes: 24 additions & 0 deletions
24
ViSearchSDK/ViSearchSDK/Classes/Response/ViFacetItem.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// | ||
// ViFacetItem.swift | ||
// ViSearchSDK | ||
// | ||
// Created by Hung on 7/2/17. | ||
// Copyright © 2017 Hung. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
open class ViFacetItem: NSObject { | ||
public var value : String | ||
public var count : Int? = nil | ||
|
||
public init(value: String) { | ||
self.value = value | ||
} | ||
|
||
public init(value: String, count: Int?) { | ||
self.value = value | ||
self.count = count | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters