Skip to content
Merged
Show file tree
Hide file tree
Changes from 62 commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
58c98be
WIP
Feb 6, 2026
4c9bd38
WIP
Feb 11, 2026
de6cb0b
WIP
Feb 23, 2026
9fde6b7
Update Cartfile
Feb 23, 2026
7aecb8d
Update RelevantSortDemoController.swift
Feb 23, 2026
18df020
Update InstantSearch.podspec
Feb 23, 2026
8a2807f
Update Package.swift
Feb 23, 2026
6dcbed1
Wip
Feb 23, 2026
85c443b
WIP
Feb 24, 2026
1eb225b
WIP
Feb 24, 2026
bf3e5da
WIP
Feb 24, 2026
bb21e33
WIP
Feb 24, 2026
5c2fbb3
WIP
Feb 24, 2026
10b52d2
WIP
Feb 24, 2026
5101f15
WIP
Feb 24, 2026
b8c8707
WIP
Feb 24, 2026
e59ef40
WIP
Feb 24, 2026
e792995
WIP
Feb 24, 2026
7a8b020
WIP
Feb 24, 2026
397952c
WIP
Feb 24, 2026
76decf2
Delete HitsConnector+GeoSearch.swift
Feb 24, 2026
2052181
Update CoreUserAgentSetter.swift
Feb 24, 2026
b5b0b26
WIP
Feb 24, 2026
8ed8ce0
WIP
Feb 24, 2026
a112285
WIP
Feb 24, 2026
d43d0d7
Create Indexable.swift
Feb 24, 2026
1f4d6d9
Create TaskAsyncOperation.swift
Feb 24, 2026
d026555
WIP
Feb 24, 2026
26711f9
WIP
Feb 24, 2026
4d0c19e
Update IndexPresenter.swift
Feb 24, 2026
958ebb1
WIP
Feb 24, 2026
3662f52
WIP
Feb 24, 2026
3145a4a
Update FilterTrackable.swift
Feb 24, 2026
6b914da
WIP
Feb 24, 2026
0e014b7
WIP
Feb 24, 2026
85368b2
WIP
Feb 24, 2026
86a2790
WIP
Feb 24, 2026
002b29a
Update FacetListTableController.swift
Feb 24, 2026
34d0fc9
Update StoreItemsTableViewController+SearchResponse.swift
Feb 24, 2026
8af50aa
Update SearchStatsConvertible.swift
Feb 24, 2026
a33c6c2
Update FacetSearchService.swift
Feb 24, 2026
1de42c0
Final Cleanup
Feb 24, 2026
7571142
Ci Updates
Feb 26, 2026
1d1865e
CI UPDATES
Feb 27, 2026
f98ebc0
Update InstantSearch.podspec
Feb 27, 2026
04c6bbe
Delete pods.yml
Feb 27, 2026
44430e4
Update Package.swift
Feb 27, 2026
95930aa
Fix Tests
Feb 27, 2026
aaf2221
Fix Tests
Feb 27, 2026
a107817
Test Fixes
Feb 27, 2026
aea37c4
Test Fixes
Feb 27, 2026
a2f116d
Update swift.yml
Feb 27, 2026
9b77ca3
Test Fixes
Feb 27, 2026
d36681e
Update .swiftlint.yml
Feb 27, 2026
0a4913f
Update EventTracker.swift
Feb 27, 2026
3950a45
Run Swift lint
Feb 27, 2026
eb31a3d
Lint fixes
Feb 27, 2026
3a3ab9e
Test Fixes
Feb 27, 2026
ddf4a60
Test cases failure
Feb 27, 2026
3a63f7d
Update swift.yml
Feb 28, 2026
67f194d
Fix Tests
Mar 2, 2026
71787c7
Update Readme.md
Mar 2, 2026
7cc432b
Update OnlineTestCase.swift
Mar 2, 2026
87eb17f
Integration Test Fixes
Mar 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 0 additions & 16 deletions .github/workflows/carthage.yml

This file was deleted.

35 changes: 0 additions & 35 deletions .github/workflows/pods.yml

This file was deleted.

13 changes: 0 additions & 13 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,3 @@ jobs:
run: swift build
- name: Run tests
run: swift test
test-xcode-16:
runs-on: macos-15
env:
ALGOLIA_APPLICATION_ID_1: ${{ secrets.ALGOLIA_APPLICATION_ID_1 }}
ALGOLIA_ADMIN_KEY_1: ${{ secrets.ALGOLIA_ADMIN_KEY_1 }}
steps:
- uses: actions/checkout@v4
- name: Select Xcode version
run: sudo xcode-select -s '/Applications/Xcode_16.0.app/Contents/Developer'
- name: Build project
run: swift build
- name: Run tests
run: swift test
8 changes: 8 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
excluded:
- .build
- ./Tests
- ./Examples
# implicitly
line_length: 300
identifier_name:
excluded:
- on
- or
- id
function_parameter_count:
warning: 8
error: 10
ignores_default_parameters: true
function_body_length:
warning: 60
error: 100
disabled_rules:
- todo
- implicit_getter
Expand Down
4 changes: 2 additions & 2 deletions Cartfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
github "apple/swift-log" ~> 1.5.4
github "algolia/algoliasearch-client-swift" ~> 8.18.2
github "apple/swift-protobuf" == 1.22.0
github "algolia/algoliasearch-client-swift" ~> 9.37.4
github "apple/swift-protobuf" == 1.26.0
github "algolia/instantsearch-telemetry-native" == 0.1.3
5 changes: 2 additions & 3 deletions Examples/Examples/Demo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@
// Created by Vladislav Fitc on 13/12/2021.
//

import AlgoliaSearchClient
import Foundation
import UIKit

protocol DemoProtocol {
var objectID: ObjectID { get }
var objectID: String { get }
var name: String { get }
var type: String { get }
}

struct Demo: Codable, DemoProtocol {
let objectID: ObjectID
let objectID: String
let name: String
let type: String

Expand Down
10 changes: 7 additions & 3 deletions Examples/Examples/DemoListViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ final class DemoListViewController<Demo: DemoProtocol & Codable>: UITableViewCon
private let cellIdentifier = "cellID"
var groupedDemos: [(groupName: String, demos: [Demo])]

init(indexName: IndexName) {
init(indexName: String) {
searcher = HitsSearcher(client: .instantSearch, indexName: indexName)
filterState = .init()
hitsInteractor = HitsInteractor(infiniteScrolling: .on(withOffset: 10), showItemsOnEmptyQuery: true)
Expand All @@ -44,8 +44,12 @@ final class DemoListViewController<Demo: DemoProtocol & Codable>: UITableViewCon
navigationItem.searchController = searchController
tableView.register(UITableViewCell.self, forCellReuseIdentifier: cellIdentifier)
hitsInteractor.onResultsUpdated.subscribe(with: self) { viewController, results in
let demos = (try? results.extractHits(jsonDecoder: JSONDecoder()) as [Demo]) ?? []
viewController.updateDemos(demos)
do {
let demos: [Demo] = try results.extractHits(jsonDecoder: JSONDecoder())
viewController.updateDemos(demos)
} catch {
print("DemoListViewController: extractHits failed: \(error)")
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion Examples/Examples/DemoViewControllerFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit
// swiftlint:disable cyclomatic_complexity
class DemoViewControllerFactory: ViewControllerFactory {
func viewController(for demo: Demo) -> UIViewController? {
guard let id = Demo.ID(rawValue: demo.objectID.rawValue) else {
guard let id = Demo.ID(rawValue: demo.objectID) else {
return .none
}

Expand Down
6 changes: 3 additions & 3 deletions Examples/Examples/FacetListTableController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ struct TitleDescriptor {
}

class FacetListTableController: NSObject, FacetListController {
var onClick: ((Facet) -> Void)?
var onClick: ((FacetHits) -> Void)?

var tableView: UITableView

var selectableItems: [SelectableItem<Facet>] = []
var selectableItems: [SelectableItem<FacetHits>] = []
let titleDescriptor: TitleDescriptor?
private let cellID = "cellID"

Expand All @@ -35,7 +35,7 @@ class FacetListTableController: NSObject, FacetListController {

// MARK: RefinementFacetsViewController protocol

func setSelectableItems(selectableItems: [SelectableItem<Facet>]) {
func setSelectableItems(selectableItems: [SelectableItem<FacetHits>]) {
self.selectableItems = selectableItems
}

Expand Down
3 changes: 1 addition & 2 deletions Examples/Examples/ShowcaseDemo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
// Created by Vladislav Fitc on 05.04.2022.
//

import AlgoliaSearchClient
import Foundation

struct ShowcaseDemo: Codable, DemoProtocol {
let objectID: ObjectID
let objectID: String
let name: String
let type: String

Expand Down
2 changes: 1 addition & 1 deletion Examples/Examples/ShowcaseDemoViewControllerFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ShowcaseDemoViewControllerFactory: ViewControllerFactory {
}

func viewController(for demo: ShowcaseDemo) -> UIViewController? {
guard let demoID = ShowcaseDemo.ID(rawValue: demo.objectID.rawValue) else {
guard let demoID = ShowcaseDemo.ID(rawValue: demo.objectID) else {
return nil
}

Expand Down
1 change: 0 additions & 1 deletion Examples/Examples/StoreItemTableViewCell+StoreItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// Created by Vladislav Fitc on 13/12/2021.
//

import AlgoliaSearchClient
import Foundation
import InstantSearchCore
import UIKit
Expand Down
1 change: 0 additions & 1 deletion Examples/Examples/StoreItemTableViewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// Created by Vladislav Fitc on 04/11/2021.
//

import AlgoliaSearchClient
import Foundation
import UIKit

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class AlgoliaController {
let facetListController: FacetListObservableController

init() {
searcher = HitsSearcher(appID: "latency",
searcher = try! HitsSearcher(appID: "latency",
apiKey: "1f6fd3a6fb973cb08419fe7d288fa4db",
indexName: "bestbuy")
searchBoxInteractor = .init()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ extension GettingStartedGuide.StepTwo {
lazy var searchController = UISearchController(searchResultsController: hitsViewController)
let hitsViewController = SearchResultsViewController()

let searcher = HitsSearcher(appID: "latency",
apiKey: "1f6fd3a6fb973cb08419fe7d288fa4db",
indexName: "bestbuy")
let searcher = try! HitsSearcher(appID: "latency",
apiKey: "1f6fd3a6fb973cb08419fe7d288fa4db",
indexName: "bestbuy")
lazy var searchConnector = SearchConnector<Item>(searcher: searcher,
searchController: searchController,
hitsInteractor: .init(),
Expand All @@ -162,9 +162,9 @@ extension GettingStartedGuide.StepThree {
lazy var searchController = UISearchController(searchResultsController: hitsViewController)
let hitsViewController = SearchResultsViewController()

let searcher = HitsSearcher(appID: "latency",
apiKey: "1f6fd3a6fb973cb08419fe7d288fa4db",
indexName: "bestbuy")
let searcher = try! HitsSearcher(appID: "latency",
apiKey: "1f6fd3a6fb973cb08419fe7d288fa4db",
indexName: "bestbuy")
lazy var searchConnector = SearchConnector<Item>(searcher: searcher,
searchController: searchController,
hitsInteractor: .init(),
Expand Down Expand Up @@ -205,9 +205,9 @@ extension GettingStartedGuide.StepFour {
lazy var searchController = UISearchController(searchResultsController: hitsViewController)
let hitsViewController = SearchResultsViewController()

let searcher = HitsSearcher(appID: "latency",
apiKey: "1f6fd3a6fb973cb08419fe7d288fa4db",
indexName: "bestbuy")
let searcher = try! HitsSearcher(appID: "latency",
apiKey: "1f6fd3a6fb973cb08419fe7d288fa4db",
indexName: "bestbuy")
lazy var searchConnector = SearchConnector<Item>(searcher: searcher,
searchController: searchController,
hitsInteractor: .init(),
Expand Down Expand Up @@ -249,9 +249,9 @@ extension GettingStartedGuide.StepFive {
lazy var searchController = UISearchController(searchResultsController: hitsTableViewController)
let hitsTableViewController = SearchResultsViewController()

let searcher = HitsSearcher(appID: "latency",
apiKey: "1f6fd3a6fb973cb08419fe7d288fa4db",
indexName: "bestbuy")
let searcher = try! HitsSearcher(appID: "latency",
apiKey: "1f6fd3a6fb973cb08419fe7d288fa4db",
indexName: "bestbuy")
lazy var searchConnector = SearchConnector<Item>(searcher: searcher,
searchController: searchController,
hitsInteractor: .init(),
Expand Down Expand Up @@ -305,9 +305,9 @@ extension GettingStartedGuide.StepSix {
lazy var searchController = UISearchController(searchResultsController: hitsViewController)
let hitsViewController = SearchResultsViewController()

let searcher = HitsSearcher(appID: "latency",
apiKey: "1f6fd3a6fb973cb08419fe7d288fa4db",
indexName: "bestbuy")
let searcher = try! HitsSearcher(appID: "latency",
apiKey: "1f6fd3a6fb973cb08419fe7d288fa4db",
indexName: "bestbuy")
lazy var searchConnector = SearchConnector<Item>(searcher: searcher,
searchController: searchController,
hitsInteractor: .init(),
Expand Down Expand Up @@ -365,9 +365,9 @@ extension GettingStartedGuide.StepSeven {
lazy var searchController = UISearchController(searchResultsController: hitsViewController)
let hitsViewController = SearchResultsViewController()

let searcher = HitsSearcher(appID: "latency",
apiKey: "1f6fd3a6fb973cb08419fe7d288fa4db",
indexName: "bestbuy")
let searcher = try! HitsSearcher(appID: "latency",
apiKey: "1f6fd3a6fb973cb08419fe7d288fa4db",
indexName: "bestbuy")
lazy var searchConnector = SearchConnector<Item>(searcher: searcher,
searchController: searchController,
hitsInteractor: .init(),
Expand Down
3 changes: 2 additions & 1 deletion Examples/Insights/InsightsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ class InsightsViewController: UIViewController {
textFieldController = .init(searchBar: searchController.searchBar)
searchBoxConnector = .init(searcher: searcher,
controller: textFieldController)
let insights = Insights.register(appId: SearchClient.ecommerce.applicationID, apiKey: SearchClient.ecommerce.apiKey)
// Use the same credentials as SearchClient.ecommerce
let insights = try! Insights.register(appId: "latency", apiKey: "927c3fe76d4b52c5a2912973f35a3077")
hitsTracker = .init(eventName: "demo",
searcher: searcher,
insights: insights)
Expand Down
12 changes: 6 additions & 6 deletions Examples/QuerySuggestions/QuerySuggestionsDemoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ final class SearchViewModel: ObservableObject {
init() {
let appID: ApplicationID = "latency"
let apiKey: APIKey = "af044fb0788d6bb15f807e4420592bc5"
let itemsSearcher = HitsSearcher(appID: appID,
apiKey: apiKey,
indexName: "instant_search")
let itemsSearcher = try! HitsSearcher(appID: appID,
apiKey: apiKey,
indexName: "instant_search")
self.itemsSearcher = itemsSearcher
self.suggestionsSearcher = HitsSearcher(appID: appID,
apiKey: apiKey,
indexName: "query_suggestions")
self.suggestionsSearcher = try! HitsSearcher(appID: appID,
apiKey: apiKey,
indexName: "query_suggestions")
self.hits = itemsSearcher.paginatedData(of: Hit<Item>.self)
searchQuery = ""
suggestions = []
Expand Down
28 changes: 17 additions & 11 deletions Examples/Shared/Credentials/Ecommerce.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,31 @@
// Created by Vladislav Fitc on 08/05/2022.
//

import AlgoliaSearchClient
import Foundation
import Search

#if canImport(Recommend)
import Recommend
#endif

extension SearchClient {
static let ecommerce = Self(appID: "latency", apiKey: "927c3fe76d4b52c5a2912973f35a3077")
static let ecommerceRecommend = Self(appID: "XX85YRZZMV", apiKey: "d17ff64e913b3293cfba3d3665480217")
static let ecommerce = try! SearchClient(appID: "latency", apiKey: "927c3fe76d4b52c5a2912973f35a3077")
static let ecommerceRecommend = try! SearchClient(appID: "XX85YRZZMV", apiKey: "d17ff64e913b3293cfba3d3665480217")
}

extension IndexName {
static let ecommerceProducts: IndexName = "STAGING_native_ecom_demo_products"
static let ecommerceProductsAsc: IndexName = "STAGING_native_ecom_demo_products_products_price_asc"
static let ecommerceProductsDesc: IndexName = "STAGING_native_ecom_demo_products_products_price_desc"
static let ecommerceSuggestions: IndexName = "STAGING_native_ecom_demo_products_query_suggestions"
extension String {
static let ecommerceProducts = "STAGING_native_ecom_demo_products"
static let ecommerceProductsAsc = "STAGING_native_ecom_demo_products_products_price_asc"
static let ecommerceProductsDesc = "STAGING_native_ecom_demo_products_products_price_desc"
static let ecommerceSuggestions = "STAGING_native_ecom_demo_products_query_suggestions"
}

#if canImport(Recommend)
extension RecommendClient {
static let ecommerceRecommend = Self(appID: "XX85YRZZMV", apiKey: "d17ff64e913b3293cfba3d3665480217")
static let ecommerceRecommend = try! RecommendClient(appID: "XX85YRZZMV", apiKey: "d17ff64e913b3293cfba3d3665480217")
}
#endif

extension IndexName {
static let ecommerceRecommend: IndexName = "test_FLAGSHIP_ECOM_recommend"
extension String {
static let ecommerceRecommend = "test_FLAGSHIP_ECOM_recommend"
}
Loading
Loading